feat: external tracing support

Abierto
#5,170 1 comentario 1 reacción 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
15/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
typescript

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

pending triage
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:

  1. keep tracingChannel on → every span gets exported twice
  2. 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:

  1. separate option for handling built-in sinks (eg tracing: { sink: "auto" | false }), making tracingChannel producers-only.
  2. add a new public nitro/tracing export 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?
Lenguaje dominante
TypeScript
Estrellas
11.5k
Forks
968
Merge medio
4 d 9 h
PR fusionados (30 d)
64

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de nitrojs/nitro

Todos los issues de nitrojs/nitro

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.