Skip to content

Commit

Permalink
fix(instrumentation-http): use semantic convention metric descriptions (
Browse files Browse the repository at this point in the history
  • Loading branch information
puckpuck authored Apr 4, 2023
1 parent 4b04407 commit 73da976
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,15 @@ export class HttpInstrumentation extends InstrumentationBase<Http> {
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,
}
);
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,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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');
Expand Down

0 comments on commit 73da976

Please sign in to comment.