bug: trace id shared between different runs triggered by cron in DEV env

Aberta
#4,313 1 comentário 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

@dubeyharshit0605 já está trabalhando nisso.

Desde 22/7/2026.

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
62/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Pouca atividade
Stack de tecnologia
grafana, typescript
Domínio
observability

Direção de pesquisa

Start with the OpenTelemetry processor change linked in the issue, especially where externalTraceId is set once at app startup and applied to task spans. Check how trace context is selected when attempts run; done means concurrent cron tasks without a parent context each appear as separate root traces, rather than sharing one trace ID.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

Provide environment information

System:
OS: macOS 26.2
CPU: (10) arm64 Apple M1 Max
Memory: 2.03 GB / 32.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 24.9.0 - /Users/awinn/.node_versions/bin/node
Yarn: 4.17.0 - /Users/awinn/projects/work/cal/node_modules/.bin/yarn
npm: 11.6.0 - /Users/awinn/.node_versions/bin/npm
Deno: 2.8.0 - /opt/homebrew/bin/deno

Describe the bug

I am in running on a development branch and have multiple tasks scheduled to run with cron schedules.

After enabling tracing in the environment I noticed traces in grafana that had two "Attempt 1" spans for different tasks.

I was able to inspect the otel processors at runtime during task execution and log the externalTraceId here: https://github.com/triggerdotdev/trigger.dev/pull/3768/changes#diff-ce510b575f0568e5e9854cedbca289205f363324a89085ae9b668c3cc334cd93R437 which is set once when the app starts up. That generated trace id was used to replace the existing trace IDs of the spans for both tasks.

I don't think it ever makes sense to replace the trace IDs of multiple spans with one global persistent value like this. If a parent trace context is not found it's better for each attempt to become the root span of it's own trace.

Reproduction repo

na

To reproduce
  1. create two distinct tasks the run at the same time via CRON.
  2. configure otel export to any compatible service
  3. start trigger.dev in development and observe the traces your provider shows for those tasks
Additional information

No response

Linguagem predominante
TypeScript
Estrelas
16.5k
Forks
1.5k
Merge médio
1d 15h
PRs com merge (30d)
17

Preparar o ambiente

Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de triggerdotdev/trigger.dev

Todas as issues de triggerdotdev/trigger.dev

Issues semelhantes

Mais issues de TypeScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.