-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gauge.record() is under-defined #34
Comments
thanks @ktoso, as you suggest, the design for recorder and gauge is set semantics. do you think we should change the method name or improve the docs, or something else? |
To extend on my previous comment, I think the extending the docs should be an AND kind of thing, so whichever way this goes, adding methods, renaming methods, or something completely different. IMO extending the docs should happen in all those cases. |
|
…alue" operation ... as it seemed to be confusing when implementing or using the API.
…alue" operation ... as it seemed to be confusing when implementing or using the API.
So I've been using the API a bit, and found an confusing thing:
It is confusing with regards how one should implement
gauge.record()
. An implementation I just reviewed, the prometheus one, implements it by delegating to it's underlyingadd
which I think is incorrect, however we don't really provide any guidance about it, so I can see how the author ended up in this:Remember also that we force a gauge to be an NOT aggregated recorder:
Which again strengthens my idea that it should be a "set" operation.
https://github.com/MrLotU/SwiftPrometheus/blob/master/Sources/PrometheusMetrics/PrometheusMetrics.swift#L37-L42
I think we need to:
add()
really (case for this below)...For reference, the only guidance we provide are:
and
Which does not explain if record is a set or add, or if its interpretation should change depending if the recorder / gauge is
aggregate
or not.Note also that open telemetry is converging on gauges offering both and I'd tend to agree with that actually now that I had to use our API a bit:
https://github.com/open-telemetry/opentelemetry-java/blob/master/api/src/main/java/io/opentelemetry/metrics/GaugeLong.java
add
set
-- like ourrecord
The text was updated successfully, but these errors were encountered: