diff --git a/experimental/CHANGELOG.md b/experimental/CHANGELOG.md index 23c2624293..f420b3f468 100644 --- a/experimental/CHANGELOG.md +++ b/experimental/CHANGELOG.md @@ -6,6 +6,16 @@ All notable changes to experimental packages in this project will be documented ### :boom: Breaking Change +* chore(metrics-sdk): clean up exports [#3197](https://github.com/open-telemetry/opentelemetry-js/pull/3197) @pichlermarc + * removes export for: + * `AccumulationRecord` + * `Aggregator` + * `AggregatorKind` + * `Accumulation` + * `createInstrumentDescriptor` + * `createInstrumentDescriptorWithView` + * `isDescriptorCompatibleWith` + ### :rocket: (Enhancement) ### :bug: (Bug Fix) diff --git a/experimental/packages/opentelemetry-sdk-metrics/src/export/MetricData.ts b/experimental/packages/opentelemetry-sdk-metrics/src/export/MetricData.ts index 36e031e2d3..f31c748e0b 100644 --- a/experimental/packages/opentelemetry-sdk-metrics/src/export/MetricData.ts +++ b/experimental/packages/opentelemetry-sdk-metrics/src/export/MetricData.ts @@ -25,7 +25,7 @@ import { Histogram } from '../aggregator/types'; /** * Basic metric data fields. */ -export interface BaseMetricData { +interface BaseMetricData { readonly descriptor: InstrumentDescriptor; readonly aggregationTemporality: AggregationTemporality; /** diff --git a/experimental/packages/opentelemetry-sdk-metrics/src/index.ts b/experimental/packages/opentelemetry-sdk-metrics/src/index.ts index e9ad1ef4b9..3ce97504de 100644 --- a/experimental/packages/opentelemetry-sdk-metrics/src/index.ts +++ b/experimental/packages/opentelemetry-sdk-metrics/src/index.ts @@ -14,19 +14,79 @@ * limitations under the License. */ -export { Sum, LastValue, Histogram } from './aggregator/types'; -export * from './export/AggregationTemporality'; -export * from './export/MetricData'; -export * from './export/MetricExporter'; -export * from './export/MetricProducer'; -export * from './export/MetricReader'; -export * from './export/PeriodicExportingMetricReader'; -export * from './export/InMemoryMetricExporter'; -export * from './export/ConsoleMetricExporter'; -export { InstrumentDescriptor, InstrumentType } from './InstrumentDescriptor'; -export * from './Meter'; -export * from './MeterProvider'; -export * from './ObservableResult'; -export { TimeoutError } from './utils'; -export * from './view/Aggregation'; -export * from './view/View'; +export { + Sum, + LastValue, + Histogram, +} from './aggregator/types'; + +export { + AggregationTemporality, + AggregationTemporalitySelector, +} from './export/AggregationTemporality'; + +export { + DataPoint, + DataPointType, + SumMetricData, + GaugeMetricData, + HistogramMetricData, + ResourceMetrics, + ScopeMetrics, + MetricData, + CollectionResult, +} from './export/MetricData'; + +export { + PushMetricExporter, +} from './export/MetricExporter'; + +export { + MetricReader, +} from './export/MetricReader'; + +export { + PeriodicExportingMetricReader, + PeriodicExportingMetricReaderOptions, +} from './export/PeriodicExportingMetricReader'; + +export { + InMemoryMetricExporter, +} from './export/InMemoryMetricExporter'; + +export { + ConsoleMetricExporter, +} from './export/ConsoleMetricExporter'; + +export { + InstrumentDescriptor, + InstrumentType, +} from './InstrumentDescriptor'; + +export { + Meter, +} from './Meter'; + +export { + MeterProvider, + MeterProviderOptions, +} from './MeterProvider'; + +export { + DefaultAggregation, + ExplicitBucketHistogramAggregation, + DropAggregation, + HistogramAggregation, + LastValueAggregation, + SumAggregation, + Aggregation +} from './view/Aggregation'; + +export { + View, + ViewOptions, +} from './view/View'; + +export { + TimeoutError +} from './utils'; diff --git a/experimental/packages/opentelemetry-sdk-metrics/test/ObservableResult.test.ts b/experimental/packages/opentelemetry-sdk-metrics/test/ObservableResult.test.ts index f6a38ce443..aaa97768b8 100644 --- a/experimental/packages/opentelemetry-sdk-metrics/test/ObservableResult.test.ts +++ b/experimental/packages/opentelemetry-sdk-metrics/test/ObservableResult.test.ts @@ -16,9 +16,12 @@ import { ValueType } from '@opentelemetry/api-metrics'; import * as assert from 'assert'; -import { BatchObservableResultImpl, InstrumentType } from '../src'; +import { InstrumentType } from '../src'; import { ObservableInstrument } from '../src/Instruments'; -import { ObservableResultImpl } from '../src/ObservableResult'; +import { + BatchObservableResultImpl, + ObservableResultImpl +} from '../src/ObservableResult'; import { ObservableRegistry } from '../src/state/ObservableRegistry'; import { commonAttributes, commonValues, defaultInstrumentDescriptor } from './util'; diff --git a/experimental/packages/opentelemetry-sdk-metrics/test/state/MeterSharedState.test.ts b/experimental/packages/opentelemetry-sdk-metrics/test/state/MeterSharedState.test.ts index bacbe87e3f..0a4b504b9f 100644 --- a/experimental/packages/opentelemetry-sdk-metrics/test/state/MeterSharedState.test.ts +++ b/experimental/packages/opentelemetry-sdk-metrics/test/state/MeterSharedState.test.ts @@ -21,12 +21,12 @@ import { Meter, MeterProvider, DataPointType, - CollectionResult, View } from '../../src'; import { assertMetricData, defaultInstrumentationScope, defaultResource, sleep } from '../util'; import { TestMetricReader } from '../export/TestMetricReader'; import { MeterSharedState } from '../../src/state/MeterSharedState'; +import { CollectionResult } from '../../src/export/MetricData'; describe('MeterSharedState', () => { afterEach(() => { diff --git a/experimental/packages/opentelemetry-sdk-metrics/test/state/MetricCollector.test.ts b/experimental/packages/opentelemetry-sdk-metrics/test/state/MetricCollector.test.ts index 77047d9f52..ad65f1c027 100644 --- a/experimental/packages/opentelemetry-sdk-metrics/test/state/MetricCollector.test.ts +++ b/experimental/packages/opentelemetry-sdk-metrics/test/state/MetricCollector.test.ts @@ -16,7 +16,8 @@ import * as assert from 'assert'; import * as sinon from 'sinon'; -import { MeterProvider, TimeoutError } from '../../src'; +import { MeterProvider } from '../../src'; +import { TimeoutError } from '../../src/utils'; import { DataPointType } from '../../src/export/MetricData'; import { PushMetricExporter } from '../../src/export/MetricExporter'; import { MeterProviderSharedState } from '../../src/state/MeterProviderSharedState';