Skip to content

Commit

Permalink
Update HTTP metrics' descriptions (#9635)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateusz Rzeszutek authored Oct 9, 2023
1 parent 2eba523 commit ab66a85
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ private HttpClientExperimentalMetrics(Meter meter) {
meter
.histogramBuilder("http.client.request.size")
.setUnit("By")
.setDescription("The size of HTTP request messages")
.setDescription("Size of HTTP client request bodies.")
.ofLongs();
HttpMetricsAdvice.applyClientRequestSizeAdvice(requestSizeBuilder);
requestSize = requestSizeBuilder.build();
LongHistogramBuilder responseSizeBuilder =
meter
.histogramBuilder("http.client.response.size")
.setUnit("By")
.setDescription("The size of HTTP response messages")
.setDescription("Size of HTTP client response bodies.")
.ofLongs();
HttpMetricsAdvice.applyClientRequestSizeAdvice(responseSizeBuilder);
responseSize = responseSizeBuilder.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ private HttpClientMetrics(Meter meter) {
if (SemconvStability.emitStableHttpSemconv()) {
DoubleHistogramBuilder stableDurationBuilder =
createStableDurationHistogramBuilder(
meter, "http.client.request.duration", "The duration of the outbound HTTP request");
meter, "http.client.request.duration", "Duration of HTTP client requests.");
HttpMetricsAdvice.applyStableClientDurationAdvice(stableDurationBuilder);
stableDuration = stableDurationBuilder.build();
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,22 +58,22 @@ private HttpServerExperimentalMetrics(Meter meter) {
meter
.upDownCounterBuilder("http.server.active_requests")
.setUnit("{requests}")
.setDescription("The number of concurrent HTTP requests that are currently in-flight");
.setDescription("Number of active HTTP server requests.");
HttpMetricsAdvice.applyServerActiveRequestsAdvice(activeRequestsBuilder);
activeRequests = activeRequestsBuilder.build();
LongHistogramBuilder requestSizeBuilder =
meter
.histogramBuilder("http.server.request.size")
.setUnit("By")
.setDescription("The size of HTTP request messages")
.setDescription("Size of HTTP server request bodies.")
.ofLongs();
HttpMetricsAdvice.applyServerRequestSizeAdvice(requestSizeBuilder);
requestSize = requestSizeBuilder.build();
LongHistogramBuilder responseSizeBuilder =
meter
.histogramBuilder("http.server.response.size")
.setUnit("By")
.setDescription("The size of HTTP response messages")
.setDescription("Size of HTTP server response bodies.")
.ofLongs();
HttpMetricsAdvice.applyServerRequestSizeAdvice(responseSizeBuilder);
responseSize = responseSizeBuilder.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ private HttpServerMetrics(Meter meter) {
if (SemconvStability.emitStableHttpSemconv()) {
DoubleHistogramBuilder stableDurationBuilder =
createStableDurationHistogramBuilder(
meter, "http.server.request.duration", "The duration of the inbound HTTP request");
meter, "http.server.request.duration", "Duration of HTTP server requests.");
HttpMetricsAdvice.applyStableServerDurationAdvice(stableDurationBuilder);
stableDuration = stableDurationBuilder.build();
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ void collectsMetrics() {
metric ->
assertThat(metric)
.hasName("http.server.active_requests")
.hasDescription(
"The number of concurrent HTTP requests that are currently in-flight")
.hasUnit("{requests}")
.hasLongSumSatisfying(
sum ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ void collectsMetrics() {
assertThat(metric)
.hasName("http.client.request.size")
.hasUnit("By")
.hasDescription("Size of HTTP client request bodies.")
.hasHistogramSatisfying(
histogram ->
histogram.hasPointsSatisfying(
Expand Down Expand Up @@ -109,6 +110,7 @@ void collectsMetrics() {
assertThat(metric)
.hasName("http.client.response.size")
.hasUnit("By")
.hasDescription("Size of HTTP client response bodies.")
.hasHistogramSatisfying(
histogram ->
histogram.hasPointsSatisfying(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ void collectsMetrics() {
assertThat(metric)
.hasName("http.client.request.duration")
.hasUnit("s")
.hasDescription("Duration of HTTP client requests.")
.hasHistogramSatisfying(
histogram ->
histogram.hasPointsSatisfying(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,8 @@ void collectsMetrics() {
metric ->
assertThat(metric)
.hasName("http.server.active_requests")
.hasDescription(
"The number of concurrent HTTP requests that are currently in-flight")
.hasUnit("{requests}")
.hasDescription("Number of active HTTP server requests.")
.hasLongSumSatisfying(
sum ->
sum.hasPointsSatisfying(
Expand Down Expand Up @@ -144,6 +143,7 @@ void collectsMetrics() {
assertThat(metric)
.hasName("http.server.request.size")
.hasUnit("By")
.hasDescription("Size of HTTP server request bodies.")
.hasHistogramSatisfying(
histogram ->
histogram.hasPointsSatisfying(
Expand All @@ -168,6 +168,7 @@ void collectsMetrics() {
assertThat(metric)
.hasName("http.server.response.size")
.hasUnit("By")
.hasDescription("Size of HTTP server response bodies.")
.hasHistogramSatisfying(
histogram ->
histogram.hasPointsSatisfying(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ void collectsMetrics() {
metric ->
assertThat(metric)
.hasName("http.server.request.duration")
.hasDescription("Duration of HTTP server requests.")
.hasUnit("s")
.hasHistogramSatisfying(
histogram ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,10 @@ void httpClientMetrics() throws Exception {
SemconvStability.emitStableHttpSemconv()
? "http.client.request.duration"
: "http.client.duration";
String durationInstrumentDescription =
SemconvStability.emitStableHttpSemconv()
? "Duration of HTTP client requests."
: "The duration of the outbound HTTP request";

testing.waitAndAssertMetrics(
instrumentationName.get(),
Expand All @@ -739,7 +743,7 @@ void httpClientMetrics() throws Exception {
metrics.anySatisfy(
metric ->
assertThat(metric)
.hasDescription("The duration of the outbound HTTP request")
.hasDescription(durationInstrumentDescription)
.hasUnit(SemconvStability.emitStableHttpSemconv() ? "s" : "ms")
.hasHistogramSatisfying(
histogram ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,10 @@ void httpServerMetrics() {
SemconvStability.emitStableHttpSemconv()
? "http.server.request.duration"
: "http.server.duration";
String durationInstrumentDescription =
SemconvStability.emitStableHttpSemconv()
? "Duration of HTTP server requests."
: "The duration of the inbound HTTP request";

String metricsInstrumentationName = options.metricsInstrumentationName.get();
if (metricsInstrumentationName == null) {
Expand All @@ -358,7 +362,7 @@ void httpServerMetrics() {
metrics.anySatisfy(
metric ->
assertThat(metric)
.hasDescription("The duration of the inbound HTTP request")
.hasDescription(durationInstrumentDescription)
.hasUnit(SemconvStability.emitStableHttpSemconv() ? "s" : "ms")
.hasHistogramSatisfying(
histogram ->
Expand Down

0 comments on commit ab66a85

Please sign in to comment.