Opentelemety nodes js tracing error

If you are asking about a problem you are experiencing, please use the following template, as it will help us help you. If you have a different problem, please delete all of this text :slight_smile:

TIP 1: select at least one tag that further categorizes your topic. For example server for APM Server related questions, java for questions regarding the Elastic APM Java agent, or ui for questions about the APM App within Kibana.

TIP 2: Check out the troubleshooting guide first. Not only will it help you to resolve common problems faster but it also explains in more detail which information we need before we can properly help you.

Kibana version: 8.8.1

Elasticsearch version: 8.8.1

APM Server version: 8.8.1

APM Agent language and version: "@opentelemetry/api": "^1.7.0" and "@opentelemetry/auto-instrumentations-node": "^0.41.1"

**Fresh install

I am trying to instrument my nodejs application to send traces to elastic apm.


  1. I have sample hellow world nodejs application
  2. i did npm install --save @opentelemetry/api and npm install --save @opentelemetry/auto-instrumentations-node
  3. Started the app with command -
    env OTEL_TRACES_EXPORTER=otlp OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=<took the endpoint from integrations tab> OTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer xxxxxxxxxxxx" node --require @opentelemetry/auto-instrumentations-node/register app.js
  4. App is starting fine and also the traces were coming but on start up I am getting errors related to kubernetes. Below are the application log on start up
@opentelemetry/instrumentation-grpc Module @grpc/grpc-js has been loaded before @opentelemetry/instrumentation-grpc so it might not work, please initialize it before requiring @grpc/grpc-js
OpenTelemetry automatic instrumentation started successfully
no original function cpSync to wrap
no original function cp to wrap
no original function cp to wrap
Example app listening on port 3000!
Container Detector failed to read the Container ID:  ENOENT: no such file or directory, open '/proc/self/cgroup'
Process is not running on K8S [Error: ENOENT: no such file or directory, access '/var/run/secrets/'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'access',
  path: '/var/run/secrets/'

Hi @lalitprasanth,

Welcome back! I did find a related issue on the OTel JS agent GitHub:

There are a couple of references issues in that one that might be worth taking a look at as well, or potentially commenting on for help. But that looks to be an issue with the OTel JS agent rather than the ingestion to Elastic APM.

Hope that helps!

Hi @lalitprasanth,

Sorry for the very long delay in responding.

That Prcoess is not running on K8S ... output is a diagnostic "warning" from opentelemetry-js-contrib/detectors/node/opentelemetry-resource-detector-aws/src/detectors/AwsEksDetector.ts at main · open-telemetry/opentelemetry-js-contrib · GitHub -- i.e. from the @opentelemetry/resource-detector-aws package. This detector is turned on by default by the @opentelemetry/auto-instrumentations-node/register tool.

I am a little surprised that it is warning so loudly. Perhaps this is an issue you could bring up at Issues · open-telemetry/opentelemetry-js-contrib · GitHub ?

Similarly the Container Detector failed to read the Container ID message is a diagnostic "info"-level message from opentelemetry-js-contrib/detectors/node/opentelemetry-resource-detector-container/src/detectors/ContainerDetector.ts at 710631309e2af7c063f0dfcf489f3197b87c9987 · open-telemetry/opentelemetry-js-contrib · GitHub -- i.e. from the @opentelemetry/resource-detector-container package that is started by the .../register code by default.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.