Skip to content
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

[net/http] add http.server.active_requests metric #2617

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

fatsheep9146
Copy link
Contributor

Signed-off-by: Ziqi Zhao zhaoziqi9146@gmail.com

Enhance instrumentation library otelhttp for net/http to satisfy opentelemetry http server metric semantic conventions.

This PR added missed metric http.server.active_requests for server

Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>
@@ -201,12 +205,15 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
labeler := &Labeler{}
ctx = injectLabeler(ctx, labeler)

// Add metrics
attributes := append(labeler.Get(), semconv.HTTPServerMetricAttributesFromHTTPRequest(h.operation, r)...)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks the use of Labeler to allow handlers to add labels to the instrumentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants