Open jjbayer opened 2 weeks ago
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))
.
I may be missing something though.
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.