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.
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
AmbientContextinstances would have a common set of loggingtags.
This is because each component uses its own copy of AmbientContext taken
from
(server.BaseConfig).AmbientContext, and components take thatcopy before the code that instantiates
NodeIDContainer/SQLInstanceIDContainergets a chance to run.