Skip to content

Improve logging context information #1212

@xla

Description

@xla

Inspired by a conversation in #1204 is this proposal to improve the information carried in every log line. In essence each log line should provide enough context so that an operator can infer origin and meainng, even when looked at in isolation in a remote place. From the original conversation:

Usually thinking about in what remote ends logs can end up in typical infrastructure I try to imagine what vital info is needed to make sense of it when consumed in some log infrastructure remote from the origin. Additionally how each log line can interpreted by itself without context of the lines before or after. As the logger is passed from the outside to the inside in the program we can enrich the keyvals with information as well which subsystems don't need to care about. A standard set of fields I try to surface, most of them which can easily be achieved with Dynamic Contextual Values from the go-kit log package:

Propsed set of standard fields:


All field names are up for discussion and can be adjusted according to some sane strategy.
Proper error propagation and messages are important for the overall goal but exceeds the scope of this issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    T:jankType Jank! Non-urgent but still high-impact fixes.T:observabilityType: Observability

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions