-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Switch v1 collector pipeline to v2 Writer #6491
Conversation
Signed-off-by: Yuri Shkuro <github@ysh.us>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6491 +/- ##
===========================================
+ Coverage 50.22% 96.25% +46.02%
===========================================
Files 188 372 +184
Lines 11403 21360 +9957
===========================================
+ Hits 5727 20559 +14832
+ Misses 5218 610 -4608
+ Partials 458 191 -267
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
Signed-off-by: Yuri Shkuro <github@ysh.us>
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.
looks great - just a couple of questions
@@ -116,7 +117,7 @@ func TestNewCollector(t *testing.T) { | |||
ServiceName: "collector", | |||
Logger: logger, | |||
MetricsFactory: baseMetrics, | |||
SpanWriter: spanWriter, | |||
TraceWriter: v1adapter.NewTraceWriter(spanWriter), |
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.
instead of the wrapping the existing spanWriter, is it possible for spanWriter to be natively of type tracestore.Writer
?
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.
This will have a large knock-off effect on many tests, which are later introspecting the data in v1 model. I don't think it's worth it. In the follow-up PRs where we actually enable native v2 writer in the handlers there might be other tests for v2 code paths.
Signed-off-by: Yuri Shkuro <github@ysh.us>
} | ||
|
||
sp.queue.StartConsumers(sp.numWorkers, func(item queueItem) { | ||
sp.processItemFromQueue(item) | ||
}) | ||
|
||
err = sp.otelExporter.Start(context.Background(), sp.telset.Host) |
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.
@yurishkuro what's the reason we're starting a new context here rather than propagating it from upstream?
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.
same reason, trying to minimize the changes
we have some missing code coverage - are these code paths not testable? |
there are two forms of missing coverage, one is for errors coming from OTEL constructor, which is quite difficult to induce, and the other is from the writer errors - those will get added once we actually start using the v2 writer. |
## Which problem is this PR solving? - Context is lost in the process, see #6491 (comment) ## Description of the changes - Add Context argument to handler and span processor methods ## How was this change tested? - CI --------- Signed-off-by: Yuri Shkuro <github@ysh.us>
## Which problem is this PR solving? - Part of jaegertracing#6487 - Part of jaegertracing#6474 ## Description of the changes - Swap v1 spanWriter for v2 traceWriter in collector pipeline - Currently the traceWriter is provided via v1 adapter, so it's always v1 writer underneath - And since only v1 spans entry point is currently implemented, there is no performance impact from additional data transformations - However, as soon as OTLP entry point is utilized (e.g. via OTLP receiver), the `ptrace.Traces` batch will be handled via exporterhelp queue as a single item (not broken into individual spans) and then passed directly to the writer as a batch. Since the writer is implemented via adapter the batch will be converted to spans and written one span at a time. There will be no additional data transformations on this path either. ## How was this change tested? - CI ## Outstanding - [x] Invoking proper preprocessing, like sanitizers and collector tags, on the OTLP path - [x] Adequate metrics parity, ideally same as v1 collector - [ ] Test coverage, including passing a v2-like (mock) writer that cannot be downgraded to v1 - Idea: parameterize some tests (ideally those that also validate pre-processing) to execute both v1 and v2 write paths ## Follow-up PRs * Enable v2 write path from OTLP and Zipkin receivers (they currently explicitly downgrade to v1). This will also allow adding better unit tests. --------- Signed-off-by: Yuri Shkuro <github@ysh.us> Signed-off-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
## Which problem is this PR solving? - Context is lost in the process, see jaegertracing#6491 (comment) ## Description of the changes - Add Context argument to handler and span processor methods ## How was this change tested? - CI --------- Signed-off-by: Yuri Shkuro <github@ysh.us>
Which problem is this PR solving?
Description of the changes
ptrace.Traces
batch will be handled via exporterhelp queue as a single item (not broken into individual spans) and then passed directly to the writer as a batch. Since the writer is implemented via adapter the batch will be converted to spans and written one span at a time. There will be no additional data transformations on this path either.How was this change tested?
Outstanding
Follow-up PRs