client_golang icon indicating copy to clipboard operation
client_golang copied to clipboard

Check metric uniqueness against timestamp

Open Elecon-rou opened this issue 1 year ago • 2 comments

It is possible to pass multiple value-timestamp pairs of the same metric name and same labels to Prometheus. If its not something horrible to do, then maybe we could add some kind of check for that. Possible fix for (#1137)

Elecon-rou avatar Sep 29 '22 00:09 Elecon-rou

It is possible to pass multiple value-timestamp pairs of the same metric name and same labels to Prometheus.

While that's true, it's not a behavior covered by the specification of the exposition format. (Arguably, Prometheus is following the robustness principle here. Prometheus could stop this behavior at any time and would still be compliant. Instrumentation libraries must not depend on this behavior to exist. (Or to continue following the robustness principle narrative: The instrumentation libraries should stick to the spec as closely as possible, even though (or actually: precisely because) Prometheus is tolerant in what it accepts.)

beorn7 avatar Sep 29 '22 16:09 beorn7

@bwplotka and @kakkoyun are you able to take a look?

machadovilaca avatar Oct 14 '22 14:10 machadovilaca

Hey, I looked, and this is not desired functionality, I am afraid. ):

Explained in https://github.com/prometheus/client_golang/issues/1137

Hope that makes sense. I will close this PR to avoid confusion but feel free discuss - maybe I missed something. We can always reopen. Thanks!

bwplotka avatar Nov 03 '22 15:11 bwplotka

Discussion moved forwared in the issue, I think we could change it as in PR. Can we at least add unit test that proves multiple samples of same metric are possible?

bwplotka avatar Nov 28 '22 13:11 bwplotka

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] avatar Feb 18 '23 05:02 stale[bot]