-
Notifications
You must be signed in to change notification settings - Fork 732
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TUN-8441: Correct UDP total sessions metric to a counter and add new …
…ICMP metrics cloudflared_udp_total_sessions was incorrectly a gauge when it represents the total since the cloudflared process started and will only ever increase. Additionally adds new ICMP metrics for requests and replies.
- Loading branch information
Showing
3 changed files
with
42 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package ingress | ||
|
||
import ( | ||
"github.com/prometheus/client_golang/prometheus" | ||
) | ||
|
||
const ( | ||
namespace = "cloudflared" | ||
) | ||
|
||
var ( | ||
icmpRequests = prometheus.NewCounter(prometheus.CounterOpts{ | ||
Namespace: namespace, | ||
Subsystem: "icmp", | ||
Name: "total_requests", | ||
Help: "Total count of ICMP requests that have been proxied to any origin", | ||
}) | ||
icmpReplies = prometheus.NewCounter(prometheus.CounterOpts{ | ||
Namespace: namespace, | ||
Subsystem: "icmp", | ||
Name: "total_replies", | ||
Help: "Total count of ICMP replies that have been proxied from any origin", | ||
}) | ||
) | ||
|
||
func init() { | ||
prometheus.MustRegister( | ||
icmpRequests, | ||
icmpReplies, | ||
) | ||
} | ||
|
||
func incrementICMPRequest() { | ||
icmpRequests.Inc() | ||
} | ||
|
||
func incrementICMPReply() { | ||
icmpReplies.Inc() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters