appsembler / configuration

a simple, but flexible, way for anyone to stand up an instance of the edX platform that is fully configured and ready-to-go
GNU Affero General Public License v3.0
15 stars 13 forks source link

downsample /heartbeat requests #316

Closed thraxil closed 4 years ago

thraxil commented 4 years ago

the GCP load balancer health checker makes about 4 requests per second to /heartbeat. This ends up being a massive portion of the total events that we send to honeycomb (especially for staging), and are using up most of our quota. They're mostly "boring" though. The requests are all exactly the same and don't contribute much to analysis that we might want to do.

For situations like this, Honeycomb lets you sample events at the origin. This adds custom sampler logic that lets us just drop 99% of the "boring" heartbeat requests, while keeping everything else (including any heartbeat requests that have a non-200 response).

This is based on sample code from here: https://docs.honeycomb.io/getting-data-in/python/beeline/#sampling-events

If we end up adding more complicated sampling logic, we'll probably want to pull the sample rate, etc out into ansible variables. For now, I think it's fine to just hard-code them in there.