-
Notifications
You must be signed in to change notification settings - Fork 893
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
Change http.server.active_requests from asynchronous to synchronous UpDownCounter #2451
Conversation
2c07271
to
1b391ed
Compare
@trask do you think we need both? For example, it's possible that the HTTP server is already running for a period of time before instrumentation is enabled, and if this happened, there is no easy way to know the current number of in-flight requests if the sync version of UpDownCounter is used. |
IIRC there has been discussion regarding how to model the in-flight requests. |
Discussed this a bit in the JVM metrics sig, our feeling is that there doesn't seem to be a need to describe asynchronous or synchronous in the semantic conventions as whether to use one or the other is an implementation detail of the instrumentation, not semantic meaning of the data itself. There is also an idea that synchronous is the "more powerful" instrument so should be preferred where possible, but can't always be used. A synchronous counter with delta temporality can provide more fine grained data over a collecting interval, while cumulative temporality would be the same information effectively as an asynchronous counter. As an example, for JVM metrics we have two sources for information, JFR (only newer JVMs) and JMX. JFR reports events so e.g., cpu time can be recorded with synchronous instruments, but JMX will only present aggregated data for the same metric that can only be reported with asynchronous instruments. It seems fine for the JFR version to use synchronous and JMX asynchronous for the exact same semantic convention. |
Thanks @fstab - to clarify, I have a feeling this applies to any convention not just JVM. But either way is good to start somewhere |
I support removing async/sync from all conventions. |
awesome, thanks all! I will close this and send a new PR to remove async/sync from all metric conventions |
Changes
Changes
http.server.active_requests
from an asynchronous UpDownCounter to a synchronous UpDownCounter.Since instrumentation will typically increment/decrement this metric for each request (especially important in order to record its attributes), as opposed to reading the value from an underlying component.