Skip to content

deno: Outgoing fetch gets no span and no trace propagation #23891

Description

@isaacs

This is the highest-impact finding in the audit. fetch is the idiomatic Deno HTTP client, and distributed tracing out of a Deno service is broken.

deno/src/integrations/breadcrumbs.ts:50 calls addFetchInstrumentationHandler, but only to record breadcrumbs. Nothing in packages/deno/src calls instrumentFetchRequest. Node has nativeNodeFetchIntegration, Bun has fetchIntegration, Cloudflare has fetchIntegration, vercel-edge has winterCGFetchIntegration. Deno has none.

Deno also emits no diagnostics channel for fetch (verified: node emits undici:request:create, deno and bun emit nothing), so denoHttpIntegration does not cover it either.

Probe result, running the built @sentry/deno under deno 2.9.2:

sentry-trace sent? false
baggage sent?     false
transactions: [ "GET /downstream", "parent" ]
  child spans: []   <- no http.client span under "parent"
  child spans: []

The downstream request became a separate root transaction instead of a child of parent, which is exactly the symptom a user would report as "my traces are broken".

Work item. Add a fetchIntegration to @sentry/deno modeled on packages/bun/src/integrations/fetch.ts (which is already a near-copy of the Cloudflare one) and put it in the default set. Add an integration test that asserts sentry-trace and baggage reach the downstream server and that an http.client child span is produced.

**Prior art **(related history only). None. The nearest work is #21009 (merged) "feat(deno): instrument node:http on versions that support it", which covered the node:http client and left fetch untouched. The integration to copy is #22869 (merged), the Bun fetch integration. Given fetch is Deno's primary HTTP client, the absence of any report suggests nobody has looked, not that nobody is affected.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugDenojavascriptPull requests that update javascript code

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions