feat: implement gauge and counter support for OpenMetrics 2.0#894
feat: implement gauge and counter support for OpenMetrics 2.0#894dashpole wants to merge 5 commits into
Conversation
bwplotka
left a comment
There was a problem hiding this comment.
For common, given v0 I would just comment on the method. If we want to be fancy we can generate comment in the exposition format too (:
Looks good so far, good start (see comments) - only question is do we iterate on this on main or some feature branch - no strong opinion, assuming commentary is clear.
Thanks
ywwg
left a comment
There was a problem hiding this comment.
looks good to me so far. My general opinion is that if some scraper asks for openmetrics 2.0, they should get it... Hypothetically I could see requiring the version number "2.0.0rc" or "1.9.9" just in case?
|
Lots of discussion at the OM wg. We will add a NegotiateIncluding() function that takes a list of supported protocols so we don't end up with NegotiateIncludingOpenMetricsAndOpenMetrics2 ... 😆 . Then the client can decide when it wants to add support, and how it wants to gate it (behind |
|
I added a NegotiateIncluding function. I didn't deprecate the old functions (e.g. NegotiateIncludingOpenMetrics), but we can do that in a follow-up if we want to. |
873bb38 to
1bcdef1
Compare
|
I think that's great, the experimental factor at this level should be a commentary. As per discussion on Slack I think we decided to follow:
|
ab106e7 to
2f87680
Compare
46773f6 to
42ca72f
Compare
|
In the spirit of @krajorama's feedback, i've updated the implementation to perform some additional validation. It checks for newline characters, NaN and negative counter values, valid timestamps, empty exemplar label keys. It does not validate UTF-8 for strings, or duplicate label keys or duplicate label sets because those are expensive to validate. This does more validation than OM 1.0, but still leaves some things not validated. I also ended up writing benchmarks as part of that work, which i've split into #943. The benchmark results from #943 run against this PR are: |
Signed-off-by: David Ashpole <dashpole@google.com>
Signed-off-by: David Ashpole <dashpole@google.com>
Signed-off-by: David Ashpole <dashpole@google.com>
…rt timestamps Signed-off-by: David Ashpole <dashpole@google.com>
Signed-off-by: David Ashpole <dashpole@google.com>
Part 1 of #893
Histograms and summaries are left for follow-ups.
Open Questions:
@ywwg @bwplotka @krajorama