-
Notifications
You must be signed in to change notification settings - Fork 608
Description
What version of OpenTelemetry are you using?
"dependencies": {
"@opentelemetry/api": "^1.9.0",
"@opentelemetry/exporter-trace-otlp-proto": "^0.54.2",
"@opentelemetry/instrumentation": "^0.54.2",
"@opentelemetry/instrumentation-express": "^0.44.0",
"@opentelemetry/instrumentation-http": "^0.54.2",
"@opentelemetry/resources": "^1.27.0",
"@opentelemetry/sdk-trace-base": "^1.27.0",
"@opentelemetry/sdk-trace-node": "^1.27.0",
"@opentelemetry/semantic-conventions": "^1.27.0",
"axios": "^1.6.0",
"express": "^4.17.1"
}
What version of Node are you using?
v20.16.0
What did you do?
I try to run examples/express in this repo locally.
What did you expect to see?
Http and express should be auto-instrument and send traces data to my observability backend.
What did you see instead?
I just can not see any traces data. The instrument doen't work.
Additional context
the orign code in server.ts is:
import { setupTracing } from './tracer';
// Require in rest of modules
import * as express from 'express';
import * as axios from 'axios';
import { RequestHandler } from 'express';
setupTracing('example-express-server');
after I adjust the order of instrument like this, it works:
import { setupTracing } from './tracer';
setupTracing('example-express-server');
// Require in rest of modules
import * as express from 'express';
import * as axios from 'axios';
import { RequestHandler } from 'express';