Let Ruby collectors use standard OTLP headers - #4
Conversation
Use bktec's dedicated local relay token for OpenTelemetry exports in both otel_enabled and otel_only modes. Keep the analytics token separate so otel_enabled can continue authenticating its normal JSON uploads. Document the relayed and direct-upload credential behavior and cover both OpenTelemetry modes in the collector configuration specs. Amp-Thread-ID: https://ampcode.com/threads/T-01a033cd-e302-7589-bcea-50c27c533600 Co-authored-by: Amp <amp@ampcode.com>
There was a problem hiding this comment.
I didn't find an implementation issue to raise inline. This changes credential selection for OTLP exports, so it falls outside this repository's L1 approval ceiling and I'm leaving a comment rather than approving.
Want to dig deeper?
Paste this into your agent to explore the findings from this review's Buildkite build:
Download the buildsworth logs from build 20314, then answer my questions about the findings.
Install the reading-buildsworth-logs skill to run this.
About buildsworth
Model: gpt-5.6-sol with xhigh thinking.
How to request a review: Comment @buildsworth-bk review on the PR, or request buildsworth-bk as a reviewer.
Risk labels (how buildsworth classifies risk) — buildsworth classifies risk itself from the diff. Unless repository policy already allows L2 approval, grant it by mentioning @buildsworth-bk (see approval ceiling and L2 approval grant):
- L1 — Low risk (dep bumps, docs/copy, lockfiles, small presentational fixes). buildsworth may approve by default.
- L2 — Standard risk (new UI, additive API fields, refactors). Approved only when repository policy or a verified grant allows it; otherwise comment-only.
- L3 — High risk (auth, migrations, payments, secrets, perf-critical paths). Human review always required.
Merge OTEL_EXPORTER_OTLP_TRACES_HEADERS, or its generic fallback, over the collector-generated OTLP headers using case-insensitive names. This lets bktec's standard Bearer authorization take precedence without replacing the analytics token used for normal JSON uploads. Keep environment-provided authorization authoritative when a warm worker reconfigures the collector with a refreshed analytics token. Remove the Ruby collector's dependency on the dedicated relay token variable and document the standard header behavior. Amp-Thread-ID: https://ampcode.com/threads/T-01a033cd-e302-7589-bcea-50c27c533600 Co-authored-by: Amp <amp@ampcode.com>
|
@buildsworth-bk review approve L2 |
🤖 Review: standard OTLP exporter header supportVerdict: yes, this correctly adds support for standard OTel exporter headers. The behavior was verified against both the OTel exporter spec and the reference implementation in What matches the standard
Sensible judgment calls (fine as-is)
One deviation worth knowing about (not blocking)The OTel spec says an empty env var value SHOULD be treated as unset, but here Review by Amp (agentic coding tool) using the Fable 5 model — thread: https://ampcode.com/threads/T-01a03641-aa42-713f-b8e4-5b130435ae87 |
Fixing… |
Skip empty trace-specific and generic OTLP header environment values in accordance with the OpenTelemetry configuration specification. An empty trace-specific value now falls back to the generic setting, and two empty values leave the collector's normal run-key and authorization headers in place instead of disabling OpenTelemetry export. Amp-Thread-ID: https://ampcode.com/threads/T-01a033cd-e302-7589-bcea-50c27c533600 Co-authored-by: Amp <amp@ampcode.com>
Why
The Ruby collector supplies its own exporter headers, which prevents the OpenTelemetry exporter from reading standard
OTEL_EXPORTER_OTLP_*_HEADERSconfiguration. bktec's relay uses the standard trace header variable for its local credential, whileotel_enabledmust preserveBUILDKITE_ANALYTICS_TOKENfor normal JSON uploads.What
Merge
OTEL_EXPORTER_OTLP_TRACES_HEADERS, or its generic fallback, over collector-generated headers using case-insensitive names. Empty values are treated as unset. Standardauthorizationtherefore takes precedence in both OpenTelemetry modes and remains authoritative across warm-worker token refreshes, without a Ruby-specific relay token variable.Related to TE-6777.
Related PRs: