Skip to content

Commit

Permalink
Unexport metric name constants
Browse files Browse the repository at this point in the history
  • Loading branch information
Sovietaced committed Dec 29, 2023
1 parent 2b2c02e commit 233049a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- 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

- Remove `RequestCount`, `RequestContentLength`, `ResponseContentLength`, `ServerLatency` constants from `go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp`. (#4707)

### Fixed

- Fix `NewServerHandler` in `go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc` to correctly set the span status depending on the gRPC status. (#4587)
Expand Down
6 changes: 3 additions & 3 deletions instrumentation/net/http/otelhttp/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ const (

// Client HTTP metrics.
const (
ClientRequestSize = "http.client.request.size" // Outgoing request bytes total
ClientResponseSize = "http.client.response.size" // Outgoing response bytes total
ClientDuration = "http.client.duration" // Outgoing end to end duration, milliseconds
clientRequestSize = "http.client.request.size" // Outgoing request bytes total
clientResponseSize = "http.client.response.size" // Outgoing response bytes total
clientDuration = "http.client.duration" // Outgoing end to end duration, milliseconds
)

// Filter is a predicate used to determine whether a given http.request should
Expand Down
6 changes: 3 additions & 3 deletions instrumentation/net/http/otelhttp/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,21 +93,21 @@ func (t *Transport) applyConfig(c *config) {
func (t *Transport) createMeasures() {
var err error
t.requestBytesCounter, err = t.meter.Int64Counter(
ClientRequestSize,
clientRequestSize,
metric.WithUnit("By"),
metric.WithDescription("Measures the size of HTTP request messages."),
)
handleErr(err)

t.responseBytesCounter, err = t.meter.Int64Counter(
ClientResponseSize,
clientResponseSize,
metric.WithUnit("By"),
metric.WithDescription("Measures the size of HTTP response messages."),
)
handleErr(err)

t.latencyMeasure, err = t.meter.Float64Histogram(
ClientDuration,
clientDuration,
metric.WithUnit("ms"),
metric.WithDescription("Measures the duration of outbound HTTP requests."),
)
Expand Down

0 comments on commit 233049a

Please sign in to comment.