mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Record proxy type for proxy relay stats
This commit is contained in:
parent
03b2b56f87
commit
36f03dfd44
2 changed files with 6 additions and 6 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue