Context
PR #2354 added an "event fields" mechanism to the logfmt layer: configured span attributes
(e.g. component, object_id) are surfaced onto log lines and inherited from parent spans.
span_id is still handled by separate special-case code and, unlike those fields, is not
inherited in the logfmt path. @Matthias247 suggested it could go through the same mechanism
(PR #2354).
Worth a look
span_id is a per-work-unit correlation id (set on trace-root spans); its purpose is to
group every log line of one unit of work ("filter by span_id to see the whole iteration").
- api-core's own log stream / Debug WebUI already inherits it (
enclosing_span_id walks the
span scope), but the logfmt text path does not — so nested lines can drop it.
References
Context
PR #2354 added an "event fields" mechanism to the logfmt layer: configured span attributes
(e.g.
component,object_id) are surfaced onto log lines and inherited from parent spans.span_idis still handled by separate special-case code and, unlike those fields, is notinherited in the logfmt path. @Matthias247 suggested it could go through the same mechanism
(PR #2354).
Worth a look
span_idis a per-work-unit correlation id (set on trace-root spans); its purpose is togroup every log line of one unit of work ("filter by
span_idto see the whole iteration").enclosing_span_idwalks thespan scope), but the logfmt text path does not — so nested lines can drop it.
References