Finding unused metrics in Coralogix

It’s really easy to install a few neat utilities onto your cluster and not-notice that they export a load of metrics by default. Istio is the one that comes up most-days for this, Cilium and Consul are also common.

When trying to optimise a Coralogix team, it’s useful to grab a list of every metric that is sent to the team, and compare this with the list of every metric that is used by the team (all alerts, dashboards, recording rules, SLOs).

Rather than doing this manually, I made coralogix-unused-metrics-finder

Whatever’s left over is unused and can be dropped at the collector; it writes out an OTel collector config snippet to do this. And it can have quite the effect:

You also get a PDF summary that you can use to understand the changes and make the case for them to whoever’s data you’re trying to drop.

It’s cautious: if it can’t tell whether a metric is used, it doesn’t call it unused; the test isn’t “drop anything I can’t find a use for” but “drop anything I can see is not-used”. The exception here is that it does not go over historic manual queries through the explore screen and the like.

The README has details about running it locally and there’s a webui on Cuban Yetis, but it’s worth noting that it can take a lot of memory to process a reasonable-sized team and my limits are set low!