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

NodeJS auto instrumentation does not generate metrics (docs/languages/js/automatic) #4171

Closed
aabmass opened this issue Mar 18, 2024 · 5 comments · Fixed by #4181
Closed

NodeJS auto instrumentation does not generate metrics (docs/languages/js/automatic) #4171

aabmass opened this issue Mar 18, 2024 · 5 comments · Fixed by #4181
Labels
bug Something isn't working sig:javascript

Comments

@aabmass
Copy link
Member

aabmass commented Mar 18, 2024

What needs to be changed?

The page should mention that metrics will not be generated when using --require @opentelemetry/auto-instrumentations-node/register

https://opentelemetry.io/docs/languages/js/automatic/#configuring-the-module tells the user they can configure export OTEL_METRICS_EXPORTER="otlp", but this doesn't produce any metrics. Digging into this a bit, @opentelemetry/sdk-node does not support configuring a MeterProvider from just environment variables (you need code).

This seems more like a bug in the Node SDK (possibly open-telemetry/opentelemetry-js#3871).

What is the name + path of the page that needs changed?

https://opentelemetry.io/docs/languages/js/automatic/#configuring-the-module

@aabmass aabmass added the bug Something isn't working label Mar 18, 2024
@cartermp
Copy link
Contributor

@open-telemetry/javascript-approvers what's your preferred resolution here? Remove the section about configuring metrics with env vars and making a notice about lacking support?

@pichlermarc
Copy link
Member

pichlermarc commented Mar 18, 2024

This seems more like a bug in the Node SDK (possibly open-telemetry/opentelemetry-js#3871).

Yep, that's a missing feature.

@open-telemetry/javascript-approvers what's your preferred resolution here? Remove the section about configuring metrics with env vars and making a notice about lacking support?

Yes I think that would be the best solution.

Note: if anyone's stumbling upon this issue, we're looking for contributors to pick up the following two issues (I just split them from open-telemetry/opentelemetry-js#3871 to make them easier to find):

@cartermp
Copy link
Contributor

Thanks @pichlermarc and @aabmass! This should address it in the interim: #4181

@garysassano
Copy link

I was quite puzzled as to why my Lambda function was emitting traces but not metrics.

Here are the environment variables I had configured:

AWS_LAMBDA_EXEC_WRAPPER: "/opt/otel-handler",
OTEL_SERVICE_NAME: "sqs-lambda",
OTEL_EXPORTER_OTLP_PROTOCOL: "http/protobuf",
OTEL_EXPORTER_OTLP_ENDPOINT: "https://api.honeycomb.io:443",
OTEL_EXPORTER_OTLP_HEADERS: "x-honeycomb-team=$HONEYCOMB_API_KEY",

@svrnm
Copy link
Member

svrnm commented Nov 20, 2024

@garysassano can you raise a new issue with your comment/question, otherwise it gets losed since this is an already closed issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working sig:javascript
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants