Skip to content

server: AmbientContext is copied around with insufficient initial tags #72815

@knz

Description

@knz

This issue is extracted from #72702, to track the problem separately from its resolution.

We are not able to effectively ensure that
trace/logging output for all server components would reliably contain
a node ID or SQL instance ID. This is because many events are produced
via a fresh context populated via (*AmbientContext).AnnotateCtx(),
and we did not have a reliable way to ensure that all the
AmbientContext instances would have a common set of logging
tags.

This is because each component uses its own copy of AmbientContext taken
from (server.BaseConfig).AmbientContext, and components take that
copy before the code that instantiates NodeIDContainer /
SQLInstanceIDContainer gets a chance to run.

Metadata

Metadata

Assignees

Labels

A-loggingIn and around the logging infrastructure.A-tracingRelating to tracing in CockroachDB.C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions