Skip to content

Commit 73da976

Browse files
authored
fix(instrumentation-http): use semantic convention metric descriptions (#3710)
1 parent 4b04407 commit 73da976

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ For experimental package changes, see the [experimental CHANGELOG](experimental/
1313

1414
### :bug: (Bug Fix)
1515

16+
* fix(instrumentation-http): fixed description for http.server.duration metric [#3710](https://github.com/open-telemetry/opentelemetry-js/pull/3710)
17+
1618
### :books: (Refine Doc)
1719

1820
### :house: (Internal)

experimental/packages/opentelemetry-instrumentation-http/src/http.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,15 @@ export class HttpInstrumentation extends InstrumentationBase<Http> {
8080
this._httpServerDurationHistogram = this.meter.createHistogram(
8181
'http.server.duration',
8282
{
83-
description: 'measures the duration of the inbound HTTP requests',
83+
description: 'Measures the duration of inbound HTTP requests.',
8484
unit: 'ms',
8585
valueType: ValueType.DOUBLE,
8686
}
8787
);
8888
this._httpClientDurationHistogram = this.meter.createHistogram(
8989
'http.client.duration',
9090
{
91-
description: 'measures the duration of the outbound HTTP requests',
91+
description: 'Measures the duration of outbound HTTP requests.',
9292
unit: 'ms',
9393
valueType: ValueType.DOUBLE,
9494
}

experimental/packages/opentelemetry-instrumentation-http/test/functionals/http-metrics.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ describe('metrics', () => {
8282
assert.strictEqual(metrics[0].dataPointType, DataPointType.HISTOGRAM);
8383
assert.strictEqual(
8484
metrics[0].descriptor.description,
85-
'measures the duration of the inbound HTTP requests'
85+
'Measures the duration of inbound HTTP requests.'
8686
);
8787
assert.strictEqual(metrics[0].descriptor.name, 'http.server.duration');
8888
assert.strictEqual(metrics[0].descriptor.unit, 'ms');
@@ -119,7 +119,7 @@ describe('metrics', () => {
119119
assert.strictEqual(metrics[1].dataPointType, DataPointType.HISTOGRAM);
120120
assert.strictEqual(
121121
metrics[1].descriptor.description,
122-
'measures the duration of the outbound HTTP requests'
122+
'Measures the duration of outbound HTTP requests.'
123123
);
124124
assert.strictEqual(metrics[1].descriptor.name, 'http.client.duration');
125125
assert.strictEqual(metrics[1].descriptor.unit, 'ms');

0 commit comments

Comments
 (0)