-
Notifications
You must be signed in to change notification settings - Fork 51
Implement OpenTelemetry tracing #194
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
Conversation
Codecov ReportBase: 74.01% // Head: 73.98% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #194 +/- ##
==========================================
- Coverage 74.01% 73.98% -0.04%
==========================================
Files 413 414 +1
Lines 25564 25619 +55
Branches 560 560
==========================================
+ Hits 18920 18953 +33
- Misses 6558 6581 +23
+ Partials 86 85 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I look forward to trying it out!
def self.with_context(hash) | ||
if @otel_enabled | ||
extracted_context = OpenTelemetry.propagation.extract(hash) | ||
OpenTelemetry::Context.with_current(extracted_context) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So you inject_context and then use with_context to link together the tracing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep
db_statement: :include, | ||
} | ||
c.use 'OpenTelemetry::Instrumentation::HttpClient' | ||
c.use 'OpenTelemetry::Instrumentation::AwsSdk' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All these use
statements are how OpenTelemetry can instrument and interpret various nested calls within Ruby?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The use statements enable built in instrumentors provided by OpenTelemetry. So they automatically inject spans for calls to the associated libraries.
closes #171
To test add to compose.yaml:
Add to .env: