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

Support http.server.request_count metric in otelhttp. #2482

Closed
wants to merge 1 commit into from
Closed

Support http.server.request_count metric in otelhttp. #2482

wants to merge 1 commit into from

Conversation

jeremyje
Copy link

@jeremyje jeremyje commented Jul 2, 2022

Fixes #2481

@codecov
Copy link

codecov bot commented Jul 4, 2022

Codecov Report

Merging #2482 (39190d8) into main (d1faf5c) will increase coverage by 0.0%.
The diff coverage is 100.0%.

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #2482   +/-   ##
=====================================
  Coverage   74.3%   74.3%           
=====================================
  Files        144     144           
  Lines       6563    6568    +5     
=====================================
+ Hits        4877    4882    +5     
  Misses      1543    1543           
  Partials     143     143           
Impacted Files Coverage Δ
instrumentation/net/http/otelhttp/handler.go 81.5% <100.0%> (+0.5%) ⬆️

@@ -202,6 +206,7 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {

// Add metrics
attributes := append(labeler.Get(), semconv.HTTPServerMetricAttributesFromHTTPRequest(h.operation, r)...)
h.counters[RequestCount].Add(ctx, 1, attributes...)
Copy link
Member

Choose a reason for hiding this comment

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

Is this necessary? Can't the same information be extracted from the count of the server latency histogram?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm using Dynatrace, at least in their UI I can't seem to find a way to get the count out of the http.server.duration metric, is it required to be available by opentelemetry?

@jeremyje jeremyje closed this by deleting the head repository Oct 4, 2022
@RangelReale
Copy link
Contributor

Can this keep to be considered? I have no good way of getting the request count on my provider without this metric, which seems to be required by the spec.

@jeremyje
Copy link
Author

jeremyje commented Oct 4, 2022

I ended up deleting this PR unintentionally because I purged all my repositories. My list got way too long.
If there's still interest in getting this merged I can recreate this PR but there was some pushback so it was never merged.

https://github.com/open-telemetry/opentelemetry-go-contrib/pull/2482/files still fortunately shows the diff.

cc: @Aneurysm9 @RangelReale @hanyuancheung

@dmathieu
Copy link
Member

dmathieu commented Oct 4, 2022

@RangelReale
Copy link
Contributor

I'm not seeing this metric being required in the spec. https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/semantic_conventions/http-metrics.md

Hmm you're right, I think I was confusing it with another thing. It isn't even mentioned there.

The only thing I'm afraid is adding it to my code, and in the future this being added to the library and it counting the request 2 times.

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

Successfully merging this pull request may close these issues.

Request to Add Instrumentation for otelhttp
5 participants