Add proxy type label to ProxyPollTotal metric

Annotate ProxyPollTotal prometheus metrics with the proxy type so that
we can track counts of proxies that are matched and that answer by
implementation. This will help us catch bugs by implementation or
deployment.
This commit is contained in:
Cecylia Bocovich 2025-09-09 18:18:42 -04:00
parent d08efc34c3
commit 766988b77b
No known key found for this signature in database
GPG key ID: 009DE379FD9B7B90
2 changed files with 3 additions and 3 deletions

View file

@ -108,7 +108,7 @@ func (i *IPC) ProxyPolls(arg messages.Arg, response *[]byte) error {
if offer == nil {
i.ctx.metrics.IncrementCounter("proxy-idle")
i.ctx.metrics.promMetrics.ProxyPollTotal.With(prometheus.Labels{"nat": natType, "status": "idle"}).Inc()
i.ctx.metrics.promMetrics.ProxyPollTotal.With(prometheus.Labels{"nat": natType, "type": proxyType, "status": "idle"}).Inc()
b, err = messages.EncodePollResponse("", false, "")
if err != nil {
@ -119,7 +119,7 @@ func (i *IPC) ProxyPolls(arg messages.Arg, response *[]byte) error {
return nil
}
i.ctx.metrics.promMetrics.ProxyPollTotal.With(prometheus.Labels{"nat": natType, "status": "matched"}).Inc()
i.ctx.metrics.promMetrics.ProxyPollTotal.With(prometheus.Labels{"nat": natType, "type": proxyType, "status": "matched"}).Inc()
var relayURL string
bridgeFingerprint, err := bridgefingerprint.FingerprintFromBytes(offer.fingerprint)
if err != nil {

View file

@ -329,7 +329,7 @@ func initPrometheus() *PromMetrics {
Name: "rounded_proxy_poll_total",
Help: "The number of snowflake proxy polls, rounded up to a multiple of 8",
},
[]string{"nat", "status"},
[]string{"nat", "type", "status"},
)
promMetrics.ProxyAnswerTotal = safeprom.NewCounterVec(