Skip to main content
GoodFirstPicks
DashboardIssuesReposLeaderboard

GoodFirstPicks by Leaveitblank © 2026

CreatorRequest a RepoPrivacy PolicyTerms of Service
Opentelemetry warnings since v16.2.0 | GoodFirstPicks

Opentelemetry warnings since v16.2.0

vercel/next.js 0 comments 11d ago
View on GitHub
mediumopenScope: somewhat clearSkill match: maybeNext.jsTypeScriptReact

Why this is a good first issue

Requires understanding of opentelemetry span lifecycle in Next.js

AI Summary

The issue involves opentelemetry warnings appearing when spans are accessed after closure, likely related to recent changes in v16.2.0. Needs investigation into span lifecycle management during server operations. Blockers include needing opentelemetry expertise and understanding Next.js instrumentation changes.

Issue Description

Link to the code that reproduces this issue

https://github.com/tmair/otel-issue

To Reproduce

  1. Install the dependencies pnpm install
  2. Build the application
  3. Run pnpm run start
  4. Request the main page under http://localhost:3000/

Current vs. Expected behavior

I expect no warnings from opentelemetry in the console but I get the following warning on each request:

Cannot execute the operation on ended Span {traceId: 722ebe96aae7b52fa0afa2f06a5110c0, spanId: 4663e719a6a39b15} Error: Operation attempted on ended Span {traceId: 722ebe96aae7b52fa0afa2f06a5110c0, spanId: 4663e719a6a39b15}

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 25.3.0: Wed Jan 28 20:51:28 PST 2026; root:xnu-12377.91.3~2/RELEASE_ARM64_T6041
  Available memory (MB): 49152
  Available CPU cores: 16
Binaries:
  Node: 24.11.0
  npm: 11.6.1
  Yarn: 1.22.22
  pnpm: 10.20.0
Relevant Packages:
  next: 16.2.0 // Latest available version is detected (16.2.0).
  eslint-config-next: N/A
  react: 19.2.4
  react-dom: 19.2.4
  typescript: 5.9.3
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Not sure

Which stage(s) are affected? (Select all that apply)

next start (local)

Additional context

This happens when using a custom server and opentelemetry instrumentation. It seems that the parent span is already closed when trying to add additional attributes onto it.

I suspect that the changes made in #90832 cause this issue. Downgrading to v16.1.7 fixes the issue.

Want to work on this?

Claim this issue to let others know you're working on it. You'll earn 20 points when you complete it!

Risk Flags

  • opentelemetry integration
  • span lifecycle management
Loading labels...

Details

Points20 pts
Difficultymedium
Scopesomewhat clear
Skill Matchmaybe
Test Focusedno