Repository navigation
docs(observability): design trace ids in every Go log line - #2219
Merged
Merged
Conversation
Record for carrying a span through every request ctx in compass-server and compass-runner and writing trace_id and span_id on every log line: a trace-aware slog handler, span coverage on every server and runner mount (with long-lived stream spans stripped from the work ctx), a per-command runner span, per-unit spans for background work, and sloglint context: all. Spec-impact: none Ledger-impact: none Refs RIG-5186 Co-authored-by: Matt Wilkinson <matt@rigel.build>
|
😎 This pull request was merged. |
|
Compass engineering docs preview: https://compass-ux-5186-go-trace-log.compass-eng-docs.pages.dev Deployed from Changed pages: |
Fix the pgshare cleanup ctx, reorder the stack so every asserted log line already passes ctx, strip the span at gateway.Serve's stored socket ctx, name real test seams for the stream strips, list the signal and drainDoors signature changes, make the lint-gate proof runnable, and use otelx/otel consistently. Spec-impact: none Ledger-impact: none Refs RIG-5186 Co-authored-by: Matt Wilkinson <matt@rigel.build>
Contributor
Author
|
Review at head ca0a8da: high 3, medium 3, low 2. All are fixed in 05ecf42.
|
Spec-impact: none Ledger-impact: none Refs RIG-5186 Co-authored-by: Matt Wilkinson <matt@rigel.build>
Contributor
Author
|
Review at head 05ecf42: high 0, medium 0, low 1. All round-1 fixes were checked against the code.
|
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.
Summary
This PR adds the design record
docs/designs/observability/compass-go-trace-logs/design.md. It answers Matt's ask on #2167: carry an OTel span through every Go ctx, and puttrace_idandspan_idon every log line in compass-server and compass-runner.It has three legs:
otel.TraceHandlerwraps the text handler and stamps both ids when the ctx has a valid span.otelconnectfirst on every server mount. Today SecretsService on the socket and dev doors has no span.context: allrejects any log call without a ctx. 138 non-test sites move over in four PRs.forbidden-keysreservestrace_idandspan_id.context.Background/TODOoutside the top ofmainand tests.Long-lived streams (Sessions, PublishEvents, the Subscribe* RPCs, AgentGateway Publish/Control) keep their span for RPC metrics, but the span is cleared from the work ctx. Without that, thousands of lines would share one span id that only exports when the stream closes.
Do not merge yet. Open Questions 1 and 2 are load-bearing and wait on Matt's ruling in RIG-5276.
Verification
rumdl checkis clean.buildDoorsandbuildNetworkServer,agentGatewayHandlerOptions, the_ = ctxinHub.DispatchControl, and the otelconnect v0.9.0WrapStreamingHandlerspan lifetime.Risks
otelhttpv0.71.0, which changes the container images' FOD hash.SessionsResponse.traceparent. It is buf-breaking clean.Compatibility
runner.protois internal-only.Documentation
This PR is the documentation: a new record that sits beside the T4b emission record, which it does not edit.
Ledger-impact: none (new record; the only proto change is one internal field, and no decision row changes)
Refs RIG-5186