metrics.go 622 B

12345678910111213141516171819202122232425262728
  1. package supervisor
  2. import (
  3. "github.com/prometheus/client_golang/prometheus"
  4. "github.com/cloudflare/cloudflared/connection"
  5. )
  6. // Metrics uses connection.MetricsNamespace(aka cloudflared) as namespace and connection.TunnelSubsystem
  7. // (tunnel) as subsystem to keep them consistent with the previous qualifier.
  8. var (
  9. haConnections = prometheus.NewGauge(
  10. prometheus.GaugeOpts{
  11. Namespace: connection.MetricsNamespace,
  12. Subsystem: connection.TunnelSubsystem,
  13. Name: "ha_connections",
  14. Help: "Number of active ha connections",
  15. },
  16. )
  17. )
  18. func init() {
  19. prometheus.MustRegister(
  20. haConnections,
  21. )
  22. }