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

[tor-commits] [pluggable-transports/snowflake] 21/31: Add Proxy Relay URL Rejection Metrics



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

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

commit b78eb74e42e58827ac579e05049f4d9f5cd6f23a
Author: Shelikhoo <xiaokangwang@xxxxxxxxxxx>
AuthorDate: Mon May 2 16:13:43 2022 +0100

    Add Proxy Relay URL Rejection Metrics
---
 broker/metrics.go | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/broker/metrics.go b/broker/metrics.go
index fbf3452..d9f8123 100644
--- a/broker/metrics.go
+++ b/broker/metrics.go
@@ -49,8 +49,9 @@ type Metrics struct {
 	clientUnrestrictedDeniedCount uint
 	clientProxyMatchCount         uint
 
-	proxyPollWithRelayURLExtension    uint
-	proxyPollWithoutRelayURLExtension uint
+	proxyPollWithRelayURLExtension         uint
+	proxyPollWithoutRelayURLExtension      uint
+	proxyPollRejectedWithRelayURLExtension uint
 
 	// synchronization for access to snowflake metrics
 	lock sync.Mutex
@@ -194,6 +195,7 @@ func (m *Metrics) printMetrics() {
 	m.logger.Println("snowflake-idle-count", binCount(m.proxyIdleCount))
 	m.logger.Println("snowflake-proxy-poll-with-relay-url-count", binCount(m.proxyPollWithRelayURLExtension))
 	m.logger.Println("snowflake-proxy-poll-without-relay-url-count", binCount(m.proxyPollWithoutRelayURLExtension))
+	m.logger.Println("snowflake-proxy-rejected-for-relay-url-count", binCount(m.proxyPollRejectedWithRelayURLExtension))
 	m.logger.Println("client-denied-count", binCount(m.clientDeniedCount))
 	m.logger.Println("client-restricted-denied-count", binCount(m.clientRestrictedDeniedCount))
 	m.logger.Println("client-unrestricted-denied-count", binCount(m.clientUnrestrictedDeniedCount))
@@ -235,6 +237,8 @@ type PromMetrics struct {
 
 	ProxyPollWithRelayURLExtensionTotal    *RoundedCounterVec
 	ProxyPollWithoutRelayURLExtensionTotal *RoundedCounterVec
+
+	ProxyPollRejectedForRelayURLExtensionTotal *RoundedCounterVec
 }
 
 // Initialize metrics for prometheus exporter
@@ -276,7 +280,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", "status"},
+		[]string{"nat"},
 	)
 
 	promMetrics.ProxyPollWithoutRelayURLExtensionTotal = NewRoundedCounterVec(
@@ -285,7 +289,16 @@ 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", "status"},
+		[]string{"nat"},
+	)
+
+	promMetrics.ProxyPollRejectedForRelayURLExtensionTotal = NewRoundedCounterVec(
+		prometheus.CounterOpts{
+			Namespace: prometheusNamespace,
+			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"},
 	)
 
 	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