Skip to content

Automated Dynamic Transaction Sampling Rate #11975

Closed
@jeengbe

Description

@jeengbe

Problem Statement

Setting good sampling rates is difficult, with many factors you need to consider. You have to balance ever-changing RPS, request distribution amongst different endpoints, daily/weekly trends. Working with a limited budget and doing the maths for getting the numbers quite right even more.

Nobody does that. And even if you do, those numbers become outdated by the time the change is deployed.

The only feasible solution is a fixed transaction rate, much higher than necessary for certain endpoints. Say, you have a 100:1 distribution between two endpoints. Either you send waaay too many transactions for the first endpoint, or the latter is not instrumented enough.

Solution Brainstorm

The SDK should sample transactions intelligently. Instead of a plump probability, you instead allocate a total transaction volume that is properly distributed across different endpoints (transactions with the same name) such that all endpoints are represented equally in what is finally ingested.

This solves all the outlined pain points with sampling rates at once.

You could also still respect real request ratios, but slightly adjust sampling rates, such that a request ratio of 100:1 results in a sampling rate of e.g. 10:1 instead of 100:1 if the same sampling rate were used for both endpoints.

Issues With the Proposed Solution

  • Real request ratios are no longer reflected in Sentry as the goal of this suggestion is to align sampling rates across endpoints. That's fine, we have metrics for such analytics.
  • Changes to request distribution amongst endpoints could lead to false-positive transaction number alerts if an increase in one endpoint results in a "balancing" decrease of ingested transactions for another endpoint.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions