Skip to content

Prometheus snowflake_proxy_total stats show polls, not proxy IPs

There was a small regression in the exported prometheus metrics in the deployment of !574 (merged)

The snowflake_proxy_total metrics should be unique proxy IPs, not proxy polls as they currently are:

    promMetrics.ProxyTotal = prometheus.NewCounterVec(
        prometheus.CounterOpts{
            Namespace: prometheusNamespace,
            Name:      "proxy_total",
            Help:      "The number of unique snowflake IPs",
        },
        []string{"type", "nat", "cc"},
    )    

The problem is in how the counter is incremented. This increment happens outside of our check on whether we've seen this IP before.

It's a pretty easy fix, just move the increment into this code block.