Skip to content

Omit Null values from Structured Metadata #282

Open
@ZIRAKrezovic

Description

@ZIRAKrezovic

Thanks for finally adding Structured Metadata support. I would like to propose an enhancement

Could you add either an option to disable, or disable by default, sending of fields with null/empty value?

I would like to use

<structuredMetadataPattern>trace_id=%mdc{traceId}</structuredMetadataPattern>

But when no traceId is present in mdc, in Loki I see the following

{2F4ECB6E-3673-45D2-9BC7-002557106F9D}

This breaks navigation from traces to logs, as empty link is generated

https://grafana.com/docs/grafana/latest/datasources/tempo/link-trace-id/

resulting in an empty screen as trace id is not populated

{4E3C375E-8B05-4305-80CD-CC67A4A04A3A}

Using none shown in example results in same problem - none is not a valid trace id in tempo, at any time.

See discussion for logstash-logback-encoder and same feature request for ideas logfellow/logstash-logback-encoder#201

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions