Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add span and trace origins #2319

Merged
merged 10 commits into from
Jun 7, 2024
Merged

Add span and trace origins #2319

merged 10 commits into from
Jun 7, 2024

Conversation

sl0thentr0py
Copy link
Member

@sl0thentr0py sl0thentr0py commented Jun 6, 2024

  • Add :origin attribute to span and use in trace context and span hash
  • Add origin to Rack::CaptureExceptions
  • Add origin to Net::HTTP
  • Add origin to Redis
  • Add origin to Metrics
  • Add origin to DelayedJob
  • Add origin to OpenTelemetry
  • Add origin to Resque
  • Add origin to Sidekiq
  • Add origin to Rails

closes #2068

@sl0thentr0py sl0thentr0py changed the title neel/span origin Add span and transaction origins Jun 6, 2024
Copy link

codecov bot commented Jun 6, 2024

Codecov Report

Attention: Patch coverage is 98.76543% with 1 line in your changes missing coverage. Please review.

Project coverage is 98.68%. Comparing base (7b00b25) to head (5c988f8).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2319      +/-   ##
==========================================
+ Coverage   98.66%   98.68%   +0.01%     
==========================================
  Files         205      205              
  Lines       13422    13486      +64     
==========================================
+ Hits        13243    13308      +65     
+ Misses        179      178       -1     
Components Coverage Δ
sentry-ruby 99.04% <100.00%> (+0.01%) ⬆️
sentry-rails 97.41% <96.96%> (-0.02%) ⬇️
sentry-sidekiq 97.01% <100.00%> (+0.02%) ⬆️
sentry-resque 97.11% <100.00%> (+0.35%) ⬆️
sentry-delayed_job 98.92% <100.00%> (+<0.01%) ⬆️
sentry-opentelemetry 100.00% <100.00%> (ø)
Files Coverage Δ
...entry-delayed_job/lib/sentry/delayed_job/plugin.rb 100.00% <100.00%> (ø)
sentry-delayed_job/spec/sentry/delayed_job_spec.rb 100.00% <100.00%> (ø)
...lemetry/lib/sentry/opentelemetry/span_processor.rb 100.00% <100.00%> (ø)
...y/spec/sentry/opentelemetry/span_processor_spec.rb 100.00% <100.00%> (ø)
sentry-rails/lib/sentry/rails/action_cable.rb 100.00% <100.00%> (ø)
sentry-rails/lib/sentry/rails/active_job.rb 100.00% <100.00%> (ø)
...entry-rails/lib/sentry/rails/capture_exceptions.rb 96.66% <100.00%> (+0.11%) ⬆️
...y-rails/lib/sentry/rails/controller_transaction.rb 95.45% <100.00%> (+0.21%) ⬆️
...ntry/rails/tracing/action_controller_subscriber.rb 100.00% <100.00%> (ø)
...lib/sentry/rails/tracing/action_view_subscriber.rb 100.00% <100.00%> (ø)
... and 23 more

... and 1 file with indirect coverage changes

@sl0thentr0py sl0thentr0py changed the title Add span and transaction origins Add span and trace origins Jun 6, 2024
@sl0thentr0py
Copy link
Member Author

rails CI is broken due to
rails/sprockets-rails#524

Copy link
Member

@adinauer adinauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -8,7 +8,8 @@ class Plugin < ::Delayed::Plugin
# need to symbolize strings as keyword arguments in Ruby 2.4~2.6
DELAYED_JOB_CONTEXT_KEY = :"Delayed-Job"
ACTIVE_JOB_CONTEXT_KEY = :"Active-Job"
OP_NAME = "queue.delayed_job".freeze
OP_NAME = "queue.delayed_job"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was .freeze removed from OP_NAME on purpose?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some files have this on top so it applies to all strings by default
https://docs.ruby-lang.org/en/3.0/syntax/comments_rdoc.html#label-frozen_string_literal+Directive

I'll clean this up separately, just syntax nicety and it's not consistent in some files.

@@ -8,7 +8,8 @@ class Plugin < ::Delayed::Plugin
# need to symbolize strings as keyword arguments in Ruby 2.4~2.6
DELAYED_JOB_CONTEXT_KEY = :"Delayed-Job"
ACTIVE_JOB_CONTEXT_KEY = :"Active-Job"
OP_NAME = "queue.delayed_job".freeze
OP_NAME = "queue.delayed_job"
SPAN_ORIGIN = "auto.queue.delayed_job"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not all of the span origins have the .freeze call, should they?

@sl0thentr0py sl0thentr0py merged commit c317a7a into master Jun 7, 2024
129 checks passed
@sl0thentr0py sl0thentr0py deleted the neel/span-origin branch June 7, 2024 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Send trace and span origin
2 participants