Metrics API usability: recording time #1369
Unanswered
jonatan-ivanov
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Recording time values is not a first-class concept in OpenTelemetry Metrics, there is no component that supports this by default but users need to measure time on their own and record it using a ValueRecorder.
Time Unit
Some metrics backends have a preference for a base time unit (e.g. Prometheus expects times in seconds). This preference is a concern for exporting but recording should be possible in any time unit. Without it being a first-class concept, this doesn’t seem possible currently without parsing the String unit to determine if it is a time unit.
Clock abstraction
No clock abstraction currently. It is easy for users to calculate time values incorrectly without a clock abstraction (e.g. using wall time instead of monotonic time)
We touched this topic on the Metrics Workshop, and several people agreed that having such a concept would be useful, we also discussed about multiple ways of doing this (through spans or through a dedicated instrument). Let me cc a few people who I know shared some opinions about the topic:
@shakuzen @ebullient @brian-brazil @bogdandrutu @jmacd @jsuereth @matthiasr @rakyll @RichiH @tomwilkie @alolita
Connected issue: #464
Beta Was this translation helpful? Give feedback.
All reactions