-
Notifications
You must be signed in to change notification settings - Fork 132
Hybrid agent context management #1589
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
Hybrid agent context management #1589
Conversation
✅MegaLinter analysis: Success
See detailed reports in MegaLinter artifacts |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop-hybrid-core-tracing #1589 +/- ##
==============================================================
Coverage ? 79.88%
==============================================================
Files ? 213
Lines ? 25060
Branches ? 3980
==============================================================
Hits ? 20020
Misses ? 3617
Partials ? 1423 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
7b8ade6 to
d61ac06
Compare
e8ab06d to
63d7803
Compare
hmstepanek
left a comment
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.
Just gonna post this anyway if there's anything that is still relevant after the changes we discussed.
hmstepanek
left a comment
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.
Out of time but posting a partial review-I'll look at the rest tomorrow.
newrelic/api/opentelemetry.py
Outdated
| # precedence over whatever sampling algorithm is | ||
| # enabled. | ||
|
|
||
| if self.otel_parent: |
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.
As I understand it from Chris - we need to always return sampled=True in order to fake OTEL into thinking the span is being sampled and collect data on it. Then we use our internal sampling decision later to decide whether we are actually going to sample it (aka add it to our reservoir).
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.
That's actually a fair point. Either way, it's going to get there...
Co-authored-by: Hannah Stepanek <hstepanek@newrelic.com>
| # This is an HTTP request (WSGI, ASGI, or otherwise) | ||
| nr_environ = context_carrier.copy() | ||
| attributes["nr.http.headers"] = nr_environ | ||
| attributes["nr.http.headers"] = context_carrier |
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.
Just wondering why we had/got rid of the copy here?
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 realized I was not actually manipulating the header data anymore, so I could just pass in the contents of the carrier directly as an attribute
Co-authored-by: Hannah Stepanek <hstepanek@newrelic.com>

This PR contains a barebones implementation for Distributed Tracing/context propagation using OTel and NR APIs