-
Notifications
You must be signed in to change notification settings - Fork 999
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
docs: why does the meteric counter addition required a context object? #3618
Comments
It is currently used to determine a timeout: opentelemetry-go/sdk/metric/instrument.go Lines 197 to 199 in c7e2679
I don't think this by itself justifies keeping the context in the method signature for any synchronous instrument though. The caller can just as easily check if a timeout happened and the call to Another original idea for including this parameter was so any existing span embedded in the context can be linked to the measurement. This is not currently done though. |
The context will also be needed when we add support for exemplars. |
Given the context needs specified above, we plan to continue accepting a context argument with the |
Hello, sorry for reviving this @MrAlias, but how one would go about recording a metric specifically when there's a timeout/context error? e.g., on an HTTP client implementation, I have a meter using the request context and I would like to keep track of HTTP timeouts, however, the metrics are ignored because of this timeout. |
@ravanscafi We have been recently discussing it. See: #4671 for more details. |
It is not clear in the documentation why the counter requires the context and how it is using it.
This one for example.
The text was updated successfully, but these errors were encountered: