Skip to content

feat(sdk): add otel.sdk.processor.log.processed self-diagnostics metric#3514

Open
cijothomas wants to merge 1 commit into
open-telemetry:mainfrom
cijothomas:cijothomas/sdk-self-diagnostics-log-processed
Open

feat(sdk): add otel.sdk.processor.log.processed self-diagnostics metric#3514
cijothomas wants to merge 1 commit into
open-telemetry:mainfrom
cijothomas:cijothomas/sdk-self-diagnostics-log-processed

Conversation

@cijothomas
Copy link
Copy Markdown
Member

Adds the otel.sdk.processor.log.processed counter to BatchLogProcessor, following the OTel SDK metrics semantic conventions.

Gated behind the existing experimental_metrics_bound_instruments feature flag — bound instruments make this practical on the hot path (~1.8 ns per emit vs ~50 ns with unbound).

Changes:

  • BatchLogProcessor emits a counter on every emit() call with three attribute variants: success, queue_full, and processor_shutdown
  • OTLP examples reordered to set up MeterProvider first (so the processor gets a real meter)
  • Shutdown order corrected to tracer → logger → meter
  • Design doc added at docs/design/observability.md
  • Ignored test added (runs in isolation in CI via test.sh)

Ordering requirement: global::set_meter_provider() must be called before creating the LoggerProvider. Rust's global::meter() returns a snapshot, not a delegate. See the design doc for details.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 11, 2026

Codecov Report

❌ Patch coverage is 49.33333% with 38 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.8%. Comparing base (dfdc478) to head (36d0e77).

Files with missing lines Patch % Lines
opentelemetry-sdk/src/logs/batch_log_processor.rs 49.3% 38 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main   #3514     +/-   ##
=======================================
- Coverage   82.8%   82.8%   -0.1%     
=======================================
  Files        130     130             
  Lines      27289   27364     +75     
=======================================
+ Hits       22622   22680     +58     
- Misses      4667    4684     +17     

☔ 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.

@cijothomas cijothomas force-pushed the cijothomas/sdk-self-diagnostics-log-processed branch from 9ed6cfd to 36d0e77 Compare May 11, 2026 20:20
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.

1 participant