feat(dynamic-sampling): make docs simpler and easier to understand#17748
feat(dynamic-sampling): make docs simpler and easier to understand#17748shellmayr wants to merge 11 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| --- | ||
| 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 | ||
| --- |
There was a problem hiding this comment.
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.
Dav1dde
left a comment
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
| 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.
Closes TET-2348