René's URL Explorer Experiment


Title: fix(core): mint the fallback external trace id per run by NERLOE · Pull Request #4534 · triggerdotdev/trigger.dev · GitHub

Open Graph Title: fix(core): mint the fallback external trace id per run by NERLOE · Pull Request #4534 · triggerdotdev/trigger.dev

X Title: fix(core): mint the fallback external trace id per run by NERLOE · Pull Request #4534 · triggerdotdev/trigger.dev

Description: ✅ Checklist I have followed every step in the contributing guide The PR title follows the convention. I ran and tested the code works What Runs that carry no external trace context (schedules, task-to-task triggers) fall back to a trace id generated once in the TracingSDK constructor. With experimental_processKeepAlive the SDK outlives the run, so every run on a warm process is exported to the external OTLP endpoint under that one id. Across our production traces, 80.3% contained spans from more than one run, worst case 25. Per-run cost and latency attribution is unusable as a result. This is the same warm-start hazard c043c4a fixed for the external-context path, which left the fallback captured at construction. How FallbackExternalTraceIds hands out one id per internal trace, shared by the span and log wrappers so a run's spans and logs agree. The id is keyed off the record's own internal trace id rather than ambient state at export time, because batch processors drain asynchronously and a run's records routinely export after the next run has started. The map is bounded and evicts least-recently-used, so a run that is still exporting can't lose its id. Granularity follows the internal trace, so a run and the runs it triggers stay on one trace. Risk: the wrappers only exist when exporters / logExporters are configured, so deployments that don't export externally are untouched. Nothing outside tracingSDK.ts changes. Known gap (pre-existing): sampling and id selection still branch on ambient getExternalTraceContext(), so records draining across a run boundary in mixed mode are misplaced in both directions. It can't use the approach here — the external id comes from the run's incoming traceparent, which isn't carried on the record — so closing it means capturing internalTraceId -> external context in a span processor. Happy to follow up separately. Testing packages/core suite passes. pnpm run format and pnpm run lint:fix produce no diff. Six cases in externalSpanExporterWrapper.test.ts, each mutation-checked rather than just observed passing: one id per run, stability within a run, correct id when records drain after the next run started (spans and logs together), external export stays off when unconfigured, retention of a run still exporting while the map churns, and the bound itself. CI: the five failing webapp shards are the ones containing containerTest suites. Fork PRs receive no repository secrets, so unit-tests-webapp.yml skips the DockerHub login and the image pre-pull (both gated on env.DOCKERHUB_USERNAME) and the container tests time out at 60s. Same five shards across five runs, every failure a 60s timeout, and those shards pass on internal PRs. Happy to be corrected if you can run them with secrets available. Changelog Unrelated runs are no longer merged into a single trace in your external observability tool when they happen to execute on the same warm worker process. A run and the runs it triggers still share one trace, so a run tree stays together. Screenshots n/a Supersedes #4526 (auto-closed before I was vouched) and #4533 (opened ready rather than as a draft). GitHub won't reopen either.

