Skip to content

Commit

Permalink
refactor: change resource visibility on Meter
Browse files Browse the repository at this point in the history
  • Loading branch information
mwear committed Mar 11, 2020
1 parent 40e11c2 commit 4c9c86a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/opentelemetry-metrics/src/Meter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ export class Meter implements types.Meter {
private readonly _logger: types.Logger;
private readonly _metrics = new Map<string, Metric<BaseBoundInstrument>>();
private readonly _batcher: Batcher;
private readonly _resource: Resource;
readonly labels = Meter.labels;
readonly resource: Resource;

/**
* Constructs a new Meter instance.
*/
constructor(config: MeterConfig = DEFAULT_CONFIG) {
this._logger = config.logger || new ConsoleLogger(config.logLevel);
this._batcher = new UngroupedBatcher();
this.resource = config.resource || Resource.createTelemetrySDKResource();
this._resource = config.resource || Resource.createTelemetrySDKResource();
// start the push controller
const exporter = config.exporter || new NoopExporter();
const interval = config.interval;
Expand Down Expand Up @@ -76,7 +76,7 @@ export class Meter implements types.Meter {
...options,
};

const measure = new MeasureMetric(name, opt, this._batcher, this.resource);
const measure = new MeasureMetric(name, opt, this._batcher, this._resource);
this._registerMetric(name, measure);
return measure;
}
Expand Down Expand Up @@ -105,7 +105,7 @@ export class Meter implements types.Meter {
...DEFAULT_METRIC_OPTIONS,
...options,
};
const counter = new CounterMetric(name, opt, this._batcher, this.resource);
const counter = new CounterMetric(name, opt, this._batcher, this._resource);
this._registerMetric(name, counter);
return counter;
}
Expand Down Expand Up @@ -136,7 +136,7 @@ export class Meter implements types.Meter {
name,
opt,
this._batcher,
this.resource
this._resource
);
this._registerMetric(name, observer);
return observer;
Expand Down

0 comments on commit 4c9c86a

Please sign in to comment.