TUN-7477: Add UDP/TCP session metrics

New gauge metrics are exposed in the prometheus endpoint to
capture the current and total TCP and UDP sessions that
cloudflared has proxied.
This commit is contained in:
Devin Carr
2023-06-16 17:07:56 -07:00
parent 20e36c5bf3
commit a3bcf25fae
4 changed files with 73 additions and 2 deletions

View File

@@ -158,8 +158,8 @@ func (p *Proxy) ProxyTCP(
rwa connection.ReadWriteAcker,
req *connection.TCPRequest,
) error {
incrementRequests()
defer decrementConcurrentRequests()
incrementTCPRequests()
defer decrementTCPConcurrentRequests()
if p.warpRouting == nil {
err := errors.New(`cloudflared received a request from WARP client, but your configuration has disabled ingress from WARP clients. To enable this, set "warp-routing:\n\t enabled: true" in your config.yaml`)