[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [pluggable-transports/snowflake] branch main updated: Record proxy type for proxy relay stats



This is an automated email from the git hooks/post-receive script.

shelikhoo pushed a commit to branch main
in repository pluggable-transports/snowflake.

The following commit(s) were added to refs/heads/main by this push:
     new 36f03df  Record proxy type for proxy relay stats
36f03df is described below

commit 36f03dfd4483922b3e7400dedc71df9cf2f30b6b
Author: Shelikhoo <xiaokangwang@xxxxxxxxxxx>
AuthorDate: Fri Sep 23 12:44:02 2022 +0100

    Record proxy type for proxy relay stats
---
 broker/ipc.go     | 6 +++---
 broker/metrics.go | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/broker/ipc.go b/broker/ipc.go
index 6b8971f..14db4d8 100644
--- a/broker/ipc.go
+++ b/broker/ipc.go
@@ -75,19 +75,19 @@ func (i *IPC) ProxyPolls(arg messages.Arg, response *[]byte) error {
 	if !relayPatternSupported {
 		i.ctx.metrics.lock.Lock()
 		i.ctx.metrics.proxyPollWithoutRelayURLExtension++
-		i.ctx.metrics.promMetrics.ProxyPollWithoutRelayURLExtensionTotal.With(prometheus.Labels{"nat": natType}).Inc()
+		i.ctx.metrics.promMetrics.ProxyPollWithoutRelayURLExtensionTotal.With(prometheus.Labels{"nat": natType, "type": proxyType}).Inc()
 		i.ctx.metrics.lock.Unlock()
 	} else {
 		i.ctx.metrics.lock.Lock()
 		i.ctx.metrics.proxyPollWithRelayURLExtension++
-		i.ctx.metrics.promMetrics.ProxyPollWithRelayURLExtensionTotal.With(prometheus.Labels{"nat": natType}).Inc()
+		i.ctx.metrics.promMetrics.ProxyPollWithRelayURLExtensionTotal.With(prometheus.Labels{"nat": natType, "type": proxyType}).Inc()
 		i.ctx.metrics.lock.Unlock()
 	}
 
 	if !i.ctx.CheckProxyRelayPattern(relayPattern, !relayPatternSupported) {
 		i.ctx.metrics.lock.Lock()
 		i.ctx.metrics.proxyPollRejectedWithRelayURLExtension++
-		i.ctx.metrics.promMetrics.ProxyPollRejectedForRelayURLExtensionTotal.With(prometheus.Labels{"nat": natType}).Inc()
+		i.ctx.metrics.promMetrics.ProxyPollRejectedForRelayURLExtensionTotal.With(prometheus.Labels{"nat": natType, "type": proxyType}).Inc()
 		i.ctx.metrics.lock.Unlock()
 
 		log.Printf("bad request: rejected relay pattern from proxy = %v", messages.ErrBadRequest)
diff --git a/broker/metrics.go b/broker/metrics.go
index cd1ca37..77b7675 100644
--- a/broker/metrics.go
+++ b/broker/metrics.go
@@ -286,7 +286,7 @@ func initPrometheus() *PromMetrics {
 			Name:      "rounded_proxy_poll_with_relay_url_extension_total",
 			Help:      "The number of snowflake proxy polls with Relay URL Extension, rounded up to a multiple of 8",
 		},
-		[]string{"nat"},
+		[]string{"nat", "type"},
 	)
 
 	promMetrics.ProxyPollWithoutRelayURLExtensionTotal = NewRoundedCounterVec(
@@ -295,7 +295,7 @@ func initPrometheus() *PromMetrics {
 			Name:      "rounded_proxy_poll_without_relay_url_extension_total",
 			Help:      "The number of snowflake proxy polls without Relay URL Extension, rounded up to a multiple of 8",
 		},
-		[]string{"nat"},
+		[]string{"nat", "type"},
 	)
 
 	promMetrics.ProxyPollRejectedForRelayURLExtensionTotal = NewRoundedCounterVec(
@@ -304,7 +304,7 @@ func initPrometheus() *PromMetrics {
 			Name:      "rounded_proxy_poll_rejected_relay_url_extension_total",
 			Help:      "The number of snowflake proxy polls rejected by Relay URL Extension, rounded up to a multiple of 8",
 		},
-		[]string{"nat"},
+		[]string{"nat", "type"},
 	)
 
 	promMetrics.ClientPollTotal = NewRoundedCounterVec(

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits