Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(dynamic-sampling): organization settings #11791

Merged

Conversation

constantinius
Copy link
Contributor

@constantinius constantinius commented Nov 12, 2024

Add section under organization settings to explain the benefits of dynamic sampling and its relevant settings

Closes https://github.com/getsentry/projects/issues/214 and https://github.com/getsentry/projects/issues/213

Copy link

vercel bot commented Nov 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
changelog ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 10, 2025 0:22am
develop-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 10, 2025 0:22am
sentry-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 10, 2025 0:22am

Copy link

codecov bot commented Nov 12, 2024

Bundle Report

Changes will increase total bundle size by 1.1kB (0.01%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
sentry-docs-server-cjs 10.71MB 1.1kB (0.01%) ⬆️
sentry-docs-client-array-push 9.38MB -6 bytes (-0.0%) ⬇️

Affected Assets, Files, and Routes:

view changes for bundle: sentry-docs-client-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
static/chunks/pages/_app-*.js -3 bytes 865.95kB -0.0%
static/chunks/7801-*.js -3 bytes 391.02kB -0.0%
static/EZAQRMHBnXmMmGHtIJ9NX/_buildManifest.js (New) 578 bytes 578 bytes 100.0% 🚀
static/EZAQRMHBnXmMmGHtIJ9NX/_ssgManifest.js (New) 77 bytes 77 bytes 100.0% 🚀
static/OquOy4j-*.js (Deleted) -578 bytes 0 bytes -100.0% 🗑️
static/OquOy4j-*.js (Deleted) -77 bytes 0 bytes -100.0% 🗑️
view changes for bundle: sentry-docs-server-cjs

Assets Changed:

Asset Name Size Change Total Size Change (%)
1729.js -3 bytes 1.64MB -0.0%
../instrumentation.js -3 bytes 968.3kB -0.0%
9523.js -3 bytes 944.51kB -0.0%
../app/[[...path]]/page.js.nft.json 371 bytes 376.86kB 0.1%
../app/platform-redirect/page.js.nft.json 371 bytes 376.78kB 0.1%
../app/sitemap.xml/route.js.nft.json 371 bytes 374.75kB 0.1%

Copy link
Contributor

@lizokm lizokm left a comment

Choose a reason for hiding this comment

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

Thanks so much for starting on this! I know it's still in draft. Let me know when you'd like me to take another look. Also, take a look at our current DS docs to see if there's anything we can copy over. (https://docs.sentry.io/product/performance/retention-priorities/)

docs/organization/dynamic-sampling/index.mdx Outdated Show resolved Hide resolved
docs/organization/dynamic-sampling/index.mdx Outdated Show resolved Hide resolved
docs/organization/dynamic-sampling/index.mdx Outdated Show resolved Hide resolved
Copy link
Member

@jan-auer jan-auer left a comment

Choose a reason for hiding this comment

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

Some ideas for information that could be added:

  • In the introduction, explain what "dynamic sampling" truly is. As in, what about it is dynamic and what it tries to achieve.
    • How does DS fit with sampling in the SDKs and when do I use which?
    • What is the default (100% = no sampling)
    • How does DS re-compute rates? Note that here we shouldn't give any strict guarantees (e.g. "every 10 minutes") but mention that there's a short sliding window so that DS can adjust to seasonality like on weekends and over night traffic patterns.
  • AM2 and AM3 have different capabilities. The sample rates are chosen automatically on AM2, while only on AM3 do you have the new settings screen and control over rates. We should make this clear. @lizokm, how do we usually talk about the plan generations?
  • I'd structure this document into multiple larger blocks (not necessarily sections):
    • Organization-wide settings, including the sampling mode, project preview, sample rates
    • Project-wide settings, which for now are just the priorities
    • Connection to other product surface, esp subscription settings and stats
  • We can expand the description of the modes, particularly
    • How does DS work in each of the modes (i.e. what's the same and what's different)
    • How do I think about configuring each of the modes?
    • Especially in manual mode, describe the org-level assist. That's where we could use an arcade.
    • What happens when I change into this mode?
  • On project preview, what do the estimated rates mean, what's the difference between the two time frames, and how do they relate to what DS actually does?
  • Retention priorities are now called "[Dynamic] Sampling Priorities", so let's rename them here, too.

docs/organization/dynamic-sampling/index.mdx Outdated Show resolved Hide resolved
docs/organization/dynamic-sampling/index.mdx Outdated Show resolved Hide resolved

Dynamic Sampling is different from the sampling that you can configure in the Sentry SDKs. The SDK sampling rate is applied before events are sent to Sentry, while Dynamic Sampling is applied after events are received by Sentry. This means that Dynamic Sampling can be used to adjust the sample rate for events that have already been sent to Sentry and only take into account the volume of events that have been received by Sentry.

Also in contrast to the Dynamic Sampling, the SDK sample rate is never dynamically adjusted.
Copy link
Member

Choose a reason for hiding this comment

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

Strictly speaking, "never" isn't true :) traces_sampler allows customers to write their own code for dynamically adjusting sample rates. I think the true differences can rather be summarized as:

  • Sampling in SDKs affects how much is captured and sent to Sentry. For high throughput scenarios, this may be necessary to reduce instrumentation overheads.
  • To change sample rates in SDKs, one has to update the traces_sample_rate or traces_sampler callback, which usually requires a new deployment or release.
  • With dynamic sampling, one can change sample rates without touching the application or SDK. This affects the amount of data stored at Sentry, however, it will not have an effect on how much is sent from the SDKs.
  • Dynamic sampling continuously monitors incoming traffic patterns and adjusts fine-grained sample rates within the projects to prioritize more important data. See the sampling priorities for examples.


<Note>

Dynamic Sampling priorities are only available on the latest version of our plans, starting from 1M reserved transactions. Anyone in your org with owner or billing-level permissions can update your plan by going to Settings > Subscription, and clicking the "Manage Subscription" button.
Copy link
Member

Choose a reason for hiding this comment

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

This will need to be updated. DS priorities are available on AM2 and AM3 (right now this is still correct, as AM2 is latest).

<Note>

Retention priorities are only available on the latest version of our plans, starting from 1M reserved transactions. Anyone in your org with owner or billing-level permissions can update your plan by going to Settings > Subscription, and clicking the "Manage Subscription" button.
Please note that these Dynamic Sampling modes are only available for customers on the AM3 platform.
Copy link
Member

Choose a reason for hiding this comment

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

Should we call out that on AM2 there's also DS, the sample rate is chosen by the system based on transaction volume (1M+), and you still have controls for the sampling priorities?

Fleshed out configuration mode and sample rates
better short description
improved overview
more focus on actual features and not just quota filling in mode description
improved cross-linking

add section for distributed traces
clarified distinction between SDK and DS sampling
@constantinius
Copy link
Contributor Author

Hey @lizokm!

Together with @jan-auer we did work out more details of Dynamic Sampling. Also we moved retention policies in the same document. Could you give this another proofread please?

Advanced mode is an optional addon that can be added
docs/organization/dynamic-sampling/index.mdx Outdated Show resolved Hide resolved
docs/organization/dynamic-sampling/index.mdx Outdated Show resolved Hide resolved
Also moved warning for deactivation of advanced mode to its distinct paragraph.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants