@opentelemetry/metrics
Advanced tools
Comparing version 0.12.1-alpha.54 to 0.13.0
@@ -5,3 +5,3 @@ import * as api from '@opentelemetry/api'; | ||
import { BoundObserver } from './BoundInstrument'; | ||
import { Batcher } from './export/Batcher'; | ||
import { Processor } from './export/Processor'; | ||
import { MetricKind, MetricRecord } from './export/types'; | ||
@@ -15,8 +15,8 @@ import { Metric } from './Metric'; | ||
export declare abstract class BaseObserverMetric extends Metric<BoundObserver> implements api.BaseObserver { | ||
private readonly _batcher; | ||
private readonly _processor; | ||
protected _callback: (observerResult: api.ObserverResult) => unknown; | ||
constructor(name: string, options: api.MetricOptions, _batcher: Batcher, resource: Resource, metricKind: MetricKind, instrumentationLibrary: InstrumentationLibrary, callback?: (observerResult: api.ObserverResult) => unknown); | ||
constructor(name: string, options: api.MetricOptions, _processor: Processor, resource: Resource, metricKind: MetricKind, instrumentationLibrary: InstrumentationLibrary, callback?: (observerResult: api.ObserverResult) => unknown); | ||
protected _makeInstrument(labels: api.Labels): BoundObserver; | ||
protected createObserverResult(): ObserverResult; | ||
getMetricRecord(): Promise<MetricRecord[]>; | ||
protected _processResults(observerResult: ObserverResult): void; | ||
observation(value: number): { | ||
@@ -23,0 +23,0 @@ value: number; |
@@ -13,16 +13,17 @@ "use strict"; | ||
class BaseObserverMetric extends Metric_1.Metric { | ||
constructor(name, options, _batcher, resource, metricKind, instrumentationLibrary, callback) { | ||
constructor(name, options, _processor, resource, metricKind, instrumentationLibrary, callback) { | ||
super(name, options, metricKind, resource, instrumentationLibrary); | ||
this._batcher = _batcher; | ||
this._processor = _processor; | ||
this._callback = callback || NOOP_CALLBACK; | ||
} | ||
_makeInstrument(labels) { | ||
return new BoundInstrument_1.BoundObserver(labels, this._disabled, this._valueType, this._logger, this._batcher.aggregatorFor(this._descriptor)); | ||
return new BoundInstrument_1.BoundObserver(labels, this._disabled, this._valueType, this._logger, this._processor.aggregatorFor(this._descriptor)); | ||
} | ||
createObserverResult() { | ||
return new ObserverResult_1.ObserverResult(); | ||
} | ||
async getMetricRecord() { | ||
const observerResult = this.createObserverResult(); | ||
const observerResult = new ObserverResult_1.ObserverResult(); | ||
await this._callback(observerResult); | ||
this._processResults(observerResult); | ||
return super.getMetricRecord(); | ||
} | ||
_processResults(observerResult) { | ||
observerResult.values.forEach((value, labels) => { | ||
@@ -32,3 +33,2 @@ const instrument = this.bind(labels); | ||
}); | ||
return super.getMetricRecord(); | ||
} | ||
@@ -35,0 +35,0 @@ observation(value) { |
@@ -5,3 +5,3 @@ import * as api from '@opentelemetry/api'; | ||
import { BoundObserver } from './BoundInstrument'; | ||
import { Batcher } from './export/Batcher'; | ||
import { Processor } from './export/Processor'; | ||
import { MetricRecord } from './export/types'; | ||
@@ -11,6 +11,6 @@ import { Metric } from './Metric'; | ||
export declare class BatchObserverMetric extends Metric<BoundObserver> implements api.BatchObserver { | ||
private readonly _batcher; | ||
private readonly _processor; | ||
private _callback; | ||
private _maxTimeoutUpdateMS; | ||
constructor(name: string, options: api.BatchMetricOptions, _batcher: Batcher, resource: Resource, instrumentationLibrary: InstrumentationLibrary, callback?: (observerResult: api.BatchObserverResult) => void); | ||
constructor(name: string, options: api.BatchMetricOptions, _processor: Processor, resource: Resource, instrumentationLibrary: InstrumentationLibrary, callback?: (observerResult: api.BatchObserverResult) => void); | ||
protected _makeInstrument(labels: api.Labels): BoundObserver; | ||
@@ -17,0 +17,0 @@ getMetricRecord(): Promise<MetricRecord[]>; |
@@ -27,6 +27,6 @@ "use strict"; | ||
class BatchObserverMetric extends Metric_1.Metric { | ||
constructor(name, options, _batcher, resource, instrumentationLibrary, callback) { | ||
constructor(name, options, _processor, resource, instrumentationLibrary, callback) { | ||
var _a; | ||
super(name, options, types_1.MetricKind.BATCH_OBSERVER, resource, instrumentationLibrary); | ||
this._batcher = _batcher; | ||
this._processor = _processor; | ||
this._maxTimeoutUpdateMS = (_a = options.maxTimeoutUpdateMS) !== null && _a !== void 0 ? _a : MAX_TIMEOUT_UPDATE_MS; | ||
@@ -36,3 +36,3 @@ this._callback = callback || NOOP_CALLBACK; | ||
_makeInstrument(labels) { | ||
return new BoundInstrument_1.BoundObserver(labels, this._disabled, this._valueType, this._logger, this._batcher.aggregatorFor(this._descriptor)); | ||
return new BoundInstrument_1.BoundObserver(labels, this._disabled, this._valueType, this._logger, this._processor.aggregatorFor(this._descriptor)); | ||
} | ||
@@ -39,0 +39,0 @@ getMetricRecord() { |
@@ -5,8 +5,8 @@ import * as api from '@opentelemetry/api'; | ||
import { BoundCounter } from './BoundInstrument'; | ||
import { Batcher } from './export/Batcher'; | ||
import { Processor } from './export/Processor'; | ||
import { Metric } from './Metric'; | ||
/** This is a SDK implementation of Counter Metric. */ | ||
export declare class CounterMetric extends Metric<BoundCounter> implements api.Counter { | ||
private readonly _batcher; | ||
constructor(name: string, options: api.MetricOptions, _batcher: Batcher, resource: Resource, instrumentationLibrary: InstrumentationLibrary); | ||
private readonly _processor; | ||
constructor(name: string, options: api.MetricOptions, _processor: Processor, resource: Resource, instrumentationLibrary: InstrumentationLibrary); | ||
protected _makeInstrument(labels: api.Labels): BoundCounter; | ||
@@ -13,0 +13,0 @@ /** |
@@ -24,10 +24,8 @@ "use strict"; | ||
class CounterMetric extends Metric_1.Metric { | ||
constructor(name, options, _batcher, resource, instrumentationLibrary) { | ||
constructor(name, options, _processor, resource, instrumentationLibrary) { | ||
super(name, options, types_1.MetricKind.COUNTER, resource, instrumentationLibrary); | ||
this._batcher = _batcher; | ||
this._processor = _processor; | ||
} | ||
_makeInstrument(labels) { | ||
return new BoundInstrument_1.BoundCounter(labels, this._disabled, this._valueType, this._logger, | ||
// @todo: consider to set to CounterSumAggregator always. | ||
this._batcher.aggregatorFor(this._descriptor)); | ||
return new BoundInstrument_1.BoundCounter(labels, this._disabled, this._valueType, this._logger, this._processor.aggregatorFor(this._descriptor)); | ||
} | ||
@@ -34,0 +32,0 @@ /** |
@@ -41,3 +41,3 @@ "use strict"; | ||
} | ||
return resultCallback(core_1.ExportResult.SUCCESS); | ||
return resultCallback({ code: core_1.ExportResultCode.SUCCESS }); | ||
} | ||
@@ -44,0 +44,0 @@ shutdown() { |
@@ -41,6 +41,7 @@ "use strict"; | ||
await this._meter.collect(); | ||
return new Promise((resolve, reject) => { | ||
this._exporter.export(this._meter.getBatcher().checkPointSet(), result => { | ||
if (result !== core_1.ExportResult.SUCCESS) { | ||
core_1.globalErrorHandler(new Error('PushController: export failed in _collect')); | ||
return new Promise(resolve => { | ||
this._exporter.export(this._meter.getProcessor().checkPointSet(), result => { | ||
var _a; | ||
if (result.code !== core_1.ExportResultCode.SUCCESS) { | ||
core_1.globalErrorHandler((_a = result.error) !== null && _a !== void 0 ? _a : new Error('PushController: export failed in _collect')); | ||
} | ||
@@ -47,0 +48,0 @@ resolve(); |
import { MetricExporter, MetricRecord } from './types'; | ||
import { ExportResult } from '@opentelemetry/core'; | ||
export declare class NoopExporter implements MetricExporter { | ||
export(metrics: MetricRecord[], resultCallback: (result: ExportResult) => void): void; | ||
export(_metrics: MetricRecord[], _resultCallback: (result: ExportResult) => void): void; | ||
shutdown(): Promise<void>; | ||
} | ||
//# sourceMappingURL=NoopExporter.d.ts.map |
@@ -21,3 +21,3 @@ "use strict"; | ||
// By default does nothing | ||
export(metrics, resultCallback) { } | ||
export(_metrics, _resultCallback) { } | ||
// By default does nothing | ||
@@ -24,0 +24,0 @@ shutdown() { |
@@ -9,4 +9,4 @@ export * from './BoundInstrument'; | ||
export * from './export/aggregators'; | ||
export * from './export/Batcher'; | ||
export * from './export/ConsoleMetricExporter'; | ||
export * from './export/Processor'; | ||
export * from './export/types'; | ||
@@ -13,0 +13,0 @@ export * from './UpDownCounterMetric'; |
@@ -36,6 +36,6 @@ "use strict"; | ||
__exportStar(require("./export/aggregators"), exports); | ||
__exportStar(require("./export/Batcher"), exports); | ||
__exportStar(require("./export/ConsoleMetricExporter"), exports); | ||
__exportStar(require("./export/Processor"), exports); | ||
__exportStar(require("./export/types"), exports); | ||
__exportStar(require("./UpDownCounterMetric"), exports); | ||
//# sourceMappingURL=index.js.map |
import * as api from '@opentelemetry/api'; | ||
import { InstrumentationLibrary } from '@opentelemetry/core'; | ||
import { Processor } from './export/Processor'; | ||
import { MeterConfig } from './types'; | ||
import { Batcher } from './export/Batcher'; | ||
/** | ||
@@ -11,3 +11,3 @@ * Meter is an implementation of the {@link Meter} interface. | ||
private readonly _metrics; | ||
private readonly _batcher; | ||
private readonly _processor; | ||
private readonly _resource; | ||
@@ -72,3 +72,3 @@ private readonly _instrumentationLibrary; | ||
* | ||
* Utilizes the batcher to create checkpoints of the current values in | ||
* Utilizes the processor to create checkpoints of the current values in | ||
* each aggregator belonging to the metrics that were created with this | ||
@@ -78,3 +78,3 @@ * meter instance. | ||
collect(): Promise<void>; | ||
getBatcher(): Batcher; | ||
getProcessor(): Processor; | ||
shutdown(): Promise<void>; | ||
@@ -81,0 +81,0 @@ /** |
@@ -31,3 +31,3 @@ "use strict"; | ||
const types_2 = require("./types"); | ||
const Batcher_1 = require("./export/Batcher"); | ||
const Processor_1 = require("./export/Processor"); | ||
const Controller_1 = require("./export/Controller"); | ||
@@ -48,3 +48,3 @@ const NoopExporter_1 = require("./export/NoopExporter"); | ||
this._logger = config.logger || new core_1.ConsoleLogger(config.logLevel); | ||
this._batcher = (_a = config.batcher) !== null && _a !== void 0 ? _a : new Batcher_1.UngroupedBatcher(); | ||
this._processor = (_a = config.processor) !== null && _a !== void 0 ? _a : new Processor_1.UngroupedProcessor(); | ||
this._resource = config.resource || resources_1.Resource.createTelemetrySDKResource(); | ||
@@ -68,3 +68,3 @@ this._instrumentationLibrary = instrumentationLibrary; | ||
const opt = Object.assign(Object.assign({ logger: this._logger }, types_2.DEFAULT_METRIC_OPTIONS), options); | ||
const valueRecorder = new ValueRecorderMetric_1.ValueRecorderMetric(name, opt, this._batcher, this._resource, this._instrumentationLibrary); | ||
const valueRecorder = new ValueRecorderMetric_1.ValueRecorderMetric(name, opt, this._processor, this._resource, this._instrumentationLibrary); | ||
this._registerMetric(name, valueRecorder); | ||
@@ -86,3 +86,3 @@ return valueRecorder; | ||
const opt = Object.assign(Object.assign({ logger: this._logger }, types_2.DEFAULT_METRIC_OPTIONS), options); | ||
const counter = new CounterMetric_1.CounterMetric(name, opt, this._batcher, this._resource, this._instrumentationLibrary); | ||
const counter = new CounterMetric_1.CounterMetric(name, opt, this._processor, this._resource, this._instrumentationLibrary); | ||
this._registerMetric(name, counter); | ||
@@ -107,3 +107,3 @@ return counter; | ||
const opt = Object.assign(Object.assign(Object.assign({}, types_2.DEFAULT_METRIC_OPTIONS), { logger: this._logger }), options); | ||
const upDownCounter = new UpDownCounterMetric_1.UpDownCounterMetric(name, opt, this._batcher, this._resource, this._instrumentationLibrary); | ||
const upDownCounter = new UpDownCounterMetric_1.UpDownCounterMetric(name, opt, this._processor, this._resource, this._instrumentationLibrary); | ||
this._registerMetric(name, upDownCounter); | ||
@@ -124,3 +124,3 @@ return upDownCounter; | ||
const opt = Object.assign(Object.assign({ logger: this._logger }, types_2.DEFAULT_METRIC_OPTIONS), options); | ||
const valueObserver = new ValueObserverMetric_1.ValueObserverMetric(name, opt, this._batcher, this._resource, this._instrumentationLibrary, callback); | ||
const valueObserver = new ValueObserverMetric_1.ValueObserverMetric(name, opt, this._processor, this._resource, this._instrumentationLibrary, callback); | ||
this._registerMetric(name, valueObserver); | ||
@@ -135,3 +135,3 @@ return valueObserver; | ||
const opt = Object.assign(Object.assign({ logger: this._logger }, types_2.DEFAULT_METRIC_OPTIONS), options); | ||
const sumObserver = new SumObserverMetric_1.SumObserverMetric(name, opt, this._batcher, this._resource, this._instrumentationLibrary, callback); | ||
const sumObserver = new SumObserverMetric_1.SumObserverMetric(name, opt, this._processor, this._resource, this._instrumentationLibrary, callback); | ||
this._registerMetric(name, sumObserver); | ||
@@ -152,3 +152,3 @@ return sumObserver; | ||
const opt = Object.assign(Object.assign({ logger: this._logger }, types_2.DEFAULT_METRIC_OPTIONS), options); | ||
const upDownSumObserver = new UpDownSumObserverMetric_1.UpDownSumObserverMetric(name, opt, this._batcher, this._resource, this._instrumentationLibrary, callback); | ||
const upDownSumObserver = new UpDownSumObserverMetric_1.UpDownSumObserverMetric(name, opt, this._processor, this._resource, this._instrumentationLibrary, callback); | ||
this._registerMetric(name, upDownSumObserver); | ||
@@ -169,3 +169,3 @@ return upDownSumObserver; | ||
const opt = Object.assign(Object.assign({ logger: this._logger }, types_2.DEFAULT_METRIC_OPTIONS), options); | ||
const batchObserver = new BatchObserverMetric_1.BatchObserverMetric(name, opt, this._batcher, this._resource, this._instrumentationLibrary, callback); | ||
const batchObserver = new BatchObserverMetric_1.BatchObserverMetric(name, opt, this._processor, this._resource, this._instrumentationLibrary, callback); | ||
this._registerMetric(name, batchObserver); | ||
@@ -177,3 +177,3 @@ return batchObserver; | ||
* | ||
* Utilizes the batcher to create checkpoints of the current values in | ||
* Utilizes the processor to create checkpoints of the current values in | ||
* each aggregator belonging to the metrics that were created with this | ||
@@ -193,3 +193,3 @@ * meter instance. | ||
records.forEach(metrics => { | ||
metrics.forEach(metric => this._batcher.process(metric)); | ||
metrics.forEach(metric => this._processor.process(metric)); | ||
}); | ||
@@ -207,8 +207,8 @@ }); | ||
records.forEach(metrics => { | ||
metrics.forEach(metric => this._batcher.process(metric)); | ||
metrics.forEach(metric => this._processor.process(metric)); | ||
}); | ||
}); | ||
} | ||
getBatcher() { | ||
return this._batcher; | ||
getProcessor() { | ||
return this._processor; | ||
} | ||
@@ -215,0 +215,0 @@ shutdown() { |
@@ -17,2 +17,3 @@ import * as api from '@opentelemetry/api'; | ||
protected readonly _descriptor: MetricDescriptor; | ||
protected readonly _boundaries: number[] | undefined; | ||
private readonly _instruments; | ||
@@ -19,0 +20,0 @@ constructor(_name: string, _options: api.MetricOptions, _kind: MetricKind, resource: Resource, instrumentationLibrary: InstrumentationLibrary); |
@@ -38,2 +38,3 @@ "use strict"; | ||
this._logger = (_a = _options.logger) !== null && _a !== void 0 ? _a : new core_1.NoopLogger(); | ||
this._boundaries = _options.boundaries; | ||
this._descriptor = this._getMetricDescriptor(); | ||
@@ -87,9 +88,3 @@ } | ||
_getMetricDescriptor() { | ||
return { | ||
name: this._name, | ||
description: this._options.description || '', | ||
unit: this._options.unit || '1', | ||
metricKind: this._kind, | ||
valueType: this._valueType, | ||
}; | ||
return Object.assign({ name: this._name, description: this._options.description || '', unit: this._options.unit || '1', metricKind: this._kind, valueType: this._valueType }, (this._boundaries && { boundaries: this._boundaries })); | ||
} | ||
@@ -96,0 +91,0 @@ } |
@@ -5,9 +5,9 @@ import * as api from '@opentelemetry/api'; | ||
import { BaseObserverMetric } from './BaseObserverMetric'; | ||
import { Processor } from './export/Processor'; | ||
import { ObserverResult } from './ObserverResult'; | ||
import { Batcher } from './export/Batcher'; | ||
/** This is a SDK implementation of SumObserver Metric. */ | ||
export declare class SumObserverMetric extends BaseObserverMetric implements api.SumObserver { | ||
constructor(name: string, options: api.MetricOptions, batcher: Batcher, resource: Resource, instrumentationLibrary: InstrumentationLibrary, callback?: (observerResult: api.ObserverResult) => unknown); | ||
protected createObserverResult(): ObserverResult; | ||
constructor(name: string, options: api.MetricOptions, processor: Processor, resource: Resource, instrumentationLibrary: InstrumentationLibrary, callback?: (observerResult: api.ObserverResult) => unknown); | ||
protected _processResults(observerResult: ObserverResult): void; | ||
} | ||
//# sourceMappingURL=SumObserverMetric.d.ts.map |
@@ -20,11 +20,22 @@ "use strict"; | ||
const BaseObserverMetric_1 = require("./BaseObserverMetric"); | ||
const MonotonicObserverResult_1 = require("./MonotonicObserverResult"); | ||
const types_1 = require("./export/types"); | ||
/** This is a SDK implementation of SumObserver Metric. */ | ||
class SumObserverMetric extends BaseObserverMetric_1.BaseObserverMetric { | ||
constructor(name, options, batcher, resource, instrumentationLibrary, callback) { | ||
super(name, options, batcher, resource, types_1.MetricKind.SUM_OBSERVER, instrumentationLibrary, callback); | ||
constructor(name, options, processor, resource, instrumentationLibrary, callback) { | ||
super(name, options, processor, resource, types_1.MetricKind.SUM_OBSERVER, instrumentationLibrary, callback); | ||
} | ||
createObserverResult() { | ||
return new MonotonicObserverResult_1.MonotonicObserverResult(); | ||
_processResults(observerResult) { | ||
observerResult.values.forEach((value, labels) => { | ||
const instrument = this.bind(labels); | ||
// SumObserver is monotonic which means it should only accept values | ||
// greater or equal then previous value | ||
const previous = instrument.getAggregator().toPoint(); | ||
let previousValue = -Infinity; | ||
if (previous.timestamp[0] !== 0 || previous.timestamp[1] !== 0) { | ||
previousValue = previous.value; | ||
} | ||
if (value >= previousValue) { | ||
instrument.update(value); | ||
} | ||
}); | ||
} | ||
@@ -31,0 +42,0 @@ } |
import { LogLevel } from '@opentelemetry/core'; | ||
import * as api from '@opentelemetry/api'; | ||
import { Processor } from './export/Processor'; | ||
import { MetricExporter } from './export/types'; | ||
import { Resource } from '@opentelemetry/resources'; | ||
import { Batcher } from './export/Batcher'; | ||
/** MeterConfig provides an interface for configuring a Meter. */ | ||
@@ -18,4 +18,4 @@ export interface MeterConfig { | ||
resource?: Resource; | ||
/** Metric batcher. */ | ||
batcher?: Batcher; | ||
/** Metric Processor. */ | ||
processor?: Processor; | ||
} | ||
@@ -22,0 +22,0 @@ /** Default Meter configuration. */ |
@@ -5,8 +5,8 @@ import * as api from '@opentelemetry/api'; | ||
import { BoundUpDownCounter } from './BoundInstrument'; | ||
import { Batcher } from './export/Batcher'; | ||
import { Processor } from './export/Processor'; | ||
import { Metric } from './Metric'; | ||
/** This is a SDK implementation of UpDownCounter Metric. */ | ||
export declare class UpDownCounterMetric extends Metric<BoundUpDownCounter> implements api.UpDownCounter { | ||
private readonly _batcher; | ||
constructor(name: string, options: api.MetricOptions, _batcher: Batcher, resource: Resource, instrumentationLibrary: InstrumentationLibrary); | ||
private readonly _processor; | ||
constructor(name: string, options: api.MetricOptions, _processor: Processor, resource: Resource, instrumentationLibrary: InstrumentationLibrary); | ||
protected _makeInstrument(labels: api.Labels): BoundUpDownCounter; | ||
@@ -13,0 +13,0 @@ /** |
@@ -24,8 +24,8 @@ "use strict"; | ||
class UpDownCounterMetric extends Metric_1.Metric { | ||
constructor(name, options, _batcher, resource, instrumentationLibrary) { | ||
constructor(name, options, _processor, resource, instrumentationLibrary) { | ||
super(name, options, types_1.MetricKind.UP_DOWN_COUNTER, resource, instrumentationLibrary); | ||
this._batcher = _batcher; | ||
this._processor = _processor; | ||
} | ||
_makeInstrument(labels) { | ||
return new BoundInstrument_1.BoundUpDownCounter(labels, this._disabled, this._valueType, this._logger, this._batcher.aggregatorFor(this._descriptor)); | ||
return new BoundInstrument_1.BoundUpDownCounter(labels, this._disabled, this._valueType, this._logger, this._processor.aggregatorFor(this._descriptor)); | ||
} | ||
@@ -32,0 +32,0 @@ /** |
@@ -5,7 +5,7 @@ import * as api from '@opentelemetry/api'; | ||
import { BaseObserverMetric } from './BaseObserverMetric'; | ||
import { Batcher } from './export/Batcher'; | ||
import { Processor } from './export/Processor'; | ||
/** This is a SDK implementation of UpDownSumObserver Metric. */ | ||
export declare class UpDownSumObserverMetric extends BaseObserverMetric implements api.UpDownSumObserver { | ||
constructor(name: string, options: api.MetricOptions, batcher: Batcher, resource: Resource, instrumentationLibrary: InstrumentationLibrary, callback?: (observerResult: api.ObserverResult) => unknown); | ||
constructor(name: string, options: api.MetricOptions, processor: Processor, resource: Resource, instrumentationLibrary: InstrumentationLibrary, callback?: (observerResult: api.ObserverResult) => unknown); | ||
} | ||
//# sourceMappingURL=UpDownSumObserverMetric.d.ts.map |
@@ -23,4 +23,4 @@ "use strict"; | ||
class UpDownSumObserverMetric extends BaseObserverMetric_1.BaseObserverMetric { | ||
constructor(name, options, batcher, resource, instrumentationLibrary, callback) { | ||
super(name, options, batcher, resource, types_1.MetricKind.UP_DOWN_SUM_OBSERVER, instrumentationLibrary, callback); | ||
constructor(name, options, processor, resource, instrumentationLibrary, callback) { | ||
super(name, options, processor, resource, types_1.MetricKind.UP_DOWN_SUM_OBSERVER, instrumentationLibrary, callback); | ||
} | ||
@@ -27,0 +27,0 @@ } |
@@ -5,7 +5,7 @@ import * as api from '@opentelemetry/api'; | ||
import { BaseObserverMetric } from './BaseObserverMetric'; | ||
import { Batcher } from './export/Batcher'; | ||
import { Processor } from './export/Processor'; | ||
/** This is a SDK implementation of Value Observer Metric. */ | ||
export declare class ValueObserverMetric extends BaseObserverMetric implements api.ValueObserver { | ||
constructor(name: string, options: api.MetricOptions, batcher: Batcher, resource: Resource, instrumentationLibrary: InstrumentationLibrary, callback?: (observerResult: api.ObserverResult) => unknown); | ||
constructor(name: string, options: api.MetricOptions, processor: Processor, resource: Resource, instrumentationLibrary: InstrumentationLibrary, callback?: (observerResult: api.ObserverResult) => unknown); | ||
} | ||
//# sourceMappingURL=ValueObserverMetric.d.ts.map |
@@ -8,4 +8,4 @@ "use strict"; | ||
class ValueObserverMetric extends BaseObserverMetric_1.BaseObserverMetric { | ||
constructor(name, options, batcher, resource, instrumentationLibrary, callback) { | ||
super(name, options, batcher, resource, types_1.MetricKind.VALUE_OBSERVER, instrumentationLibrary, callback); | ||
constructor(name, options, processor, resource, instrumentationLibrary, callback) { | ||
super(name, options, processor, resource, types_1.MetricKind.VALUE_OBSERVER, instrumentationLibrary, callback); | ||
} | ||
@@ -12,0 +12,0 @@ } |
@@ -5,8 +5,8 @@ import * as api from '@opentelemetry/api'; | ||
import { BoundValueRecorder } from './BoundInstrument'; | ||
import { Batcher } from './export/Batcher'; | ||
import { Processor } from './export/Processor'; | ||
import { Metric } from './Metric'; | ||
/** This is a SDK implementation of Value Recorder Metric. */ | ||
export declare class ValueRecorderMetric extends Metric<BoundValueRecorder> implements api.ValueRecorder { | ||
private readonly _batcher; | ||
constructor(name: string, options: api.MetricOptions, _batcher: Batcher, resource: Resource, instrumentationLibrary: InstrumentationLibrary); | ||
private readonly _processor; | ||
constructor(name: string, options: api.MetricOptions, _processor: Processor, resource: Resource, instrumentationLibrary: InstrumentationLibrary); | ||
protected _makeInstrument(labels: api.Labels): BoundValueRecorder; | ||
@@ -13,0 +13,0 @@ record(value: number, labels?: api.Labels): void; |
@@ -24,8 +24,8 @@ "use strict"; | ||
class ValueRecorderMetric extends Metric_1.Metric { | ||
constructor(name, options, _batcher, resource, instrumentationLibrary) { | ||
constructor(name, options, _processor, resource, instrumentationLibrary) { | ||
super(name, options, types_1.MetricKind.VALUE_RECORDER, resource, instrumentationLibrary); | ||
this._batcher = _batcher; | ||
this._processor = _processor; | ||
} | ||
_makeInstrument(labels) { | ||
return new BoundInstrument_1.BoundValueRecorder(labels, this._disabled, this._valueType, this._logger, this._batcher.aggregatorFor(this._descriptor)); | ||
return new BoundInstrument_1.BoundValueRecorder(labels, this._disabled, this._valueType, this._logger, this._processor.aggregatorFor(this._descriptor)); | ||
} | ||
@@ -32,0 +32,0 @@ record(value, labels = {}) { |
@@ -1,2 +0,2 @@ | ||
export declare const VERSION = "0.12.1-alpha.54+3f72613a"; | ||
export declare const VERSION = "0.13.0"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -20,3 +20,3 @@ "use strict"; | ||
// this is autogenerated file, see scripts/version-update.js | ||
exports.VERSION = '0.12.1-alpha.54+3f72613a'; | ||
exports.VERSION = '0.13.0'; | ||
//# sourceMappingURL=version.js.map |
{ | ||
"name": "@opentelemetry/metrics", | ||
"version": "0.12.1-alpha.54+3f72613a", | ||
"version": "0.13.0", | ||
"description": "OpenTelemetry metrics SDK", | ||
@@ -45,6 +45,6 @@ "main": "build/src/index.js", | ||
"devDependencies": { | ||
"@types/mocha": "8.0.2", | ||
"@types/node": "14.0.27", | ||
"@types/sinon": "9.0.4", | ||
"codecov": "3.7.2", | ||
"@types/mocha": "8.0.4", | ||
"@types/node": "14.14.10", | ||
"@types/sinon": "9.0.9", | ||
"codecov": "3.8.1", | ||
"gts": "2.0.2", | ||
@@ -54,4 +54,4 @@ "mocha": "7.2.0", | ||
"rimraf": "3.0.2", | ||
"sinon": "9.0.3", | ||
"ts-mocha": "7.0.0", | ||
"sinon": "9.2.1", | ||
"ts-mocha": "8.0.0", | ||
"ts-node": "9.0.0", | ||
@@ -61,7 +61,7 @@ "typescript": "3.9.7" | ||
"dependencies": { | ||
"@opentelemetry/api": "^0.12.1-alpha.54+3f72613a", | ||
"@opentelemetry/core": "^0.12.1-alpha.54+3f72613a", | ||
"@opentelemetry/resources": "^0.12.1-alpha.54+3f72613a" | ||
"@opentelemetry/api": "^0.13.0", | ||
"@opentelemetry/core": "^0.13.0", | ||
"@opentelemetry/resources": "^0.13.0" | ||
}, | ||
"gitHead": "3f72613a36b6f97555a0fa7481755cf8b6cce1a7" | ||
"gitHead": "86cbd6798f9318c5920f9d9055f289a1c3f26500" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
0
137743
84
2071
+ Added@opentelemetry/api@0.13.0(transitive)
+ Added@opentelemetry/context-base@0.13.0(transitive)
+ Added@opentelemetry/core@0.13.0(transitive)
+ Added@opentelemetry/resources@0.13.0(transitive)
- Removed@opentelemetry/api@0.12.1-alpha.54(transitive)
- Removed@opentelemetry/context-base@0.12.1-alpha.54(transitive)
- Removed@opentelemetry/core@0.12.1-alpha.54(transitive)
- Removed@opentelemetry/resources@0.12.1-alpha.54(transitive)
Updated@opentelemetry/api@^0.13.0
Updated@opentelemetry/core@^0.13.0