[POC] Emit otel.sdk.component.shutdown event from BatchLogRecordExportProcessor and OtlpLogExporter#7406
Draft
cijothomas wants to merge 6 commits into
Draft
Conversation
…Processor and OtlpLogExporter
❌ 1 Tests Failed:
View the full list of 1 ❄️ flaky test(s)
To view more test analytics, go to the Test Analytics Dashboard |
Contributor
|
This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or pushing will instruct the bot to automatically remove the label. This bot runs once per day. |
- Move emission from BatchLogRecordExportProcessor + OtlpLogExporter to LoggerProviderSdk.Shutdown (one event per provider). - Use error.type (absent=success, 'timeout'/'failed' on failure) instead of custom otel.component.shutdown.result enum. - Revert BLP + OtlpLogExporter + PublicAPI.Unshipped.txt to main. - Update tests to validate provider-level event shape.
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
- LoggerProviderSdk.Dispose: call this.Shutdown(5000) instead of this.Processor?.Shutdown(5000) directly. - TracerProviderSdk.Dispose: call OnShutdown via idempotency guard. - MeterProviderSdk.Dispose: same pattern. - Tests: clear self-obs logger before disposing selfObsLoggerFactory to avoid capturing the self-obs provider's own shutdown event.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
POC validating open-telemetry/semantic-conventions#3723 (
otel.sdk.component.shutdownevent) end-to-end in .NET. Cross-language companion to the Rust POC (open-telemetry/opentelemetry-rust#3552).Emits one
otel.sdk.component.shutdownevent per provider instance whenShutdown()is called. All three providers are covered.Event shape
otel.component.typelogger_provider/tracer_provider/meter_providerotel.component.name<type>/N(e.g.logger_provider/0)error.typetimeoutorfailedon failureotel.component.shutdown.durationSeverity: INFO when successful, WARN when
error.typepresent.Scope
LoggerProviderSdk.Shutdown(int)(src/OpenTelemetry/Logs/LoggerProviderSdk.cs)TracerProviderSdk.OnShutdown(int)(src/OpenTelemetry/Trace/TracerProviderSdk.cs)MeterProviderSdk.OnShutdown(int)(src/OpenTelemetry/Metrics/MeterProviderSdk.cs)Disposepaths route through the instrumentedShutdown/OnShutdownso the event fires onusing-style disposal too.SdkSelfObservability.EmitProviderShutdownEventdispatching via a process-globalILogger(POC mechanism; production design would use per-provider injection).Out of scope