Skip to content

Commit

Permalink
Register span processor for sentry to fix OTel export (#1311)
Browse files Browse the repository at this point in the history
This should fix the OpenTelemetry export issue.
It may be reverted in the future when `dependabot-core/updater` makes other changes.

See https://docs.sentry.io/platforms/ruby/tracing/instrumentation/opentelemetry/
  • Loading branch information
mburumaxwell authored Aug 24, 2024
1 parent 01b06c3 commit 6af66d2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions updater/lib/dependabot/opentelemetry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def self.configure
puts "OpenTelemetry is enabled, configuring..."

require "opentelemetry/exporter/otlp"
require "sentry-opentelemetry"

# OpenTelemetry instrumentation expects the related gem to be loaded.
# While most are already loaded by this point in initialization, some are not.
Expand All @@ -49,8 +50,14 @@ def self.configure
config.use "OpenTelemetry::Instrumentation::Faraday"
config.use "OpenTelemetry::Instrumentation::HTTP"
config.use "OpenTelemetry::Instrumentation::Net::HTTP"

# https://docs.sentry.io/platforms/ruby/tracing/instrumentation/opentelemetry/
config.add_span_processor(::Sentry::OpenTelemetry::SpanProcessor.instance)
end

# https://docs.sentry.io/platforms/ruby/tracing/instrumentation/opentelemetry/
::OpenTelemetry.propagation = ::Sentry::OpenTelemetry::Propagator.new

tracer
end

Expand Down

0 comments on commit 6af66d2

Please sign in to comment.