OpenTelemetry traces, metrics and logs; trace IDs in logs #38
No reviewers
Labels
No labels
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
mikluko/multiproxy!38
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/otel"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Wires the OpenTelemetry SDK the way flakybin does: autoexport for traces, metrics and logs, the otelslog bridge, runtime metrics, and W3C propagation. Everything follows the standard
OTEL_*variables, so by default it exports over OTLP to localhost.OTEL_SDK_DISABLED=trueinstalls nothing.Export errors are logged locally only, at warn when an
OTEL_EXPORTER_OTLP_*ENDPOINTis set and at debug otherwise. A smoke run of the binary with no environment and no collector prints only its start and stop lines; with a dead explicit endpoint it warns.Proxied requests and MITM-intercepted requests are server spans. Upstream requests are client spans: the upstream sees the proxy's span in
traceparent, continuing the client's trace. Local log records carrytrace_idandspan_idthroughlog.TraceHandler. SIGINT and SIGTERM stop the command and flush telemetry.An end-to-end test runs against a fake OTLP/HTTP collector. It checks that all three signals arrive, that the access log carries the client's trace ID, and that the upstream sees the proxy's span. Other command tests run with
OTEL_SDK_DISABLED=true.The Go OTLP exporters default to
https://localhost:4318, where the spec sayshttp://. That is the SDK's behaviour, untouched here.