-
Notifications
You must be signed in to change notification settings - Fork 582
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
Generate New Server Metrics in otelhttp
#6262
Comments
otelhttp
I'd like to do this one! |
This issue hasn't been updated in quite some time. Unassigning it so someone else can pick it up. |
I can give it a try. |
Thanks. Give me some time, I need to understand it, including some information about Metric. |
I've spent some time studying the code recently, and I found that the design might be better with some refactorings or improvements. Here are some of my ideas: (Of course, this part of the improvement has nothing to do with the current issue)__ Question:
My thoughts:
Other thoughts, thoughts on the version section of
|
We should keep things simple. This is why we only emit stable metrics, not the experimental ones so far. If we wish to start emiting experimental metrics, we should provide a way to mark that specific metric as experimental, to make upgrades smoother (with no migration path). With that, I think we can assume there won't be three semantic convention versions with breaking changes at the same time. Also, the migration plan keeps two versions running alongside each other for a fairly limited amount of time. So while I agree there are ways for readability and usability improvements in the otelhttp package and the handling of semconv (I started one a couple days ago, which will change how you would handle this issue: #6400), I think we can make this change with minimal changes in the library and then clean things up. |
My preliminary assumption is as follows: (Currently in progress, it is not ruled out that it may be overthrown in order to solve this problem first and adjusted in subsequent versions)
Assuming this direction is valid, it actually means that multiple versions in the future can also be supported. Of course, whether to do it or not is another question. |
You don't need a new interface. For example: opentelemetry-go-contrib/instrumentation/net/http/otelhttp/internal/semconv/env.go Lines 51 to 56 in 04815fd
For RecordMetrics, you would need something like this: func (s HTTPServer) RecordMetrics(ctx context.Context, md ServerMetricData) {
if s.requestBytesCounter == nil || s.responseBytesCounter == nil || s.serverLatencyMeasure == nil {
// This will happen if an HTTPServer{} is used instead of NewHTTPServer.
return
}
// Emit the old http server metrics.
if s.duplicate {
// Emit the new http server metrics.
}
} |
Okay, I'll adjust it this way. |
The
semconv.HTTPServer
already produces the existingv1.20.0
server metrics (#6002). The following methods need to be updated to produce the new server HTTP metrics:RecordMetrics
These updates should ensure that when
OTEL_SEMCONV_STABILITY_OPT_IN="http/dup"
is set the produced telemetry is compliant with these semantic conventions:http.server.request.duration
http.server.request.body.size
http.server.response.body.size
The text was updated successfully, but these errors were encountered: