Skip to content

Commit

Permalink
fix: don't let PeriodicExportingMetricReader block process exit (#3106)
Browse files Browse the repository at this point in the history
  • Loading branch information
seemk authored Jul 23, 2022
1 parent 1a0e0c4 commit d5cf120
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions experimental/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ All notable changes to experimental packages in this project will be documented
### :bug: (Bug Fix)

* fix(histogram): fix maximum when only values < -1 are provided [#3086](https://github.com/open-telemetry/opentelemetry-js/pull/3086) @pichlermarc
* fix(sdk-metrics-base): fix PeriodicExportingMetricReader keeping Node.js process from exiting
[#3106](https://github.com/open-telemetry/opentelemetry-js/pull/3106) @seemk

### :books: (Refine Doc)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@
*/

import * as api from '@opentelemetry/api';
import { ExportResultCode, globalErrorHandler } from '@opentelemetry/core';
import {
ExportResultCode,
globalErrorHandler,
unrefTimer
} from '@opentelemetry/core';
import { MetricReader } from './MetricReader';
import { AggregationTemporality } from './AggregationTemporality';
import { InstrumentType } from '../InstrumentDescriptor';
Expand Down Expand Up @@ -100,6 +104,7 @@ export class PeriodicExportingMetricReader extends MetricReader {
globalErrorHandler(err);
}
}, this._exportInterval);
unrefTimer(this._interval);
}

protected async onForceFlush(): Promise<void> {
Expand Down

0 comments on commit d5cf120

Please sign in to comment.