Skip to content

[BUG] Instrumentation does not work #840

@ilovemesomeramen

Description

@ilovemesomeramen

Describe the bug

When i add a instrumentation.ts file with a basic OTEL config no traces are being collected and sent when i build with opennext.

Not sure if this is supposed to work but since i found this Issue: #171 which is Closed i assume it should work.

Steps to reproduce

Min reproducible example: https://github.com/ilovemesomeramen/opennextjs-cloudflare-instrumentation

  1. Clone the repo
  2. docker compose up in the debug folder
    • This starts a small web server which logs the received requests
  3. npm run build && npm run start
  4. visit http://localhost:3000
  5. After a view seconds observe the trace POST to the docker compose server
  6. Stop the next server and run npm run preview
  7. visit http://localhost:8787
  8. no traces are sent

Expected behavior

Traces should be sent and collected

@opennextjs/cloudflare version

1.6.3

Wrangler version

4.27.0

next info output

Operating System:
  Platform: linux
  Arch: x64
  Version: #1 SMP PREEMPT_DYNAMIC Thu, 17 Jul 2025 20:47:04 +0000
  Available memory (MB): 62086
  Available CPU cores: 16
Binaries:
  Node: 22.14.0
  npm: 11.4.2
  Yarn: N/A
  pnpm: 10.13.1
Relevant Packages:
  next: 15.3.5 // There is a newer version (15.4.5) available, upgrade recommended! 
  eslint-config-next: 15.3.5
  react: 19.1.1
  react-dom: 19.1.1
  typescript: 5.8.3
Next.js Config:
  output: N/A
 ⚠ There is a newer version (15.4.5) available, upgrade recommended! 
   Please try the latest canary version (`npm install next@canary`) to confirm the issue still exists before creating a new issue.
   Read more - https://nextjs.org/docs/messages/opening-an-issue

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions