Files
codex/codex-rs/otel/Cargo.toml
T
Abhinav 154e8736a5 Support managed OpenTelemetry metadata and PEM client identities (#57658)
## Why

Managed OpenTelemetry requirements could not specify span attributes or tracestate metadata.

## What changed

- Accept `otel.span_attributes` and `otel.tracestate` in requirements, merge them by attribute or member field, and expose them through app-server configuration and requirements reads.
- Protect required entries and their ancestors from configuration writes while preserving unmanaged sibling values and their origins. For example, requiring `otel.tracestate.vendor.tenant` leaves `vendor.region` writable. Empty metadata maps impose no requirements.
- Select Rustls when configuring an OTLP HTTP client certificate and private key so PEM client identities are accepted.

## Testing

Add coverage for metadata precedence, effective configuration, field-level write protection, and preservation of unmanaged values. Add blocking and asynchronous HTTP client construction tests using generated PEM certificates and keys.

GitOrigin-RevId: ada6000cc5e575b9a33451ec4aa58b6686dc20f7
2026-10-28 06:24:24 +00:00

78 lines
2.1 KiB
TOML

[package]
name = "codex-otel"
version.workspace = true
edition.workspace = true
license.workspace = true
[lib]
doctest = false
name = "codex_otel"
path = "src/lib.rs"
[lints]
workspace = true
[dependencies]
bytes = { workspace = true }
codex-http-client = { workspace = true }
opentelemetry-http = "0.31.0"
chrono = { workspace = true }
codex-utils-absolute-path = { workspace = true }
codex-utils-stream-parser = { workspace = true }
codex-utils-string = { workspace = true }
codex-api = { workspace = true }
codex-protocol = { workspace = true }
eventsource-stream = { workspace = true }
gethostname = { workspace = true }
opentelemetry = { workspace = true, features = ["logs", "metrics", "trace"] }
opentelemetry-appender-tracing = { workspace = true }
opentelemetry-otlp = { workspace = true, features = [
"grpc-tonic",
"http-proto",
"http-json",
"logs",
"metrics",
"trace",
"reqwest-blocking-client",
"reqwest-rustls",
"tls",
"tls-roots",
]}
opentelemetry-semantic-conventions = { workspace = true }
opentelemetry_sdk = { workspace = true, features = [
"experimental_trace_batch_span_processor_with_async_runtime",
"experimental_metrics_custom_reader",
"logs",
"metrics",
"rt-tokio",
"testing",
"trace",
] }
http = { workspace = true }
os_info = { workspace = true }
reqwest = { workspace = true, features = ["blocking", "rustls-tls"] }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
strum_macros = { workspace = true }
thiserror = { workspace = true }
tokio = { workspace = true }
tokio-tungstenite = { workspace = true }
tracing = { workspace = true }
tracing-opentelemetry = { workspace = true }
tracing-subscriber = { workspace = true }
[dev-dependencies]
opentelemetry_sdk = { workspace = true, features = [
"experimental_metrics_custom_reader",
"testing",
] }
pretty_assertions = { workspace = true }
rcgen = { workspace = true }
tempfile = { workspace = true }
[target.'cfg(unix)'.dev-dependencies]
libc = { workspace = true }
[target.'cfg(target_os = "linux")'.dev-dependencies]
seccompiler = { workspace = true }