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

add the missing metrics exporter: exporter-metrics-otlp-http #1136

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
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
7 changes: 6 additions & 1 deletion nodejs/packages/layer/src/wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ import {
import { getEnv } from '@opentelemetry/core';
import { AwsLambdaInstrumentationConfig } from '@opentelemetry/instrumentation-aws-lambda';
import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-proto';
import { MeterProvider, MeterProviderOptions } from '@opentelemetry/sdk-metrics';
import { MeterProvider, MeterProviderOptions, PeriodicExportingMetricReader } from '@opentelemetry/sdk-metrics';
import { OTLPMetricExporter } from '@opentelemetry/exporter-metrics-otlp-grpc'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be exporter from exporter-metrics-otlp-proto. That's what what is in package.json, and the tracer is using HTTP proto as well.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the differences between the 2 packages?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both use protobuf as the data format, but exporter-*-otlp-proto uses HTTP as the protocol.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stevemao Do you have any objection to this suggestion?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can make the changes

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stevemao below you said

I'm not sure what I need to change. Please submit your own PR to address any issue. Cheers!

This is the change I was referring to. Seems like a straightforward suggestion. If you have questions, you can also stop by the SIG meeting to discuss.


function defaultConfigureInstrumentations() {
// Use require statements for instrumentation to avoid having to have transitive dependencies on all the typescript
Expand Down Expand Up @@ -121,8 +122,12 @@ async function initializeProvider() {
tracerProvider.register(sdkRegistrationConfig);

// Configure default meter provider (doesn't export metrics)
const metricExporter = new OTLPMetricExporter();
let meterConfig: MeterProviderOptions = {
resource,
readers: [new PeriodicExportingMetricReader({
stevemao marked this conversation as resolved.
Show resolved Hide resolved
exporter: metricExporter,
})]
}
if (typeof configureMeter === 'function') {
meterConfig = configureMeter(meterConfig);
Expand Down