From 73da976982beedc87fb3a6d573082375d27c97ee Mon Sep 17 00:00:00 2001 From: Pierre Tessier Date: Tue, 4 Apr 2023 05:27:53 -0400 Subject: [PATCH] fix(instrumentation-http): use semantic convention metric descriptions (#3710) --- CHANGELOG.md | 2 ++ .../packages/opentelemetry-instrumentation-http/src/http.ts | 4 ++-- .../test/functionals/http-metrics.test.ts | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a9b186e78fc..d9172dab89a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ For experimental package changes, see the [experimental CHANGELOG](experimental/ ### :bug: (Bug Fix) +* fix(instrumentation-http): fixed description for http.server.duration metric [#3710](/~https://github.com/open-telemetry/opentelemetry-js/pull/3710) + ### :books: (Refine Doc) ### :house: (Internal) diff --git a/experimental/packages/opentelemetry-instrumentation-http/src/http.ts b/experimental/packages/opentelemetry-instrumentation-http/src/http.ts index 7291780e869..1f6affef662 100644 --- a/experimental/packages/opentelemetry-instrumentation-http/src/http.ts +++ b/experimental/packages/opentelemetry-instrumentation-http/src/http.ts @@ -80,7 +80,7 @@ export class HttpInstrumentation extends InstrumentationBase { this._httpServerDurationHistogram = this.meter.createHistogram( 'http.server.duration', { - description: 'measures the duration of the inbound HTTP requests', + description: 'Measures the duration of inbound HTTP requests.', unit: 'ms', valueType: ValueType.DOUBLE, } @@ -88,7 +88,7 @@ export class HttpInstrumentation extends InstrumentationBase { this._httpClientDurationHistogram = this.meter.createHistogram( 'http.client.duration', { - description: 'measures the duration of the outbound HTTP requests', + description: 'Measures the duration of outbound HTTP requests.', unit: 'ms', valueType: ValueType.DOUBLE, } diff --git a/experimental/packages/opentelemetry-instrumentation-http/test/functionals/http-metrics.test.ts b/experimental/packages/opentelemetry-instrumentation-http/test/functionals/http-metrics.test.ts index df51a54fcfa..d7f55ed8463 100644 --- a/experimental/packages/opentelemetry-instrumentation-http/test/functionals/http-metrics.test.ts +++ b/experimental/packages/opentelemetry-instrumentation-http/test/functionals/http-metrics.test.ts @@ -82,7 +82,7 @@ describe('metrics', () => { assert.strictEqual(metrics[0].dataPointType, DataPointType.HISTOGRAM); assert.strictEqual( metrics[0].descriptor.description, - 'measures the duration of the inbound HTTP requests' + 'Measures the duration of inbound HTTP requests.' ); assert.strictEqual(metrics[0].descriptor.name, 'http.server.duration'); assert.strictEqual(metrics[0].descriptor.unit, 'ms'); @@ -119,7 +119,7 @@ describe('metrics', () => { assert.strictEqual(metrics[1].dataPointType, DataPointType.HISTOGRAM); assert.strictEqual( metrics[1].descriptor.description, - 'measures the duration of the outbound HTTP requests' + 'Measures the duration of outbound HTTP requests.' ); assert.strictEqual(metrics[1].descriptor.name, 'http.client.duration'); assert.strictEqual(metrics[1].descriptor.unit, 'ms');