You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be great to move this logic to this project so that the OTEL operator can depend only on auto-instrumentations-node and use the supported way to initialize the instrumentation env NODE_OPTIONS="--require @opentelemetry/auto-instrumentations-node/register"
function getMetricReader() {
switch (process.env.OTEL_METRICS_EXPORTER) {
case undefined:
case '':
case 'otlp':
diag.info('using otel metrics exporter');
return new PeriodicExportingMetricReader({
exporter: new OTLPMetricExporter(),
});
case 'prometheus':
diag.info('using prometheus metrics exporter');
return new PrometheusExporter({});
case 'none':
diag.info('disabling metrics reader');
return undefined;
default:
throw Error(`no valid option for OTEL_METRICS_EXPORTER: ${process.env.OTEL_METRICS_EXPORTER}`)
}
}
It looks like this should be handled when we add the ability to use environment variables with the Node SDK for metrics. After that we should be able to cleanup some of the code in the operator and allow the auto-instrumentations package to handle a lot more of the work with less duplication of code.
Is your feature request related to a problem? Please describe
The OTEL operator uses
auto-instrumentations-node
, however the dependency does not initialize metrics exporters (otlp and Prometheus) https://github.com/open-telemetry/opentelemetry-operator/blob/main/autoinstrumentation/nodejs/src/autoinstrumentation.ts#L33It would be great to move this logic to this project so that the OTEL operator can depend only on
auto-instrumentations-node
and use the supported way to initialize the instrumentationenv NODE_OPTIONS="--require @opentelemetry/auto-instrumentations-node/register"
This ticket is related to open-telemetry/opentelemetry-operator#3465
Describe the solution you'd like to see
Add the following dependencies to
uto-instrumentations-node
or any transitive dependency e.g.sdk-node
and initialize the metrics exporter
Describe alternatives you've considered
Additional context
open-telemetry/opentelemetry-operator#3465
The text was updated successfully, but these errors were encountered: