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

Switch v1 collector pipeline to v2 Writer #6491

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

yurishkuro
Copy link
Member

@yurishkuro yurishkuro commented Jan 6, 2025

Which problem is this PR solving?

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

  • Invoking proper preprocessing, like sanitizers and collector tags, on the OTLP path
  • 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

Copy link

codecov bot commented Jan 6, 2025

Codecov Report

Attention: Patch coverage is 79.76190% with 17 lines in your changes missing coverage. Please review.

Project coverage is 96.22%. Comparing base (10af185) to head (98be3d7).

Files with missing lines Patch % Lines
cmd/collector/app/span_processor.go 84.00% 8 Missing and 4 partials ⚠️
storage_v2/v1adapter/writer.go 16.66% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6491      +/-   ##
==========================================
- Coverage   96.25%   96.22%   -0.04%     
==========================================
  Files         372      372              
  Lines       21282    21347      +65     
==========================================
+ Hits        20485    20541      +56     
- Misses        609      616       +7     
- Partials      188      190       +2     
Flag Coverage Δ
badger_v1 10.65% <16.66%> (-0.03%) ⬇️
badger_v2 2.78% <0.00%> (-0.01%) ⬇️
cassandra-4.x-v1-manual 16.54% <16.66%> (-0.03%) ⬇️
cassandra-4.x-v2-auto 2.71% <0.00%> (-0.01%) ⬇️
cassandra-4.x-v2-manual 2.71% <0.00%> (-0.01%) ⬇️
cassandra-5.x-v1-manual 16.54% <16.66%> (-0.03%) ⬇️
cassandra-5.x-v2-auto 2.71% <0.00%> (-0.01%) ⬇️
cassandra-5.x-v2-manual 2.71% <0.00%> (-0.01%) ⬇️
elasticsearch-6.x-v1 20.20% <16.66%> (-0.04%) ⬇️
elasticsearch-7.x-v1 20.27% <16.66%> (-0.03%) ⬇️
elasticsearch-8.x-v1 20.44% <16.66%> (-0.03%) ⬇️
elasticsearch-8.x-v2 2.77% <0.00%> (-0.01%) ⬇️
grpc_v1 12.29% <16.66%> (-0.03%) ⬇️
grpc_v2 9.09% <0.00%> (-0.01%) ⬇️
kafka-3.x-v1 10.33% <16.66%> (-0.03%) ⬇️
kafka-3.x-v2 2.78% <0.00%> (-0.01%) ⬇️
memory_v2 2.78% <0.00%> (+<0.01%) ⬆️
opensearch-1.x-v1 20.33% <16.66%> (-0.03%) ⬇️
opensearch-2.x-v1 20.32% <16.66%> (-0.03%) ⬇️
opensearch-2.x-v2 2.78% <0.00%> (+<0.01%) ⬆️
tailsampling-processor 0.51% <0.00%> (-0.01%) ⬇️
unittests 95.10% <79.76%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

yurishkuro and others added 4 commits January 6, 2025 17:43
Signed-off-by: Yuri Shkuro <[email protected]>
Signed-off-by: Yuri Shkuro <[email protected]>
Signed-off-by: Yuri Shkuro <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant