Skip to content

Add support for actual structured metadata #255

@oliver-unifii

Description

@oliver-unifii

It appears this library doesn't actually support structured logging, instead it formats log lines into nested JSON message and then relies on json parser within loki to allow filtering.

As per Loki HTTP documentation to add structured logs one can append them as last item to log line array: https://grafana.com/docs/loki/latest/reference/api/#push-log-entries-to-loki

That will produce structured metadata as per https://grafana.com/docs/loki/latest/get-started/labels/structured-metadata/

Looking through the sourcecode it seems this library only serialises timestamp and message:

Entries.Add(new[] {timestamp.ToUnixNanosecondsString(), entry});

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions