Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .changeset/rust-otel-correlation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
'@smooai/logger': patch
---

Rust: log lines now carry the active OTel span's real W3C `traceId`/`spanId`
(guarded on `span_context.is_valid()`), falling back to the correlation uuid,
and are teed into `tracing` so a single subscriber sees both.

`ContextKey` is now `#[non_exhaustive]`. It gains a variant whenever the family
learns a new correlation field — `SpanId` is this release's — and without that
attribute each addition is a source-breaking change for any downstream crate
matching on it exhaustively.
167 changes: 148 additions & 19 deletions rust/logger/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions rust/logger/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,21 @@ uuid = { version = "1", features = ["v4"] }
chrono = { version = "0.4", features = ["serde", "clock"] }
colored = "2"
url = "2"
# OpenTelemetry **API only** (no SDK, no `@smooai/observability` — that would be
# circular): read the active span's trace_id/span_id for log↔trace correlation,
# and the `tracing` facade to tee lines into the observability OTLP appender.
tracing = { version = "0.1", default-features = false, features = ["std"] }
lambda_runtime = { version = "0.13", optional = true }
aws_lambda_events = { version = "0.16", default-features = false, features = [
"apigw",
"sqs",
], optional = true }
opentelemetry = { version = "0.32.0", default-features = false, features = ["trace"] }

[dev-dependencies]
tempfile = "3"
# Correlation + tee tests: a real SDK tracer to mint an active span, and a
# tracing subscriber to capture the teed events (dev-only — the SDK dep is not
# circular; the crate itself depends on the OTel API only).
opentelemetry_sdk = { version = "0.32", features = ["trace"] }
tracing-subscriber = { version = "0.3", default-features = false, features = ["registry", "std"] }
Loading
Loading