0

/bin/node -r /opt/otel/node/otel-agent.js /opt/service/dist/main.js

This is how I am running my application currently.

The problem is, sometimes otel-agent.js might not exist and I want to be able to define a 'Node' agent similar to how you can define various runtime arguments via the env variable

JAVA_TOOL_OPTIONS=javaagent:/opt/otel/java/aws-opentelemetry-agent.jar.

Does such a thing exist for Node?

E.Eldridge
  • 103
  • 8

2 Answers2

0

There is no agent for javascript in OpenTelemetry.

As an alternative, you can use auto instrumentation modules, I would start by looking at the docs for that: https://opentelemetry.io/docs/instrumentation/js/getting-started/nodejs/#instrumentation-modules

James Moessis
  • 654
  • 6
  • 8
0

NODE_OPTIONS=--require /opt/otel/otel-agent.js

E.Eldridge
  • 103
  • 8