Replies: 1 comment 1 reply
-
Good question! I have faced these myself a while ago... Observable feels like the right solution here. I don't think you should use Counter.Add for things which is already aggregated/stored elsewhere (the db, in this case) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'd like to use a monotonic counter to track some application metrics, but my application might be stopped and started. I can persist my (current) metric values in a database, but I don't see a way with this API to initialize a synchronous runtime Counter with a specific starting value, or to set the counter's value (rather than just add to the counter's value).
I figured out that the ObservableCounter API (with
.observe
) does what I want, but I'd prefer to use the synchronous counter API because the event I'm monitoring is pretty infrequent.What advice do people have? Is there a synchronous instrument equivalent to the asynchronous
observe
method?Beta Was this translation helpful? Give feedback.
All reactions