Skip to content

Label order in textformat #249

Open
Open
@kwiesmueller

Description

@kwiesmueller

One thing I'm missing from the textformat is, that the order of label keys is expected to remain consistent in a single scrape of a histogram bucket

So, good:

# TYPE foo histogram
foo_bucket{a=x,b=x,le="0.0"} 0
foo_bucket{a=x,b=x,le="0.1"} 8
foo_bucket{a=x,b=x,le="+Inf"} 17

And bad:

# TYPE foo histogram
foo_bucket{a=x,b=x,le="0.0"} 0
foo_bucket{b=x,a=x,le="0.1"} 8 # here a and b are switched
foo_bucket{a=x,b=x,le="+Inf"} 17

This guarantee could help parsers be more efficient as they can compare labels using simple string comparing vs. decoding the labels into maps first and then comparing those.

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage:deciding:needs-infoOpen to community discussion. May be accepted after sufficient reasoning is provided.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions