feat: export audit records and diagnostics to an OTLP collector - #121
Merged
Conversation
plusky
force-pushed
the
feat/otlp-export
branch
from
August 18, 2026 16:09
afb46cb to
29222f1
Compare
plusky
marked this pull request as draft
August 18, 2026 16:12
A configured collector is a load-bearing audit sink: delivery is probed at startup, a failed export engages the same FailMode gate a failed file write does, and the file can be turned off only with the exact `none` sentinel. Diagnostics stay best-effort on a separate queue. The two ambiguous spellings (endpoint with no file decision, `none` with no endpoint) refuse to start. Configuration is the standard OTel environment surface, off unless OTEL_EXPORTER_OTLP_ENDPOINT (or the logs-specific variant) is set; OTEL_EXPORTER_OTLP_HEADERS is credential material under I12. The encoder is hand-written against opentelemetry-proto logs.proto — zero new crates, Cargo.lock unchanged. Closes #31
plusky
force-pushed
the
feat/otlp-export
branch
from
August 18, 2026 19:36
29222f1 to
1781ee6
Compare
plusky
marked this pull request as ready for review
August 18, 2026 19:36
Merged
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.
A configured collector is a load-bearing audit sink, not a best-effort
copy of the file. Delivery is probed at startup; a failed export engages
the same
FailModegate a failed file write does; the file can be turnedoff only with the exact
nonesentinel. Diagnostics stay best-effort on aseparate queue.
The two ambiguous spellings refuse to start rather than silently reshape
the trail: an OTLP endpoint with no file decision, and
nonewith noendpoint. File write still precedes export when both run.
Configuration is the standard OTel environment surface, off unless
OTEL_EXPORTER_OTLP_ENDPOINT(or the logs-specific variant) is set;OTEL_EXPORTER_OTLP_HEADERSis credential material under I12. Theencoder is hand-written against opentelemetry-proto
logs.proto:zero new crates, Cargo.lock unchanged. The OpenTelemetry SDK route
was built and rejected on evidence (async reqwest panic off-runtime,
appender self-feed, endpoint logged at debug).
Touches I12 (export headers; endpoint weaker bar), I15 (no MCP surface;
persist bar is file write and/or export-queue accept), I9 (guard
untouched). Fail-closed refusals reuse each tool's uniform text.
Adversarial review (three lenses)
fingerprint OTLP vs file vs guard.
NEVER_EXPORTED_TARGETSplus thelog.targetbridge kills the self-feeding debug loop. Follow-up:export client follows no HTTP redirects so a 3xx cannot forward
the audit body or a non-Authorization collector credential.
none,probe-before-file, dual queues, audit-only latch clear, stdio
SIGTERM flushes then
process::exit(0). Probe refusals name thevariables that actually won (including
OTEL_EXPORTER_OTLP_LOGS_*).README and
examples/audit.toml(including a false “without thatflag no stream is written”). Fixed; clap/man now document
noneandthe two startup-error cells, and ENVIRONMENT lists the seven OTEL
variables.
Verification:
cargo fmt --check, both clippy-D warningslines,cargo test --workspace --all-targets --locked(local, including therebased tree on current
main).Closes #31