-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[exporterhelper] persist spancontext through persistent queue #12934
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
[exporterhelper] persist spancontext through persistent queue #12934
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #12934 +/- ##
==========================================
+ Coverage 91.27% 91.32% +0.05%
==========================================
Files 508 509 +1
Lines 28736 28840 +104
==========================================
+ Hits 26228 26338 +110
+ Misses 1992 1988 -4
+ Partials 516 514 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
810232e
to
769c00e
Compare
hello @mx-psi @bogdandrutu if either of you have time to take a look. Thanks. |
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.
Are you sure we need to persist span links at all? I think I mentioned this before, but I'm pretty sure we only need to persist the SpanContext across the queue; span links are only created after the queue, based on the current SpanContext, in the batcher.
good point, I should maybe clean up the variable names to make it clear I am only persisting the SpanContext of the Link struct with this change |
33738ca
to
07e356a
Compare
5c45407
to
7ae2f3d
Compare
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.
Given that this would require a mechanism to fallback to the old unmarshalling, I believe, we need to combine it with preserving the context metadata keys to address #10110, #11780, open-telemetry/opentelemetry-collector-contrib#38666
I don't think we need to put it in the same PR. I would suggest the following plan:
- We release this PR with an alpha feature gate. We can call it something like
exporter.persistRequestContext
. - Then we add the metadata keys marshaling/unmarshaling. That probably should be ok to do in as a breaking change if released separately because the feature gate is disabled by default. By breaking change I mean we don't need to support marshaling/unmarshaling between the span context only and span context + metadata keys.
- Once the combined context marshaling/unmarshaling is released, give it some time. Then we can graduate the feature gate to beta.
- Graduate the feature gate to stable.
cc @open-telemetry/collector-approvers WDYT?
exporter/exporterhelper/internal/queuebatch/persistent_queue.go
Outdated
Show resolved
Hide resolved
bf84c21
to
20cde3d
Compare
8eda24f
to
b82031e
Compare
Basic benchmark (
Same benchmark with previous commit (byte-based wrapper alongside request, no additional Storage Ops)
With the contrived benchmark (Nop storage client, simple uint64 encoding), skipping extra storage steps is faster. I am looking into the specifics of the benchmark I wrote yesterday to see if there are any issues, and if I can run it against this branch instead. With the more realistic benchmark added in my fork in Datadog repo, see the following results: Add SpanContext as separate key and add Storage operations
Pass marshaled SpanContext as extra bytes along with the request, no extra Storage operations
As we can see, when there is more data than a single |
c88a904
to
700b678
Compare
something odd is happening with test-coverage failing when I move some of the tests and logic into a separate file. Will look into this further next week. |
PTAL at the linter failure |
d7e0af4
to
cf73142
Compare
I've prototyped a PR that addresses comments from @bogdandrutu and brings us to the end state that we discussed. I can proceed with breaking it down to mergable PRs once I get an initial review |
@jackgopack4 thank you for the starting the work! #13188 is merged now, so this can be closed |
Description
Adds code to marshal/unmarshal current SpanContext in the persistent queue. This will enable proper tracking of internal telemetry (these internal spans were getting dropped when using storage/persistent queue).
Link to tracking issue
Fixes #11740
Fixes #12212
Testing
Unit tests for new functionality
Documentation
.chloggen