diff --git a/packages/opentelemetry-api/src/metrics/Metric.ts b/packages/opentelemetry-api/src/metrics/Metric.ts index 92fa923437..6effd30946 100644 --- a/packages/opentelemetry-api/src/metrics/Metric.ts +++ b/packages/opentelemetry-api/src/metrics/Metric.ts @@ -120,9 +120,6 @@ export interface Counter extends UnboundMetric { add(value: number, labels?: Labels): void; } -<<<<<<< HEAD -export interface ValueRecorder extends UnboundMetric { -======= export interface UpDownCounter extends UnboundMetric { /** * Adds the given value to the current value. Values can be negative. @@ -130,8 +127,7 @@ export interface UpDownCounter extends UnboundMetric { add(value: number, labels?: Labels): void; } -export interface Measure extends UnboundMetric { ->>>>>>> a7dbd0b... feat: add the UpDownCounter instrument +export interface ValueRecorder extends UnboundMetric { /** * Records the given value to this value recorder. */ diff --git a/packages/opentelemetry-metrics/src/Meter.ts b/packages/opentelemetry-metrics/src/Meter.ts index a4cbf8edf2..a8678751df 100644 --- a/packages/opentelemetry-metrics/src/Meter.ts +++ b/packages/opentelemetry-metrics/src/Meter.ts @@ -19,7 +19,12 @@ import { ConsoleLogger } from '@opentelemetry/core'; import { Resource } from '@opentelemetry/resources'; import { BaseBoundInstrument } from './BoundInstrument'; import { UpDownCounterMetric } from './UpDownCounterMetric'; -import { Metric, CounterMetric, ValueRecorderMetric, ObserverMetric } from './Metric'; +import { + Metric, + CounterMetric, + ValueRecorderMetric, + ObserverMetric, +} from './Metric'; import { MetricOptions, DEFAULT_METRIC_OPTIONS, @@ -68,9 +73,9 @@ export class Meter implements api.Meter { return api.NOOP_VALUE_RECORDER_METRIC; } const opt: MetricOptions = { - absolute: true, // value recorders are defined as absolute by default logger: this._logger, ...DEFAULT_METRIC_OPTIONS, + absolute: true, // value recorders are defined as absolute by default ...options, }; diff --git a/packages/opentelemetry-metrics/src/Metric.ts b/packages/opentelemetry-metrics/src/Metric.ts index 59693d9dfb..194971ba5e 100644 --- a/packages/opentelemetry-metrics/src/Metric.ts +++ b/packages/opentelemetry-metrics/src/Metric.ts @@ -95,7 +95,7 @@ export abstract class Metric description: this._options.description, unit: this._options.unit, metricKind: this._kind, - valueType: this._valueType + valueType: this._valueType, }; } @@ -134,7 +134,8 @@ export class CounterMetric extends Metric implements api.Counter { } } -export class MeasureMetric extends Metric implements api.Measure { +export class ValueRecorderMetric extends Metric + implements api.ValueRecorder { protected readonly _absolute: boolean; constructor( diff --git a/packages/opentelemetry-metrics/src/export/types.ts b/packages/opentelemetry-metrics/src/export/types.ts index 78a1128727..2dacf02a9f 100644 --- a/packages/opentelemetry-metrics/src/export/types.ts +++ b/packages/opentelemetry-metrics/src/export/types.ts @@ -82,11 +82,6 @@ export interface MetricDescriptor { readonly unit: string; readonly metricKind: MetricKind; readonly valueType: ValueType; -<<<<<<< HEAD - readonly monotonic: boolean; -======= - readonly labelKeys: string[]; ->>>>>>> a7dbd0b... feat: add the UpDownCounter instrument } /** diff --git a/packages/opentelemetry-metrics/test/Meter.test.ts b/packages/opentelemetry-metrics/test/Meter.test.ts index 9e8bb0bc16..451ff27487 100644 --- a/packages/opentelemetry-metrics/test/Meter.test.ts +++ b/packages/opentelemetry-metrics/test/Meter.test.ts @@ -411,7 +411,6 @@ describe('Meter', () => { assert.strictEqual(record.length, 1); assert.deepStrictEqual(record[0].descriptor, { description: '', - labelKeys: [], metricKind: MetricKind.COUNTER, name: 'name1', unit: '1',