Repository navigation
OpenTelemetry tracing for the CLI - #306
Open
davidabram wants to merge 7 commits into
Open
davidabram wants to merge 7 commits into
davidabram wants to merge 7 commits into
Conversation
davidabram
added this pull request to stack #302
October 9, 2026 10:11
Reintroduce opt-in OpenTelemetry tracing in five sequenced phases while first closing the existing unredacted tracing path. Define metadata-only export, bounded OTLP/HTTP delivery, W3C propagation, managed telemetry credentials, and instrumentation for critical operations without changing CLI durability or lock semantics. Plan: sce-opentelemetry-tracing Tasks: T01-T13 Co-authored-by: SCE <sce@crocoder.dev>
Tracing subscribers can observe raw event fields and error chains, so classify event IDs and typed operational values before they reach tracing while preserving the existing local log output. Add Boundary A and Boundary B policies, capture tests, and a source inventory that prevents new unclassified tracing fields or dynamic messages. Update the observability contract and telemetry plan with the boundary, hook-gate, and feature-enabled test constraints. Plan: sce-opentelemetry-tracing (T01, T03, T04, T05, T07, T09, T10, T11) Co-authored-by: SCE <sce@crocoder.dev>
Admit OTel attributes only through closed enums and route all SCE tracing through typed boundary emitters, preventing secret-like strings and unclassified values from reaching telemetry. Add a syn-based audit that rejects tracing bypasses and unsafe messages or fields, and update the observability contract and T01 completion evidence. Ref: plan sce-opentelemetry-tracing (T01) Co-authored-by: SCE <sce@crocoder.dev>
Keep telemetry disabled by default while enabling an environment-selected standalone OTLP/HTTP runtime for permitted commands. Resolve the mode from `SCE_TELEMETRY`, gate hooks through typed command classification, scope a private subscriber across every future poll, enforce the Boundary B exporter allowlist, and propagate the subscriber to the audited spawned task. Record the dependency, build-impact, and runtime contract details for the completed implementation. Plan: `context/plans/sce-opentelemetry-tracing.md` (T03) Co-authored-by: SCE <sce@crocoder.dev>
Ensure telemetry teardown cannot block command completion by moving provider shutdown to a detached thread with a bounded flush budget, while preserving command output and failure behavior. Add the feature-gated loopback test receiver, lifecycle markers, subprocess latency coverage, and lock-isolation tests for the controlled export path. Add counted default and feature-enabled test passes, packaged-binary exclusion checks, cargo test-count guard coverage, and the required Flatpak vendor sources. Update the observability contracts and record the completed implementation and measurements for T04. Ref: context/plans/sce-opentelemetry-tracing.md T04 Co-authored-by: SCE <sce@crocoder.dev>
Measure typed hook invocation latency across disabled, reachable, blackhole, and refused loopback receiver modes with the feature-enabled benchmark script and lifecycle markers. Record roughly 4-5 ms healthy/refused overhead and roughly 105 ms blackhole overhead at the candidate 100 ms budget, then select 100 ms as the candidate hook flush budget. Keep production hook export disabled pending shutdown testing at that budget, gate verification, and an explicit user-owned enablement policy. Add the reproducible benchmark script and context evidence, and update T05 in the `sce-opentelemetry-tracing` plan. Co-authored-by: SCE <sce@crocoder.dev>
Honor valid TRACEPARENT/TRACESTATE environment values when creating the `sce.command` span so subprocess telemetry preserves its remote trace relationship. Use SDK extraction with validation, apply the parent through OpenTelemetry, and fall back to an independent root for absent or malformed values while honoring unsampled parents. Add focused extraction and propagation coverage and update the observability contracts and completed plan task. Plan: `sce-opentelemetry-tracing` T06 Co-authored-by: SCE <sce@crocoder.dev>
This branch has not been deployed
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.
No description provided.