Open kwiesmueller opened 2 years ago
The 2nd example is sufficient in my experience (though weird), the more important thing is that it's consistent from scrape to scrape which is encouraged by the spec but not required so that you can cache the labels and do a hash lookup across scrapes.
Making it consistent from scrape to scrape is also likely going to make it consistent within a scape, as the easiest way is some form of sorting. So I don't think this requires any changes in the spec, as it'll already largely ensure this.
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:
And bad:
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.