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

instrumentation-undici does not work when enabled: true is set in the configuration #2391

Closed
enikey87 opened this issue Aug 21, 2024 · 0 comments · Fixed by #2395
Closed
Assignees
Labels
bug Something isn't working pkg:instrumentation-undici priority:p2 Bugs and spec inconsistencies which cause telemetry to be incomplete or incorrect

Comments

@enikey87
Copy link

What version of OpenTelemetry are you using?

  "dependencies": {
    "@opentelemetry/api": "1.9.0",
    "@opentelemetry/auto-instrumentations-node": "0.49.1",
    "@opentelemetry/sdk-metrics": "1.25.1",
    "@opentelemetry/sdk-node": "0.52.1"
  },

What version of Node are you using?

node -v
v20.16.0

What did you do?

Tried to instrument fetch with Node.js auto-instrumentations with explicitly enabled instrumentation-undici:

import { NodeSDK } from '@opentelemetry/sdk-node'
import { getNodeAutoInstrumentations } from '@opentelemetry/auto-instrumentations-node'
import { ConsoleSpanExporter } from '@opentelemetry/sdk-trace-base'
import { register } from 'module'

const sdk = new NodeSDK({
  traceExporter: new ConsoleSpanExporter(),

  instrumentations: [
    getNodeAutoInstrumentations({
      '@opentelemetry/instrumentation-undici': { enabled: true }
    })
  ]
})

sdk.start()

register('@opentelemetry/instrumentation/hook.mjs', import.meta.url)

What did you expect to see?

Expected to see spans exported to console for node's global fetch().

What did you see instead?

No spans in console.

Additional context

@enikey87 enikey87 added the bug Something isn't working label Aug 21, 2024
@pichlermarc pichlermarc added pkg:instrumentation-undici priority:p2 Bugs and spec inconsistencies which cause telemetry to be incomplete or incorrect labels Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pkg:instrumentation-undici priority:p2 Bugs and spec inconsistencies which cause telemetry to be incomplete or incorrect
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants