Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions config/initializers/opentelemetry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
instrumentation_config = { "OpenTelemetry::Instrumentation::Rack" => { untraced_endpoints: ["/up"] } }
c.use_all(instrumentation_config)

if ENV["OTEL_PROPAGATORS"] == "xray"
# The ID Generator can only be configured through code. Gate it behind the propagator env var to keep things agnostic.
c.id_generator = OpenTelemetry::Propagator::XRay::IDGenerator
end

# Disable logging for Rake tasks to avoid cluttering output
c.logger = Logger.new(File::NULL) if Rails.const_defined?(:Rake) && Rake.application.top_level_tasks.any?
end