Replace OpenTelemetry SDK with direct tracing-subscriber layer - #446
Open
Ziinc wants to merge 2 commits into
Open
Replace OpenTelemetry SDK with direct tracing-subscriber layer#446Ziinc wants to merge 2 commits into
Ziinc wants to merge 2 commits into
Conversation
Contributor
|
🚀 Web preview: https://preview-446.treq-9zy.pages.dev |
…l SDK - profile.release: lto = "thin" -> "fat" for whole-program link-time optimization - gix: drop unused blocking-network-client and worktree-mutation features (code only uses gix::open + local ref read/write; network/checkout ops go through jj-lib, not gix directly) - telemetry: replace the opentelemetry/opentelemetry_sdk/appender-tracing/ stdout pipeline with a minimal tracing_subscriber::Layer that writes JSON lines directly. The log file was already write-only (no reader parses the OTLP shape back); core/checks_logs.rs builds its own OTel-shaped SQLite records independently and is unaffected.
The OTel SDK (SdkLoggerProvider, OpenTelemetryTracingBridge, FileLogExporter) this PR replaces was still referenced by core_logging_test.rs after the merge with main, breaking CI (unresolved opentelemetry* crates). Rewrite the test against the new JsonLogLayer, exposing it as pub(crate)->pub so tests can construct it directly with a thread-local subscriber instead of the removed OTel pipeline.
Ziinc
force-pushed
the
claude/bundle-size-increase-4k6rkh
branch
from
September 13, 2026 18:40
7beeb45 to
f75718f
Compare
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.
Summary
Simplifies the telemetry pipeline by removing the OpenTelemetry SDK dependency and replacing it with a custom
tracing_subscriber::Layerimplementation that writes JSON logs directly to disk.Key Changes
opentelemetry,opentelemetry_sdk,opentelemetry-appender-tracing, andopentelemetry-stdoutdependenciesJsonLogLayer: A minimaltracing_subscriber::Layerthat writes one JSON object per line to the log file, replacing the previous OTel pipeline (SdkLoggerProvider + OpenTelemetryTracingBridge + hand-rolled OTLP exporter)TelemetryGuards: Removed manualDropimplementation andManuallyDropwrappers; now just holds aWorkerGuardfor its Drop implotlp_log_record,any_value_to_otlp,otel_value_to_otlpfunctions) since the log file is only consumed internallyMessageVisitorstruct implementingtracing::field::Visitto extract message and field data from tracing eventsgixfeatures (blocking-network-client,worktree-mutation)Implementation Details
The new
JsonLogLayercaptures tracing events and writes them as JSON with:timeUnixNano: Current timestamp in nanoseconds since UNIX_EPOCHseverityText: Log level from event metadatatarget: Event target from metadatamessage: Extracted from the "message" fieldfields: All other recorded fields as a mapThis approach eliminates unnecessary complexity since the log file is not parsed back by external tools (unlike
core/checks_logs.rswhich builds its own OTel-shaped records independently).https://claude.ai/code/session_01CrEKvdwuSyrEhoLhMig91S