Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(sdk-metrics-base): meter registration #2666

Merged
merged 7 commits into from
Jan 8, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Merge branch 'main' into metrics-ff/meter
# Conflicts:
#	experimental/packages/opentelemetry-sdk-metrics-base/test/state/MetricCollector.test.ts
legendecas committed Jan 8, 2022

Unverified

This user has not yet uploaded their public signing key.
commit f5220acf9d8c2b692bd9f3a51b3c9ce41b4cbcc4
Original file line number Diff line number Diff line change
@@ -15,6 +15,7 @@
*/

import { MetricReader } from '../../src';
import { MetricCollector } from '../../src/state/MetricCollector';

/**
* A test metric reader that implements no-op onForceFlush() and onShutdown() handlers.
@@ -27,4 +28,8 @@ export class TestMetricReader extends MetricReader {
protected onShutdown(): Promise<void> {
return Promise.resolve(undefined);
}

getMetricCollector(): MetricCollector {
return this['_metricProducer'] as MetricCollector;
}
}
Original file line number Diff line number Diff line change
@@ -20,7 +20,6 @@ import { MeterProvider } from '../../src';
import { AggregationTemporality } from '../../src/export/AggregationTemporality';
import { MetricData, PointDataType } from '../../src/export/MetricData';
import { MetricExporter } from '../../src/export/MetricExporter';
import { MetricReader } from '../../src/export/MetricReader';
import { MeterProviderSharedState } from '../../src/state/MeterProviderSharedState';
import { MetricCollector } from '../../src/state/MetricCollector';
import { defaultInstrumentationLibrary, defaultResource, assertMetricData, assertPointData } from '../util';
@@ -67,7 +66,7 @@ describe('MetricCollector', () => {
function setupInstruments(exporter: MetricExporter) {
const meterProvider = new MeterProvider({ resource: defaultResource });

const reader = new TestMetricReader(exporter);
const reader = new TestMetricReader(exporter.getPreferredAggregationTemporality());
meterProvider.addMetricReader(reader);
const metricCollector = reader.getMetricCollector();

You are viewing a condensed version of this merge commit. You can view the full changes here.