Open Graph Description: ✅ Checklist I have followed every step in the contributing guide The PR title follows the convention. I ran and tested the code works What Runs that carry no external trace context (schedules...

X Description: ✅ Checklist I have followed every step in the contributing guide The PR title follows the convention. I ran and tested the code works What Runs that carry no external trace context (schedules...

Opengraph URL: https://github.com/triggerdotdev/trigger.dev/pull/4534

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:0e5b750c-bbe5-1e0c-d106-7fcaf76cb434
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id85BE:28956B:61CAC7:910069:6AFAF2C3
html-safe-nonce712cb4e60f0f62ca7153b2bde71bd9c3ded533c50dbcae815744c1ef3f177cc2
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NUJFOjI4OTU2Qjo2MUNBQzc6OTEwMDY5OjZBRkFGMkMzIiwidmlzaXRvcl9pZCI6IjYwOTQ0NzU3NzQ5NjQ0NjIyNzUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacd69d3fdff605f67a2df5ed98a88c76c6bebea50eaed399f352199fe1d97bba36
hovercard-subject-tagpull_request:4229115774
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/triggerdotdev/trigger.dev/pull/4534/files
twitter:imagehttps://avatars.githubusercontent.com/u/32075361?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/32075361?s=400&v=4
og:image:alt✅ Checklist I have followed every step in the contributing guide The PR title follows the convention. I ran and tested the code works What Runs that carry no external trace context (schedules...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None0178036d8230524a18422872393ab7e708443ae4c2047f758560a2db870c1913
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/triggerdotdev/trigger.dev git https://github.com/triggerdotdev/trigger.dev.git
octolytics-dimension-user_id95297378
octolytics-dimension-user_logintriggerdotdev
octolytics-dimension-repository_id572570113
octolytics-dimension-repository_nwotriggerdotdev/trigger.dev
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id572570113
octolytics-dimension-repository_network_root_nwotriggerdotdev/trigger.dev
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasea85e96a83bed7871993e6b1ffda24105928eee17
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/triggerdotdev/trigger.dev/pull/4534/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftriggerdotdev%2Ftrigger.dev%2Fpull%2F4534%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftriggerdotdev%2Ftrigger.dev%2Fpull%2F4534%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=triggerdotdev%2Ftrigger.dev
Reloadhttps://github.com/triggerdotdev/trigger.dev/pull/4534/files
Reloadhttps://github.com/triggerdotdev/trigger.dev/pull/4534/files
Reloadhttps://github.com/triggerdotdev/trigger.dev/pull/4534/files
triggerdotdevhttps://github.com/triggerdotdev
trigger.devhttps://github.com/triggerdotdev/trigger.dev
Codehttps://github.com/triggerdotdev/trigger.dev
Issues203 (203)https://github.com/triggerdotdev/trigger.dev/issues
Pull requests67 (67)https://github.com/triggerdotdev/trigger.dev/pulls
Discussionshttps://github.com/triggerdotdev/trigger.dev/discussions
Actionshttps://github.com/triggerdotdev/trigger.dev/actions
Projectshttps://github.com/triggerdotdev/trigger.dev/projects
Security and quality39 (39)https://github.com/triggerdotdev/trigger.dev/security
Insightshttps://github.com/triggerdotdev/trigger.dev/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Ftriggerdotdev%2Ftrigger.dev%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Ftriggerdotdev%2Ftrigger.dev%2Fissues%2Fnew%2Fchoose
nicktrnhttps://github.com/nicktrn
triggerdotdev:mainhttps://github.com/triggerdotdev/trigger.dev/tree/main
NERLOE:fix/external-trace-id-per-runhttps://github.com/NERLOE/trigger.dev/tree/fix/external-trace-id-per-run
Conversation 22 https://github.com/triggerdotdev/trigger.dev/pull/4534
Commits 5 https://github.com/triggerdotdev/trigger.dev/pull/4534/commits
Checks 51 https://github.com/triggerdotdev/trigger.dev/pull/4534/checks
Files changed https://github.com/triggerdotdev/trigger.dev/pull/4534/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4534/files
fix(core): mint the fallback external trace id per run https://github.com/triggerdotdev/trigger.dev/pull/4534/files#top
Show all changes 5 commits https://github.com/triggerdotdev/trigger.dev/pull/4534/files
6efeb47 fix(core): give each run its own external fallback trace id NERLOE Aug 7, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4534/commits/6efeb474fbd9556ba3144b55c68a9dad91ece930
8b7eace Merge branch 'main' into fix/external-trace-id-per-run isshaddad Aug 18, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4534/commits/8b7eace2a0268964fe0f97241d906af88779e88d
271fe30 test(core): cover log records with no spanContext nicktrn Aug 18, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4534/commits/271fe30d53657f19286edda692dc3d94b8124888
600f742 docs(changeset): drop inaccurate run-tree claim nicktrn Aug 18, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4534/commits/600f742c40f3c66c75b6a261f39f7ce15ec70fa6
fedbdfb Merge branch 'main' into fix/external-trace-id-per-run nicktrn Aug 18, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4534/commits/fedbdfb646f83ddc8a637e9780c6fb289a790131
Clear filters https://github.com/triggerdotdev/trigger.dev/pull/4534/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4534/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4534/files
external-trace-id-per-run.md https://github.com/triggerdotdev/trigger.dev/pull/4534/files#diff-416f3234329663494a1b88173077e38b3d8860e9fe3dcd58e596483b136279bb
tracingSDK.ts https://github.com/triggerdotdev/trigger.dev/pull/4534/files#diff-ce510b575f0568e5e9854cedbca289205f363324a89085ae9b668c3cc334cd93
externalSpanExporterWrapper.test.ts https://github.com/triggerdotdev/trigger.dev/pull/4534/files#diff-325ef3d1fe3b9db00f44b5307f25ba9c2db1ed06ec234dbe50dfa4bed7c014bd
.changeset/external-trace-id-per-run.mdhttps://github.com/triggerdotdev/trigger.dev/pull/4534/files#diff-416f3234329663494a1b88173077e38b3d8860e9fe3dcd58e596483b136279bb
View file https://github.com/NERLOE/trigger.dev/blob/fedbdfb646f83ddc8a637e9780c6fb289a790131/.changeset/external-trace-id-per-run.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/4534/{{ revealButtonHref }}
packages/core/src/v3/otel/tracingSDK.tshttps://github.com/triggerdotdev/trigger.dev/pull/4534/files#diff-ce510b575f0568e5e9854cedbca289205f363324a89085ae9b668c3cc334cd93
View file https://github.com/NERLOE/trigger.dev/blob/fedbdfb646f83ddc8a637e9780c6fb289a790131/packages/core/src/v3/otel/tracingSDK.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/4534/{{ revealButtonHref }}
https://github.com/triggerdotdev/trigger.dev/pull/4534/files#diff-ce510b575f0568e5e9854cedbca289205f363324a89085ae9b668c3cc334cd93
https://github.com/triggerdotdev/trigger.dev/pull/4534/files#diff-ce510b575f0568e5e9854cedbca289205f363324a89085ae9b668c3cc334cd93
https://github.com/triggerdotdev/trigger.dev/pull/4534/files#diff-ce510b575f0568e5e9854cedbca289205f363324a89085ae9b668c3cc334cd93
https://github.com/triggerdotdev/trigger.dev/pull/4534/files#diff-ce510b575f0568e5e9854cedbca289205f363324a89085ae9b668c3cc334cd93
https://github.com/triggerdotdev/trigger.dev/pull/4534/files#diff-ce510b575f0568e5e9854cedbca289205f363324a89085ae9b668c3cc334cd93
https://github.com/triggerdotdev/trigger.dev/pull/4534/files#diff-ce510b575f0568e5e9854cedbca289205f363324a89085ae9b668c3cc334cd93
https://github.com/triggerdotdev/trigger.dev/pull/4534/files#diff-ce510b575f0568e5e9854cedbca289205f363324a89085ae9b668c3cc334cd93
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4534/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4534/files
https://github.com/triggerdotdev/trigger.dev/pull/4534/files#diff-ce510b575f0568e5e9854cedbca289205f363324a89085ae9b668c3cc334cd93
https://github.com/triggerdotdev/trigger.dev/pull/4534/files#diff-ce510b575f0568e5e9854cedbca289205f363324a89085ae9b668c3cc334cd93
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4534/files
https://github.com/triggerdotdev/trigger.dev/pull/4534/files#diff-ce510b575f0568e5e9854cedbca289205f363324a89085ae9b668c3cc334cd93
https://github.com/triggerdotdev/trigger.dev/pull/4534/files#diff-ce510b575f0568e5e9854cedbca289205f363324a89085ae9b668c3cc334cd93
https://github.com/triggerdotdev/trigger.dev/pull/4534/files#diff-ce510b575f0568e5e9854cedbca289205f363324a89085ae9b668c3cc334cd93
https://github.com/triggerdotdev/trigger.dev/pull/4534/files#diff-ce510b575f0568e5e9854cedbca289205f363324a89085ae9b668c3cc334cd93
https://github.com/triggerdotdev/trigger.dev/pull/4534/files#diff-ce510b575f0568e5e9854cedbca289205f363324a89085ae9b668c3cc334cd93
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4534/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4534/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.