Skip to content

Commit

Permalink
Merge branch 'otelhttp-transport-metrics' of github.com:Sovietaced/op…
Browse files Browse the repository at this point in the history
…entelemetry-go-contrib into otelhttp-transport-metrics
  • Loading branch information
Sovietaced committed Dec 29, 2023
2 parents 233049a + e071c21 commit bdf65dd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
3 changes: 1 addition & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- The semantic conventions used by `go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace` are upgraded to v1.20.0. (#4320)
- The semantic conventions used by `go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace/example` are upgraded to v1.20.0. (#4320)
- The semantic conventions used by `go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/example` are upgraded to v1.20.0. (#4320)
- The semantic conventions used by `go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp`are upgraded to v1.20.0. (#4320)
- The semantic conventions used by `go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp` are upgraded to v1.20.0. (#4320, #4707)
- Updated configuration schema to include `schema_url` for resource definition and `without_type_suffix` and `without_units` for the Prometheus exporter. (#4727)
- Updated server metrics `go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp` to comply with OpenTelemetry semantic conventions. (#4707)

### Removed

Expand Down
6 changes: 3 additions & 3 deletions instrumentation/net/http/otelhttp/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,21 +110,21 @@ func (h *middleware) createMeasures() {
h.requestBytesCounter, err = h.meter.Int64Counter(
ServerRequestSize,
metric.WithUnit("By"),
metric.WithDescription("Measures the size of HTTP request content length (uncompressed)"),
metric.WithDescription("Measures the size of HTTP request messages."),
)
handleErr(err)

h.responseBytesCounter, err = h.meter.Int64Counter(
ServerResponseSize,
metric.WithUnit("By"),
metric.WithDescription("Measures the size of HTTP response content length (uncompressed)"),
metric.WithDescription("Measures the size of HTTP response messages."),
)
handleErr(err)

h.serverLatencyMeasure, err = h.meter.Float64Histogram(
ServerDuration,
metric.WithUnit("ms"),
metric.WithDescription("Measures the duration of HTTP request handling"),
metric.WithDescription("Measures the duration of inbound HTTP requests."),
)
handleErr(err)
}
Expand Down
6 changes: 3 additions & 3 deletions instrumentation/net/http/otelhttp/test/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func assertScopeMetrics(t *testing.T, sm metricdata.ScopeMetrics, attrs attribut

want := metricdata.Metrics{
Name: "http.server.request.size",
Description: "Measures the size of HTTP request content length (uncompressed)",
Description: "Measures the size of HTTP request messages.",
Unit: "By",
Data: metricdata.Sum[int64]{
DataPoints: []metricdata.DataPoint[int64]{{Attributes: attrs, Value: 0}},
Expand All @@ -63,7 +63,7 @@ func assertScopeMetrics(t *testing.T, sm metricdata.ScopeMetrics, attrs attribut

want = metricdata.Metrics{
Name: "http.server.response.size",
Description: "Measures the size of HTTP response content length (uncompressed)",
Description: "Measures the size of HTTP response messages.",
Unit: "By",
Data: metricdata.Sum[int64]{
DataPoints: []metricdata.DataPoint[int64]{{Attributes: attrs, Value: 11}},
Expand All @@ -75,7 +75,7 @@ func assertScopeMetrics(t *testing.T, sm metricdata.ScopeMetrics, attrs attribut

want = metricdata.Metrics{
Name: "http.server.duration",
Description: "Measures the duration of HTTP request handling",
Description: "Measures the duration of inbound HTTP requests.",
Unit: "ms",
Data: metricdata.Histogram[float64]{
DataPoints: []metricdata.HistogramDataPoint[float64]{{Attributes: attrs}},
Expand Down

0 comments on commit bdf65dd

Please sign in to comment.