mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 11:11:30 -04:00
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:
parent
d08efc34c3
commit
766988b77b
2 changed files with 3 additions and 3 deletions
|
@ -108,7 +108,7 @@ func (i *IPC) ProxyPolls(arg messages.Arg, response *[]byte) error {
|
||||||
|
|
||||||
if offer == nil {
|
if offer == nil {
|
||||||
i.ctx.metrics.IncrementCounter("proxy-idle")
|
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, "")
|
b, err = messages.EncodePollResponse("", false, "")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -119,7 +119,7 @@ func (i *IPC) ProxyPolls(arg messages.Arg, response *[]byte) error {
|
||||||
return nil
|
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
|
var relayURL string
|
||||||
bridgeFingerprint, err := bridgefingerprint.FingerprintFromBytes(offer.fingerprint)
|
bridgeFingerprint, err := bridgefingerprint.FingerprintFromBytes(offer.fingerprint)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -329,7 +329,7 @@ func initPrometheus() *PromMetrics {
|
||||||
Name: "rounded_proxy_poll_total",
|
Name: "rounded_proxy_poll_total",
|
||||||
Help: "The number of snowflake proxy polls, rounded up to a multiple of 8",
|
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(
|
promMetrics.ProxyAnswerTotal = safeprom.NewCounterVec(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue