Skip to content

feat(sdk): POC emit otel.sdk.component.shutdown event from BatchLogProcessor and OTLP gRPC log exporter#3552

Draft
cijothomas wants to merge 11 commits into
open-telemetry:mainfrom
cijothomas:cijothomas/poc-sdk-shutdown-event
Draft

feat(sdk): POC emit otel.sdk.component.shutdown event from BatchLogProcessor and OTLP gRPC log exporter#3552
cijothomas wants to merge 11 commits into
open-telemetry:mainfrom
cijothomas:cijothomas/poc-sdk-shutdown-event

Conversation

@cijothomas

@cijothomas cijothomas commented Jun 11, 2026

Copy link
Copy Markdown
Member

POC validating open-telemetry/semantic-conventions#3723 (otel.sdk.component.shutdown event) end-to-end in Rust. Cross-language companion to the .NET POC (open-telemetry/opentelemetry-dotnet#7406).

Emits one otel.sdk.component.shutdown event per provider instance when shutdown() ends. All three providers are covered.

Event shape

Attribute Value
otel.component.type logger_provider / tracer_provider / meter_provider
otel.component.name <type>/N (e.g. logger_provider/0)
error.type absent on success; timeout or failed on failure
otel.component.shutdown.duration wall-clock seconds (includes all child shutdowns)

Severity: INFO when successful, WARN when error.type present.

Scope

  • LoggerProvider::shutdown_with_timeout (opentelemetry-sdk/src/logs/logger_provider.rs)
  • SdkTracerProvider::shutdown_with_timeout (opentelemetry-sdk/src/trace/provider.rs)
  • SdkMeterProvider::shutdown_with_timeout (opentelemetry-sdk/src/metrics/meter_provider.rs)
  • Dispose routes through Shutdown so the event fires on Drop-initiated cleanup too (Rust: explicit shutdown() only; Drop is a safety net).
  • Uses otel_info!/otel_warn! with quoted-key support (feat(api): accept quoted-key fields in otel logging macros #3567).
  • In-tree semconv registry (semconv/) + weaver live-check workflow validates the event against the registry in CI.

Out of scope

  • Per-component events (future refinement if operators need which processor/exporter failed).
  • Timeout classification from MeterProvider (ignores timeout param today; always reports failed).

@codecov

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 56.00000% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.0%. Comparing base (fb2af9d) to head (b1a7fad).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
opentelemetry-sdk/src/logs/logger_provider.rs 56.0% 11 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main   #3552     +/-   ##
=======================================
- Coverage   83.0%   83.0%   -0.1%     
=======================================
  Files        130     130             
  Lines      27952   28015     +63     
=======================================
+ Hits       23210   23262     +52     
- Misses      4742    4753     +11     

☔ View full report in Codecov by Harness.
📢 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 changed the title POC- Shutdown event [POC] Emit otel.sdk.component.shutdown event from BatchLogProcessor and OTLP gRPC log exporter Jun 22, 2026
@cijothomas cijothomas changed the title [POC] Emit otel.sdk.component.shutdown event from BatchLogProcessor and OTLP gRPC log exporter feat(sdk): POC emit otel.sdk.component.shutdown event from BatchLogProcessor and OTLP gRPC log exporter Jun 23, 2026
- Move emission from BatchLogProcessor + TonicLogsClient to
  LoggerProvider.shutdown_with_timeout (one event per provider).
- Use error.type (absent=success, 'timeout'/'failed' on failure)
  instead of custom otel.component.shutdown.result enum.
- otel.component.type = 'logger_provider'.
- Revert batch_log_processor.rs and tonic/logs.rs to main (no
  per-component emission).
Each provider now emits otel.sdk.component.shutdown with:
- otel.component.type: tracer_provider / meter_provider / logger_provider
- otel.component.name: <type>/<N>
- error.type: absent on success, 'timeout'/'failed' on failure
- otel.component.shutdown.duration: wall-clock seconds
@cijothomas
cijothomas force-pushed the cijothomas/poc-sdk-shutdown-event branch from b1a7fad to df1dda1 Compare June 26, 2026 13:48
- In-tree semconv registry (semconv/) declaring the shutdown event
  with attributes (local until semconv#3723 is released upstream).
- Dedicated live-check example that creates a LoggerProvider, calls
  shutdown(), and lets the event flow to weaver via OTLP.
- Workflow using weaver-live-check-{start,stop} composite actions
  with fail-on: violation.
Second call to shutdown_with_timeout now returns AlreadyShutdown
immediately without emitting an event, matching Logger/TracerProvider.
@github-actions

Copy link
Copy Markdown

Thank you for your contribution! This PR has been automatically marked as stale because it has not had activity in the last 14 days. This may be due to a delay in review on our side or awaiting a response from you; either is fine, and we appreciate your patience.

It will be closed in 14 days if no further activity occurs. Pushing a new commit or leaving a comment will remove the stale label and keep the PR open.

@github-actions github-actions Bot added the Stale label Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

1 participant