feat: external tracing support
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 15/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- typescript
- Domain
- observability
Research direction
Start with tracingChannel handling in src/presets/cloudflare/preset.ts and src/presets/vercel/preset.ts, then the internal telemetry code in src/runtime/internal/telemetry/subscribe.ts and channels.ts, plus the kv.ts and database.ts virtual modules. Done means the maintainers agree on the tracing.sink option and the public nitro/tracing API shape. This is design work and should be discussed before any code is written.
Written by the indexing model from the issue text.
Description
Describe the feature
tracingChannel currently does two things at once: it enables the producers (h3/srvx plugins, plus the unstorage/db0 withTracing wrappers in the virtual modules) and, on cloudflare and vercel presets, it also registers the built-in bridge (cloudflare, vercel).
This makes bringing your own sink (OTLP exporter, Langfuse, etc) awkward on those presets:
- keep
tracingChannelon → every span gets exported twice - turn it off and wire h3/srvx manually → unstorage/db0 are lost, since they are only wrapped via the flag (kv, database)
On top of that subscribeTracedChannels, the TRACED_CHANNELS describers and Span are internal (#nitro/runtime/*), and the channel list is closed. So user-land channels (eg an app.llm one) can't reach the built-in sinks either, and every third-party sink ends up re-implementing the same subscribe/describe logic.
What I'd like to propose and do is a two step work:
- separate option for handling built-in sinks (eg
tracing: { sink: "auto" | false }), makingtracingChannelproducers-only. - add a new public
nitro/tracingexport that provides things like subscribe helpers, descirbers, spans and a way to register extra channels.
Having this flexibility means that any enterprise could have their own telemetry infra wired up and structured as they prefer, liek having tree spans instead of flat ones. As well as module authors have access to registering automatically their own channels so that application logic isn't required to do it on its own
Additional information
- Would you be willing to help implement this feature?
- Dominant language
- TypeScript
- Stars
- 11.5k
- Forks
- 968
- Avg merge
- 4d 9h
- Merged PRs (30d)
- 64
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nitrojs/nitro
-
pending triage
Difficulty 1/5 Under an hour Newbie friendliness 92/100
Maintainers usually reply within 2 days
-
Difficulty 1/5 Under an hour Newbie friendliness 95/100
Maintainers usually reply within 2 days
-
cloudflare: `nitro deploy` fails when a parent directory has a Wrangler configPossibly taken @draarivpatel-ui claimed this 13 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
Maintainers usually reply within 2 days
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 2 days
-
pending triage
Difficulty 5/5 Over a week Newbie friendliness 30/100
nitrojs/nitro#5205 · 1 reaction ·
Maintainers usually reply within 2 days
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
ranxianglei/billion-context#8319 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
JimLiu/open-artifact#126 ·
-
bug repro-ready
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
mksglu/context-mode#1454 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
laststance/design-world#98 ·
Maintainers usually reply within 1 day
-
Add: KCM True crimeOpenapproved check:passed streams:add
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day