Skip to content

Next.js: Reduce proxy segment noise from prefetch requests #27070

Backlog

Description

@chargome

Every proxy run creates its own segment, usually 1 to 3 ms long. The App Router prefetches every visible link, and each prefetch passes through the proxy.

In a production app, a single pageload produced five proxy segments from prefetches. Over a week the proxy accounts for close to 100k segments.

To do

  • Measure how many proxy segments come from prefetch requests. They carry the next-router-prefetch or next-router-segment-prefetch header.
  • Decide whether to change the default, for example by not sampling prefetch proxy runs, or to document how users filter them with tracesSampler or ignoreSpans.

Revisit after the proxy and the render share a trace. On next start the proxy then becomes a child span and stops being a segment of its own.

Activity

  1. linear-code commented on Dec 2, 2026

    @linear-code
  2. self-assigned this
    on Dec 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions