Skip to content

Conversation

@cijothomas
Copy link
Member

  1. Add a new processor under experimental feature flag.
  2. This is to facilitate discussions in OTel spec about adding such a component to the official spec itself.
  3. This is NOT useful as-is with any existing exporters in this repo (like OTLP Log Exporter
  4. This is an initial version. Next, I'll introduce ways to ensure that only those exporters that can support concurrent exporting will be paired with ConcurrentExporter. This is one possible way spec could evolve. Alternatively, existing processors can be modified to export concurrently if the exporter advertises that they are okay with that!. BatchLogProcessor also need to evolve to support concurrent exporting in the future.
  5. Also modified Stress test to use the new experimental processor to compare the perf numbers with Concurrent vs Existing SimpleProcessor.
  6. SimpleProcessor did not have a public new method and it did not implement event_enabled. This addresses that also, as it was required to run stress test comparison. Can do this in a separate PR it helps review easier.

Spec discussion:
open-telemetry/opentelemetry-specification#4231

@cijothomas cijothomas requested a review from a team as a code owner March 10, 2025 23:40
@codecov
Copy link

codecov bot commented Mar 10, 2025

Codecov Report

Attention: Patch coverage is 25.64103% with 29 lines in your changes missing coverage. Please review.

Project coverage is 79.6%. Comparing base (52cd0e9) to head (fe5f455).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...telemetry-sdk/src/logs/concurrent_log_processor.rs 0.0% 28 Missing ⚠️
opentelemetry-sdk/src/logs/simple_log_processor.rs 90.9% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main   #2780     +/-   ##
=======================================
- Coverage   79.7%   79.6%   -0.1%     
=======================================
  Files        123     124      +1     
  Lines      23136   23174     +38     
=======================================
+ Hits       18448   18456      +8     
- Misses      4688    4718     +30     

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

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@lalitb lalitb left a comment

Choose a reason for hiding this comment

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

LGTM.

if let Ok(exporter) = self.exporter.lock() {
exporter.event_enabled(level, target, name)
} else {
true
Copy link
Contributor

Choose a reason for hiding this comment

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

Wondering why true is returned to enable events if the exporter cannot be locked?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point! Not sure what is the right behavior here.
Since true is the default, I opted for true. It can be argued that if the lock got poisoned, no logs can be exported anyway, so returning false also is valid.

Good to revisit this. I'll probably revisit the need of Mutex lock in SimpleLogProcessor, and use atomics to achieve the goal is ensuring one export() is active at a time. With that, we won't face the lock poison issue.

@cijothomas cijothomas merged commit 8aa5b00 into open-telemetry:main Mar 11, 2025
22 of 23 checks passed
@cijothomas cijothomas deleted the cijothomas/experimental-concurrentprocessor branch March 11, 2025 23:01
bantonsson pushed a commit to bantonsson/opentelemetry-rust that referenced this pull request Oct 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants