Skip to content

feat(dynamic-sampling): make docs simpler and easier to understand#17748

Open
shellmayr wants to merge 11 commits into
masterfrom
shellmayr/feat/dynamic-sampling-simplify-docs
Open

feat(dynamic-sampling): make docs simpler and easier to understand#17748
shellmayr wants to merge 11 commits into
masterfrom
shellmayr/feat/dynamic-sampling-simplify-docs

Conversation

@shellmayr
Copy link
Copy Markdown
Member

  • Remove references to transaction rules, we are in the process of removing them
  • Simplify the architecture documentation - there's a lot of things in there that are not necessary for understanding
  • Remove the concept of fidelity, we don't need this for understanding, and it complicates things
  • Fix some URLs

Closes TET-2348

@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 13, 2026

TET-2348

@vercel
Copy link
Copy Markdown

vercel Bot commented May 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
develop-docs Ready Ready Preview, Comment May 13, 2026 1:32pm
sentry-docs Ready Ready Preview, Comment May 13, 2026 1:32pm

Request Review

@shellmayr shellmayr marked this pull request as ready for review May 13, 2026 13:18
Comment on lines 1 to 5
---
title: Fidelity and Biases
title: Biases
sidebar_order: 2
og_image: /og-images/application-architecture-dynamic-sampling-fidelity-and-biases.png
og_image: /og-images/application-architecture-dynamic-sampling-biases.png
---
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Renaming fidelity-and-biases.mdx to biases.mdx broke existing redirect chains and internal links because the necessary redirects were not added to middleware.ts.
Severity: MEDIUM

Suggested Fix

In middleware.ts, add two redirects. First, a redirect from the old final path /application-architecture/dynamic-sampling/fidelity-and-biases/ to the new path /application-architecture/dynamic-sampling/biases/. Second, a new redirect from the short path /dynamic-sampling/biases/ to the full path /application-architecture/dynamic-sampling/biases/ to fix the internal link.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: develop-docs/application-architecture/dynamic-sampling/biases.mdx#L1-L5

Potential issue: Renaming the file `fidelity-and-biases.mdx` to `biases.mdx` has broken
several navigation paths. First, the existing redirect chain for the old URL
(`/dynamic-sampling/fidelity-and-biases/` ->
`/application/dynamic-sampling/fidelity-and-biases/` ->
`/application-architecture/dynamic-sampling/fidelity-and-biases/`) now leads to a 404
page because the final destination was moved without an additional redirect. Second, the
'next page' link in `the-big-picture.mdx` points to the new short path
`/dynamic-sampling/biases/`, but no corresponding redirect was added in `middleware.ts`
to map it to the full path. Both external links and internal navigation will be broken.

Also affects:

  • develop-docs/application-architecture/dynamic-sampling/the-big-picture.mdx:99

Did we get this right? 👍 / 👎 to inform future reviews.

Copy link
Copy Markdown
Member

@Dav1dde Dav1dde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems a lot easier to understand for people who haven't fully embraced DS (yet), it does skip over some details which before were mentioned (e.g. how Relay behaves under certain circumstances/edge cases). Likely, this is a good thing, as it may be better to actually confirm edge cases with the code instead.

Curious what others think!


## The Concept of Fidelity
### Target Sample Rate
Dynamic Sampling defines a target sample rate for each project that specifies the amount of data to be retained. This target sample rate is a number between 0 and 1. This target sample rate is used to calculate the sample rate for each event, based on the project and transaction that the event belongs to. Dynamic Sampling does not use the project or transaction of the event, but rather the project and transaction that the trace was started from. The reason for this is that the system works on trace level, and not on an event level. So in order to retain an entire trace, decisions can only be made based on the information that is available at the start of the trace.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Dynamic Sampling defines a target sample rate for each project that specifies the amount of data to be retained. This target sample rate is a number between 0 and 1. This target sample rate is used to calculate the sample rate for each event, based on the project and transaction that the event belongs to. Dynamic Sampling does not use the project or transaction of the event, but rather the project and transaction that the trace was started from. The reason for this is that the system works on trace level, and not on an event level. So in order to retain an entire trace, decisions can only be made based on the information that is available at the start of the trace.
Dynamic Sampling defines a target sample rate for each project that specifies the amount of data to be retained. This target sample rate is a number between 0 and 1. It is used to calculate the sample rate for each event, based on the project and transaction that the event belongs to. Dynamic Sampling does not use the project or transaction of the event, but rather the project and transaction that the trace was started from. The reason for this is that the system works on trace level, and not on an event level. So in order to retain an entire trace, decisions can only be made based on the information that is available at the start of the trace.

Also, the second sentence in here is a pretty close restatement of the first: "Dynamic Sampling does not use the project or transaction of the event, but rather the project and transaction that the trace was started from. The reason for this is that the system works on trace level, and not on an event level."

I think something like "This is because we want traces to be sampled or discarded in their entirety, not partially sampled" might be better.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants