Skip to content

Commit

Permalink
chore(sdk-metrics): clean up exports (#3197)
Browse files Browse the repository at this point in the history
* chore(sdk-metrics): clean up exports

* fix(changelog): add entry.

* fix(changelog): move entry to unreleased.

* fix: add TimeoutError back.

* fix: add CollectionResult back in and update changelog.
  • Loading branch information
pichlermarc authored Aug 29, 2022
1 parent a5abee6 commit d4ab03f
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 21 deletions.
10 changes: 10 additions & 0 deletions experimental/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { Histogram } from '../aggregator/types';
/**
* Basic metric data fields.
*/
export interface BaseMetricData {
interface BaseMetricData {
readonly descriptor: InstrumentDescriptor;
readonly aggregationTemporality: AggregationTemporality;
/**
Expand Down
92 changes: 76 additions & 16 deletions experimental/packages/opentelemetry-sdk-metrics/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit d4ab03f

Please sign in to comment.