You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SDKS apply a client-side sampling rate to transactions / spans, so any metrics we extract from them are inherently sampled, even with server-side sampling disabled. To represent the sampling rate, take the client-side sampling rate from the envelope header and add it as a weight to any metric bucket extracted from the transaction / span payload (weight := 1.0 / dsc.sample_rate). When merging two buckets, add their weights together.
Ideally, storage supports these weights as well. If / as long as storage does not support weights, we could convert weights into repeated data in Relay.
Counters: Counters are floats, so simply multiply the weight by the counter value when merging.
Gauges: Similar to Counters.
Distributions: need to repeat entries to simulate the weight. Doing this in (or right before) the Kafka producer would minimize rounding errors.
Sets: Questionable if we can extrapolate in a mathematically sound way. Simplest approach would be to ignore weights. Literature:
I am not an expert but given two buckets b1 and b2 with weights w1 and w2, if you sum w1 + w2 during merge you will not get the equivalent extrapolation as if you were to compute it correctly as as 1.0 / ((b1 * w1) + (b2 * w2) / (b1 + b2)).
SDKS apply a client-side sampling rate to transactions / spans, so any metrics we extract from them are inherently sampled, even with server-side sampling disabled. To represent the sampling rate, take the client-side sampling rate from the envelope header and add it as a weight to any metric bucket extracted from the transaction / span payload (
weight := 1.0 / dsc.sample_rate
). When merging two buckets, add their weights together.Tech Spec
https://www.notion.so/sentry/Metrics-Extrapolation-520ab136cb7d48ebb77be9a538bdef91
Open question: data duplication
Ideally, storage supports these weights as well. If / as long as storage does not support weights, we could convert weights into repeated data in Relay.
Preparation
Custom Span Attributes
Internal Test: Spans and Transactions
Public: Spans and Transactions
The text was updated successfully, but these errors were encountered: