Skip to content

fix(collector): carry exporter auth, and stop --force from deleting it (#171) - #198

Merged
radra23 merged 1 commit into
mainfrom
fix/collector-exporter-auth
Oct 3, 2026
Merged

radra23 merged 1 commit into
mainfrom
fix/collector-exporter-auth

Conversation

@radra23

@radra23 radra23 commented Oct 3, 2026

Copy link
Copy Markdown
Owner

Summary

The generated Collector exporter carried no credentials, and --force silently deleted hand-added exporter auth. Closes #171.

What changed

  • /otel-collector --force reads the existing file first: headers:/auth: on a same-named exporter are carried over verbatim; auth on an exporter the new config lacks stops the run unless --confirm-remove-exporter-auth is passed
  • New repeatable --exporter-header 'Name=${env:VAR}' emits the headers: block; every value must be an env reference and a literal is refused. Header names are not hard-coded per vendor (they are each vendor's OTLP-ingest contract and are not verified in this repo)
  • Step 6 notes when the exporter carries no credentials; collector-topology gains an "Exporter auth" section
  • Golden otelcol-agent-headers.yaml.snap, validated by tests/collector-validate.sh (which also fails if a header value is a literal), and tests/hooks/collector-exporter-auth.test.sh. Bumps to 0.8.17

Test plan

  • All hook, snapshot, drift and e2e unit tests pass locally; claude plugin validate . --strict passes

  • tests/collector-validate.sh passes against otelcol-contrib 0.161.0, including the new golden; replacing an env reference with a literal makes it fail

  • Teeth: 10 of the 11 collector-exporter-auth checks fail against the previous prose

  • Vendor, SDK and semantic-convention facts were verified against the source, not recalled — linked where it isn't obvious.

  • Nothing hardcoded that has a single source of truth (SEMCONV_VERSION, backends.txt, hooks/otel-paths.sh).

#171)

The agent and gateway templates share an exporters.otlp block with an endpoint and nothing
else. Agent mode forwards "to a gateway or directly to a backend", and a backend rejects every
unauthenticated batch; with retry and the sending queue on, the data sits in the queue and is
then dropped. otelcol-contrib validate passes, so nothing flags it at generation time.

Worse, /otel-collector --force had no preserve contract, and the receiver-auth guard only
looked for `authenticator:`. A hand-added exporters.otlp.headers block was deleted on
regeneration with no warning.

- /otel-collector --force now reads the existing file first. Exporter headers/auth on an
  exporter the new config also has (otlp) are carried over verbatim; auth on an exporter the
  new config lacks stops the run unless --confirm-remove-exporter-auth is passed, the same
  shape as --confirm-remove-auth. A header value that is not an ${env:} reference is never
  printed.
- New repeatable --exporter-header Name=${env:VAR} emits the headers block. Every value must be
  an environment reference; a literal is refused. The plugin does not hard-code header names per
  vendor: they are each backend's OTLP-ingest contract and are not verified in this repo.
- Step 6 says when the generated exporter carries no credentials and what to do about it.
- collector-topology gains an "Exporter auth (the outbound hop)" section.

Adds a golden config with exporter headers, validated by tests/collector-validate.sh against
otelcol-contrib 0.161.0 (with a check that every header value is an env reference, which fails
on a literal), and tests/hooks/collector-exporter-auth.test.sh, wired into lint-hooks (10 of
its 11 checks fail against the previous prose). Bumps to 0.8.17.
@radra23
radra23 merged commit 0d04254 into main Oct 3, 2026
11 checks passed
@radra23
radra23 deleted the fix/collector-exporter-auth branch October 3, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[output] agent collector exporter has no backend auth headers, and --force silently deletes hand-added ones

1 participant