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

BatchSpanProcessor with dedicated thread. #2456

Merged

Conversation

lalitb
Copy link
Member

@lalitb lalitb commented Dec 19, 2024

Fixes #2454

Changes

  • The existing runtime-based BatchSpanProcessor has been moved to separate module - span_processor_with_async_runtime - which is enabled behind the feature-flag: experimental_trace_batch_span_processor_with_async_runtime. This is consistent with the batch-processor in logs, and periodic-reader in metrics. Feel free to ignore this during review. It's more of movement from one-file to another.
  • The thread-based BatchSpanProcessor, is added inside span_processor module, and re-exported as the default batch processor. chunk-based concurrent export features (which is present in runtime-based BatchSpanProcessor is not implemented as of now. Will be added later.

Merge requirement checklist

  • CONTRIBUTING guidelines followed
  • Unit tests added/updated (if applicable)
  • Appropriate CHANGELOG.md files updated for non-trivial, user-facing changes
  • Changes in public API reviewed (if applicable)

@lalitb lalitb requested a review from a team as a code owner December 19, 2024 10:09
@lalitb lalitb marked this pull request as draft December 19, 2024 10:09
Copy link

codecov bot commented Dec 19, 2024

Codecov Report

Attention: Patch coverage is 85.75380% with 103 lines in your changes missing coverage. Please review.

Project coverage is 77.2%. Comparing base (6209c06) to head (a16e50c).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...sdk/src/trace/span_processor_with_async_runtime.rs 81.5% 60 Missing ⚠️
opentelemetry-sdk/src/trace/span_processor.rs 91.2% 34 Missing ⚠️
opentelemetry-sdk/src/trace/runtime_tests.rs 0.0% 5 Missing ⚠️
opentelemetry-sdk/src/trace/provider.rs 0.0% 2 Missing ⚠️
opentelemetry-zipkin/src/exporter/mod.rs 0.0% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main   #2456     +/-   ##
=======================================
+ Coverage   76.9%   77.2%   +0.2%     
=======================================
  Files        123     124      +1     
  Lines      22581   23009    +428     
=======================================
+ Hits       17379   17765    +386     
- Misses      5202    5244     +42     

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

@lalitb lalitb requested a review from Copilot December 20, 2024 04:11
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

opentelemetry-sdk/src/trace/span_processor.rs Outdated Show resolved Hide resolved
opentelemetry-sdk/src/trace/span_processor.rs Outdated Show resolved Hide resolved
@lalitb
Copy link
Member Author

lalitb commented Dec 22, 2024

most stuff should work, apart from integration tests. Will be looking into it. Will make this ready for review after that.

Done

@lalitb lalitb added the integration tests Run integration tests label Dec 23, 2024
@lalitb lalitb requested a review from Copilot December 23, 2024 07:06

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 7 out of 16 changed files in this pull request and generated no comments.

Files not reviewed (9)
  • opentelemetry-zipkin/src/exporter/mod.rs: Evaluated as low risk
  • opentelemetry-sdk/benches/batch_span_processor.rs: Evaluated as low risk
  • opentelemetry-sdk/src/trace/provider.rs: Evaluated as low risk
  • opentelemetry-sdk/src/testing/trace/in_memory_exporter.rs: Evaluated as low risk
  • examples/tracing-jaeger/src/main.rs: Evaluated as low risk
  • examples/tracing-grpc/src/client.rs: Evaluated as low risk
  • examples/tracing-grpc/src/server.rs: Evaluated as low risk
  • opentelemetry-sdk/Cargo.toml: Evaluated as low risk
  • opentelemetry-otlp/examples/basic-otlp/src/main.rs: Evaluated as low risk
@lalitb lalitb marked this pull request as ready for review December 23, 2024 10:57
@lalitb lalitb changed the title [WIP] BatchSpanProcessor with dedicated thread. BatchSpanProcessor with dedicated thread. Dec 23, 2024
runtime: R,
) -> Self {
let batch = BatchSpanProcessor::builder(exporter, runtime).build();
pub fn with_batch_exporter<T: SpanExporter + 'static>(self, exporter: T) -> Self {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs to called out in changelog.md file.

@@ -165,13 +164,12 @@ impl ZipkinPipelineBuilder {
/// Install the Zipkin trace exporter pipeline with a batch span processor using the specified
/// runtime.
#[allow(deprecated)]
pub fn install_batch<R: RuntimeChannel>(
pub fn install_batch(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add this to changelog as this is breaking.

Copy link
Member

@cijothomas cijothomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
Few nit comments, we can fix in follow ups.

@cijothomas cijothomas merged commit 1f35467 into open-telemetry:main Dec 23, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration tests Run integration tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BatchProcessing for Spans should use own thread by default
2 participants