Skip to content

Commit eac5540

Browse files
committed
Add and configure OpenTelemetry for tracing
This will auto-hook into Rails and other libraries to produce traces. No explicit trace spans are created yet, only automatic instrumentation. The only explicit configuration is to avoid tracing the /up endpoint used for health checks. This prevents a large number of unhelpful traces from being created. All other configuration is provided through environment variables, specified in `forms-deploy`. We also disable logging for Rake tasks to avoid cluttering output when running tasks like database migrations. Finally, OpenTelemetry is only enabled if the `ENABLE_OTEL` environment variable is set to "true". This allows us to control whether tracing is active without changing the code. Again, this is configured in `forms-deploy` when deploying to different environments.
1 parent 319e15c commit eac5540

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Gemfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,9 @@ group :test do
123123
# For validating against the JSON schema for form submissions
124124
gem "json_schemer"
125125
end
126+
127+
gem "opentelemetry-sdk", "~> 1.10"
128+
gem "opentelemetry-instrumentation-all", "~> 0.89.1"
129+
130+
gem "opentelemetry-exporter-otlp", "~> 0.31.1"
131+
gem "opentelemetry-propagator-xray", "~> 0.26.0"

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1043,4 +1043,4 @@ RUBY VERSION
10431043
ruby 3.4.8p72
10441044

10451045
BUNDLED WITH
1046-
2.7.1
1046+
2.6.9

0 commit comments

Comments
 (0)