add argotunnel_ prefix to metric names
This commit is contained in:
		
							parent
							
								
									4268bc1a9c
								
							
						
					
					
						commit
						e4a68da7c2
					
				| 
						 | 
				
			
			@ -54,7 +54,7 @@ type TunnelMetrics struct {
 | 
			
		|||
func newMuxerMetrics() *muxerMetrics {
 | 
			
		||||
	rtt := prometheus.NewGaugeVec(
 | 
			
		||||
		prometheus.GaugeOpts{
 | 
			
		||||
			Name: "rtt",
 | 
			
		||||
			Name: "argotunnel_rtt",
 | 
			
		||||
			Help: "Round-trip time in millisecond",
 | 
			
		||||
		},
 | 
			
		||||
		[]string{"connection_id"},
 | 
			
		||||
| 
						 | 
				
			
			@ -63,7 +63,7 @@ func newMuxerMetrics() *muxerMetrics {
 | 
			
		|||
 | 
			
		||||
	rttMin := prometheus.NewGaugeVec(
 | 
			
		||||
		prometheus.GaugeOpts{
 | 
			
		||||
			Name: "rtt_min",
 | 
			
		||||
			Name: "argotunnel_rtt_min",
 | 
			
		||||
			Help: "Shortest round-trip time in millisecond",
 | 
			
		||||
		},
 | 
			
		||||
		[]string{"connection_id"},
 | 
			
		||||
| 
						 | 
				
			
			@ -72,7 +72,7 @@ func newMuxerMetrics() *muxerMetrics {
 | 
			
		|||
 | 
			
		||||
	rttMax := prometheus.NewGaugeVec(
 | 
			
		||||
		prometheus.GaugeOpts{
 | 
			
		||||
			Name: "rtt_max",
 | 
			
		||||
			Name: "argotunnel_rtt_max",
 | 
			
		||||
			Help: "Longest round-trip time in millisecond",
 | 
			
		||||
		},
 | 
			
		||||
		[]string{"connection_id"},
 | 
			
		||||
| 
						 | 
				
			
			@ -81,7 +81,7 @@ func newMuxerMetrics() *muxerMetrics {
 | 
			
		|||
 | 
			
		||||
	receiveWindowAve := prometheus.NewGaugeVec(
 | 
			
		||||
		prometheus.GaugeOpts{
 | 
			
		||||
			Name: "receive_window_ave",
 | 
			
		||||
			Name: "argotunnel_receive_window_ave",
 | 
			
		||||
			Help: "Average receive window size in bytes",
 | 
			
		||||
		},
 | 
			
		||||
		[]string{"connection_id"},
 | 
			
		||||
| 
						 | 
				
			
			@ -90,7 +90,7 @@ func newMuxerMetrics() *muxerMetrics {
 | 
			
		|||
 | 
			
		||||
	sendWindowAve := prometheus.NewGaugeVec(
 | 
			
		||||
		prometheus.GaugeOpts{
 | 
			
		||||
			Name: "send_window_ave",
 | 
			
		||||
			Name: "argotunnel_send_window_ave",
 | 
			
		||||
			Help: "Average send window size in bytes",
 | 
			
		||||
		},
 | 
			
		||||
		[]string{"connection_id"},
 | 
			
		||||
| 
						 | 
				
			
			@ -99,7 +99,7 @@ func newMuxerMetrics() *muxerMetrics {
 | 
			
		|||
 | 
			
		||||
	receiveWindowMin := prometheus.NewGaugeVec(
 | 
			
		||||
		prometheus.GaugeOpts{
 | 
			
		||||
			Name: "receive_window_min",
 | 
			
		||||
			Name: "argotunnel_receive_window_min",
 | 
			
		||||
			Help: "Smallest receive window size in bytes",
 | 
			
		||||
		},
 | 
			
		||||
		[]string{"connection_id"},
 | 
			
		||||
| 
						 | 
				
			
			@ -108,7 +108,7 @@ func newMuxerMetrics() *muxerMetrics {
 | 
			
		|||
 | 
			
		||||
	receiveWindowMax := prometheus.NewGaugeVec(
 | 
			
		||||
		prometheus.GaugeOpts{
 | 
			
		||||
			Name: "receive_window_max",
 | 
			
		||||
			Name: "argotunnel_receive_window_max",
 | 
			
		||||
			Help: "Largest receive window size in bytes",
 | 
			
		||||
		},
 | 
			
		||||
		[]string{"connection_id"},
 | 
			
		||||
| 
						 | 
				
			
			@ -117,7 +117,7 @@ func newMuxerMetrics() *muxerMetrics {
 | 
			
		|||
 | 
			
		||||
	sendWindowMin := prometheus.NewGaugeVec(
 | 
			
		||||
		prometheus.GaugeOpts{
 | 
			
		||||
			Name: "send_window_min",
 | 
			
		||||
			Name: "argotunnel_send_window_min",
 | 
			
		||||
			Help: "Smallest send window size in bytes",
 | 
			
		||||
		},
 | 
			
		||||
		[]string{"connection_id"},
 | 
			
		||||
| 
						 | 
				
			
			@ -126,7 +126,7 @@ func newMuxerMetrics() *muxerMetrics {
 | 
			
		|||
 | 
			
		||||
	sendWindowMax := prometheus.NewGaugeVec(
 | 
			
		||||
		prometheus.GaugeOpts{
 | 
			
		||||
			Name: "send_window_max",
 | 
			
		||||
			Name: "argotunnel_send_window_max",
 | 
			
		||||
			Help: "Largest send window size in bytes",
 | 
			
		||||
		},
 | 
			
		||||
		[]string{"connection_id"},
 | 
			
		||||
| 
						 | 
				
			
			@ -135,7 +135,7 @@ func newMuxerMetrics() *muxerMetrics {
 | 
			
		|||
 | 
			
		||||
	inBoundRateCurr := prometheus.NewGaugeVec(
 | 
			
		||||
		prometheus.GaugeOpts{
 | 
			
		||||
			Name: "inbound_bytes_per_sec_curr",
 | 
			
		||||
			Name: "argotunnel_inbound_bytes_per_sec_curr",
 | 
			
		||||
			Help: "Current inbounding bytes per second, 0 if there is no incoming connection",
 | 
			
		||||
		},
 | 
			
		||||
		[]string{"connection_id"},
 | 
			
		||||
| 
						 | 
				
			
			@ -144,7 +144,7 @@ func newMuxerMetrics() *muxerMetrics {
 | 
			
		|||
 | 
			
		||||
	inBoundRateMin := prometheus.NewGaugeVec(
 | 
			
		||||
		prometheus.GaugeOpts{
 | 
			
		||||
			Name: "inbound_bytes_per_sec_min",
 | 
			
		||||
			Name: "argotunnel_inbound_bytes_per_sec_min",
 | 
			
		||||
			Help: "Minimum non-zero inbounding bytes per second",
 | 
			
		||||
		},
 | 
			
		||||
		[]string{"connection_id"},
 | 
			
		||||
| 
						 | 
				
			
			@ -153,7 +153,7 @@ func newMuxerMetrics() *muxerMetrics {
 | 
			
		|||
 | 
			
		||||
	inBoundRateMax := prometheus.NewGaugeVec(
 | 
			
		||||
		prometheus.GaugeOpts{
 | 
			
		||||
			Name: "inbound_bytes_per_sec_max",
 | 
			
		||||
			Name: "argotunnel_inbound_bytes_per_sec_max",
 | 
			
		||||
			Help: "Maximum inbounding bytes per second",
 | 
			
		||||
		},
 | 
			
		||||
		[]string{"connection_id"},
 | 
			
		||||
| 
						 | 
				
			
			@ -162,7 +162,7 @@ func newMuxerMetrics() *muxerMetrics {
 | 
			
		|||
 | 
			
		||||
	outBoundRateCurr := prometheus.NewGaugeVec(
 | 
			
		||||
		prometheus.GaugeOpts{
 | 
			
		||||
			Name: "outbound_bytes_per_sec_curr",
 | 
			
		||||
			Name: "argotunnel_outbound_bytes_per_sec_curr",
 | 
			
		||||
			Help: "Current outbounding bytes per second, 0 if there is no outgoing traffic",
 | 
			
		||||
		},
 | 
			
		||||
		[]string{"connection_id"},
 | 
			
		||||
| 
						 | 
				
			
			@ -171,7 +171,7 @@ func newMuxerMetrics() *muxerMetrics {
 | 
			
		|||
 | 
			
		||||
	outBoundRateMin := prometheus.NewGaugeVec(
 | 
			
		||||
		prometheus.GaugeOpts{
 | 
			
		||||
			Name: "outbound_bytes_per_sec_min",
 | 
			
		||||
			Name: "argotunnel_outbound_bytes_per_sec_min",
 | 
			
		||||
			Help: "Minimum non-zero outbounding bytes per second",
 | 
			
		||||
		},
 | 
			
		||||
		[]string{"connection_id"},
 | 
			
		||||
| 
						 | 
				
			
			@ -180,7 +180,7 @@ func newMuxerMetrics() *muxerMetrics {
 | 
			
		|||
 | 
			
		||||
	outBoundRateMax := prometheus.NewGaugeVec(
 | 
			
		||||
		prometheus.GaugeOpts{
 | 
			
		||||
			Name: "outbound_bytes_per_sec_max",
 | 
			
		||||
			Name: "argotunnel_outbound_bytes_per_sec_max",
 | 
			
		||||
			Help: "Maximum outbounding bytes per second",
 | 
			
		||||
		},
 | 
			
		||||
		[]string{"connection_id"},
 | 
			
		||||
| 
						 | 
				
			
			@ -232,21 +232,21 @@ func convertRTTMilliSec(t time.Duration) float64 {
 | 
			
		|||
func NewTunnelMetrics() *TunnelMetrics {
 | 
			
		||||
	haConnections := prometheus.NewGauge(
 | 
			
		||||
		prometheus.GaugeOpts{
 | 
			
		||||
			Name: "ha_connections",
 | 
			
		||||
			Name: "argotunnel_ha_connections",
 | 
			
		||||
			Help: "Number of active ha connections",
 | 
			
		||||
		})
 | 
			
		||||
	prometheus.MustRegister(haConnections)
 | 
			
		||||
 | 
			
		||||
	totalRequests := prometheus.NewCounter(
 | 
			
		||||
		prometheus.CounterOpts{
 | 
			
		||||
			Name: "total_requests",
 | 
			
		||||
			Name: "argotunnel_total_requests",
 | 
			
		||||
			Help: "Amount of requests proxied through all the tunnels",
 | 
			
		||||
		})
 | 
			
		||||
	prometheus.MustRegister(totalRequests)
 | 
			
		||||
 | 
			
		||||
	requestsPerTunnel := prometheus.NewCounterVec(
 | 
			
		||||
		prometheus.CounterOpts{
 | 
			
		||||
			Name: "requests_per_tunnel",
 | 
			
		||||
			Name: "argotunnel_requests_per_tunnel",
 | 
			
		||||
			Help: "Amount of requests proxied through each tunnel",
 | 
			
		||||
		},
 | 
			
		||||
		[]string{"connection_id"},
 | 
			
		||||
| 
						 | 
				
			
			@ -255,7 +255,7 @@ func NewTunnelMetrics() *TunnelMetrics {
 | 
			
		|||
 | 
			
		||||
	concurrentRequestsPerTunnel := prometheus.NewGaugeVec(
 | 
			
		||||
		prometheus.GaugeOpts{
 | 
			
		||||
			Name: "concurrent_requests_per_tunnel",
 | 
			
		||||
			Name: "argotunnel_concurrent_requests_per_tunnel",
 | 
			
		||||
			Help: "Concurrent requests proxied through each tunnel",
 | 
			
		||||
		},
 | 
			
		||||
		[]string{"connection_id"},
 | 
			
		||||
| 
						 | 
				
			
			@ -264,7 +264,7 @@ func NewTunnelMetrics() *TunnelMetrics {
 | 
			
		|||
 | 
			
		||||
	maxConcurrentRequestsPerTunnel := prometheus.NewGaugeVec(
 | 
			
		||||
		prometheus.GaugeOpts{
 | 
			
		||||
			Name: "max_concurrent_requests_per_tunnel",
 | 
			
		||||
			Name: "argotunnel_max_concurrent_requests_per_tunnel",
 | 
			
		||||
			Help: "Largest number of concurrent requests proxied through each tunnel so far",
 | 
			
		||||
		},
 | 
			
		||||
		[]string{"connection_id"},
 | 
			
		||||
| 
						 | 
				
			
			@ -273,14 +273,14 @@ func NewTunnelMetrics() *TunnelMetrics {
 | 
			
		|||
 | 
			
		||||
	timerRetries := prometheus.NewGauge(
 | 
			
		||||
		prometheus.GaugeOpts{
 | 
			
		||||
			Name: "timer_retries",
 | 
			
		||||
			Name: "argotunnel_timer_retries",
 | 
			
		||||
			Help: "Unacknowledged heart beats count",
 | 
			
		||||
		})
 | 
			
		||||
	prometheus.MustRegister(timerRetries)
 | 
			
		||||
 | 
			
		||||
	responseByCode := prometheus.NewCounterVec(
 | 
			
		||||
		prometheus.CounterOpts{
 | 
			
		||||
			Name: "response_by_code",
 | 
			
		||||
			Name: "argotunnel_response_by_code",
 | 
			
		||||
			Help: "Count of responses by HTTP status code",
 | 
			
		||||
		},
 | 
			
		||||
		[]string{"status_code"},
 | 
			
		||||
| 
						 | 
				
			
			@ -289,7 +289,7 @@ func NewTunnelMetrics() *TunnelMetrics {
 | 
			
		|||
 | 
			
		||||
	responseCodePerTunnel := prometheus.NewCounterVec(
 | 
			
		||||
		prometheus.CounterOpts{
 | 
			
		||||
			Name: "response_code_per_tunnel",
 | 
			
		||||
			Name: "argotunnel_response_code_per_tunnel",
 | 
			
		||||
			Help: "Count of responses by HTTP status code fore each tunnel",
 | 
			
		||||
		},
 | 
			
		||||
		[]string{"connection_id", "status_code"},
 | 
			
		||||
| 
						 | 
				
			
			@ -298,7 +298,7 @@ func NewTunnelMetrics() *TunnelMetrics {
 | 
			
		|||
 | 
			
		||||
	serverLocations := prometheus.NewGaugeVec(
 | 
			
		||||
		prometheus.GaugeOpts{
 | 
			
		||||
			Name: "server_locations",
 | 
			
		||||
			Name: "argotunnel_server_locations",
 | 
			
		||||
			Help: "Where each tunnel is connected to. 1 means current location, 0 means previous locations.",
 | 
			
		||||
		},
 | 
			
		||||
		[]string{"connection_id", "location"},
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue