-
Notifications
You must be signed in to change notification settings - Fork 755
Description
Component
Instrumentation: otelhttp
Problem Statement
At the moment bucket boundaries are hardcoded with a maximum value of 10s:
opentelemetry-go-contrib/instrumentation/net/http/otelhttp/internal/semconv/client.go
Lines 38 to 41 in c4223d5
| client.requestDuration, err = httpconv.NewClientRequestDuration( | |
| meter, | |
| metric.WithExplicitBucketBoundaries(0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10), | |
| ) |
opentelemetry-go-contrib/instrumentation/net/http/otelhttp/internal/semconv/server.go
Lines 55 to 61 in c4223d5
| server.requestDurationHistogram, err = httpconv.NewServerRequestDuration( | |
| meter, | |
| metric.WithExplicitBucketBoundaries( | |
| 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, | |
| 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10, | |
| ), | |
| ) |
opentelemetry-go-contrib/instrumentation/net/http/httptrace/otelhttptrace/internal/semconv/client.go
Lines 38 to 41 in c4223d5
| client.requestDuration, err = httpconv.NewClientRequestDuration( | |
| meter, | |
| metric.WithExplicitBucketBoundaries(0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10), | |
| ) |
opentelemetry-go-contrib/instrumentation/net/http/httptrace/otelhttptrace/internal/semconv/server.go
Lines 55 to 61 in c4223d5
| server.requestDurationHistogram, err = httpconv.NewServerRequestDuration( | |
| meter, | |
| metric.WithExplicitBucketBoundaries( | |
| 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, | |
| 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10, | |
| ), | |
| ) |
This means that any long running transactions won´t show up correctly in the metrics.
Proposed Solution
I propose to either remove these hardcoded boundaries or make them configurable through a .WithBucketBoundaries(bounds ...float64)
Alternatives
No response
Prior Art
No response
Additional Context
No response