Repository navigation
(OTEL) Minimally integrate OpenTelemetry - #1795
Open
Mikey Lombardi (He/Him) (michaeltlombardi) wants to merge 1 commit into
Open
Mikey Lombardi (He/Him) (michaeltlombardi) wants to merge 1 commit into
Mikey Lombardi (He/Him) (michaeltlombardi) wants to merge 1 commit into
Conversation
Mikey Lombardi (He/Him) (michaeltlombardi)
force-pushed
the
otel/main/minimal-otel
branch
2 times, most recently
from
November 10, 2026 22:31
d3c7b85 to
ba57040
Compare
Mikey Lombardi (He/Him) (michaeltlombardi)
requested a balanced review from Copilot
November 10, 2026 22:32
Copilot started reviewing on behalf of
Mikey Lombardi (He/Him) (michaeltlombardi)
November 10, 2026 22:33
Prior to this change, the DSC library only supported basic tracing
functionality using the `tracing` crate. It used the `tracing` macros
to emit events, which the CLI then emitted to stderr.
This change:
- Updates the `dsc-lib-telemetry` crate to re-export the following
external crates from the crate root:
- `opentelemetry` as `otel`
- `opentelemetry_sdk` as `otel_sdk`
- `opentelemetry_semantic_conventions` as `otel_conventions`
- `tracing`
- `tracing_indicatif`
- `tracing_log`
- `tracing_opentelemetry` as `tracing_otel`
- `tracing_subscriber`
This enables crates to take a singular dependency on
`dsc-lib-telemetry` and gain access to all the re-exported tracing
and OpenTelemetry functionality.
For this initial implementation, the re-exports aren't gated behind
crate features.
- Restructures the `dsc-lib-telemetry` crate to:
- Replace the public `basic` module with the `BasicTracingOptions`
struct with a private `options` module and re-export the renamed
`DscTracingOptions` struct from the crate root.
The re-exports for tracing crates are moved to the crate root for
more ergonomic access.
- Move the definition for `StderrFormat` from the crate root into
the private `stderr_format` module and re-export the enum from the
crate root.
- Implements the `FormatEvent` trait for a custom tracing event
formatter named `DscTracingEventFormatter`. This formatter keeps the
same formatting used by the previous implementation except that it
discards span information from the console output.
This is necessary as we migrate to tracing spans with open telemetry
because the upstream formatter emits extremely noisy span information
before the event message and any included payloads.
- Enhances the `TracingOptions` API to support initializing a tracing
subscriber with and without OpenTelemetry integration.
In the initial implementation, the OpenTelemetry integration uses a
no-op exporter for spans. The implementation continues to emit event
data to stderr as before. Exporting spans to an actual OpenTelemetry
backend or file depends on defining a contract for telemetry exporting
extensions for DSC and is deferred at this time.
- Updates the CLI to immediately start a root span after setting up
tracing. This ensures that all subsequent tracing events are captured
within the context of the root span, providing a consistent tracing
structure for the application's execution.
Future changes are required to further define spans for discrete
operations within the application, ensuring that tracing captures
meaningful and structured telemetry data throughout the execution
flow.
Mikey Lombardi (He/Him) (michaeltlombardi)
force-pushed
the
otel/main/minimal-otel
branch
from
November 10, 2026 22:58
ba57040 to
cfd7308
Compare
Mikey Lombardi (He/Him) (michaeltlombardi)
marked this pull request as ready for review
November 10, 2026 22:58
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.
PR Summary
This change:
Updates the
dsc-lib-telemetrycrate to re-export the following external crates from the crate root:opentelemetryasotelopentelemetry_sdkasotel_sdkopentelemetry_semantic_conventionsasotel_conventionstracingtracing_indicatiftracing_logtracing_opentelemetryastracing_oteltracing_subscriberThis enables crates to take a singular dependency on
dsc-lib-telemetryand gain access to all the re-exported tracing and OpenTelemetry functionality.For this initial implementation, the re-exports aren't gated behind crate features.
Restructures the
dsc-lib-telemetrycrate to:Replace the public
basicmodule with theBasicTracingOptionsstruct with a privateoptionsmodule and re-export the renamedDscTracingOptionsstruct from the crate root.The re-exports for tracing crates are moved to the crate root for more ergonomic access.
Move the definition for
StderrFormatfrom the crate root into the privatestderr_formatmodule and re-export the enum from the crate root.Implements the
FormatEventtrait for a custom tracing event formatter namedDscTracingEventFormatter. This formatter keeps the same formatting used by the previous implementation except that it discards span information from the console output.This is necessary as we migrate to tracing spans with open telemetry because the upstream formatter emits extremely noisy span information before the event message and any included payloads.
Enhances the
TracingOptionsAPI to support initializing a tracing subscriber with and without OpenTelemetry integration.In the initial implementation, the OpenTelemetry integration uses a no-op exporter for spans. The implementation continues to emit event data to stderr as before. Exporting spans to an actual OpenTelemetry backend or file depends on defining a contract for telemetry exporting extensions for DSC and is deferred at this time.
Updates the CLI to immediately start a root span after setting up tracing. This ensures that all subsequent tracing events are captured within the context of the root span, providing a consistent tracing structure for the application's execution.
Future changes are required to further define spans for discrete operations within the application, ensuring that tracing captures meaningful and structured telemetry data throughout the execution flow.
PR Context
Prior to this change, the DSC library only supported basic tracing functionality using the
tracingcrate. It used thetracingmacros to emit events, which the CLI then emitted to stderr.Important
This change depends on #1769