Skip to content

Commit c812917

Browse files
authored
fix: @opentelemetry/metrics fails to run due to bad import (#881)
* fix: @opentelemetry/metrics fails to run due to bad import * move NoopExporter in src/
1 parent 697fb60 commit c812917

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

packages/opentelemetry-metrics/src/Meter.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import {
2828
import { LabelSet } from './LabelSet';
2929
import { Batcher, UngroupedBatcher } from './export/Batcher';
3030
import { PushController } from './export/Controller';
31-
import { NoopExporter } from '../test/mocks/Exporter';
31+
import { NoopExporter } from './export/NoopExporter';
3232

3333
/**
3434
* Meter is an implementation of the {@link Meter} interface.
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Copyright 2019, OpenTelemetry Authors
2+
* Copyright 2020, OpenTelemetry Authors
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,19 +14,16 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { MetricExporter, MetricRecord } from '../../src/export/types';
17+
import { MetricExporter, MetricRecord } from './types';
1818
import { ExportResult } from '@opentelemetry/base';
19-
import { EventEmitter } from 'events';
2019

21-
export class NoopExporter extends EventEmitter implements MetricExporter {
20+
export class NoopExporter implements MetricExporter {
21+
// By default does nothing
2222
export(
2323
metrics: MetricRecord[],
2424
resultCallback: (result: ExportResult) => void
25-
): void {
26-
this.emit('export', metrics, resultCallback);
27-
}
25+
): void {}
2826

29-
shutdown(): void {
30-
this.emit('shutdown');
31-
}
27+
// By default does nothing
28+
shutdown(): void {}
3229
}

0 commit comments

Comments
 (0)