File: gauges.go

package info (click to toggle)
prometheus-mysqlrouter-exporter 6.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 520 kB
  • sloc: sh: 54; makefile: 32
file content (100 lines) | stat: -rw-r--r-- 4,451 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
package main

import (
	"github.com/prometheus/client_golang/prometheus"
	"github.com/prometheus/client_golang/prometheus/promauto"
)

var (
	routerUpGauge = promauto.NewGauge(prometheus.GaugeOpts{
		Namespace: nameSpace,
		Name:      "router_up",
		Help:      "Tells whether MySQL Router is up",
	})
	routerStatusGauge = promauto.NewGaugeVec(prometheus.GaugeOpts{
		Namespace: nameSpace,
		Name:      "router_status",
		Help:      "MySQL Router information",
	}, []string{"process_id", "product_edition", "time_started", "version", "hostname", "service"})

	metadataGauge = promauto.NewGaugeVec(prometheus.GaugeOpts{
		Namespace: nameSpace,
		Name:      "metadata",
		Help:      "metadata list",
	}, []string{"name"})
	metadataConfigGauge = promauto.NewGaugeVec(prometheus.GaugeOpts{
		Namespace: nameSpace,
		Name:      "metadata_config",
		Help:      "metadata config",
	}, []string{"name", "cluster_name", "time_refresh_in_ms", "group_replication_id"})
	metadataConfigNodesGauge = promauto.NewGaugeVec(prometheus.GaugeOpts{
		Namespace: nameSpace,
		Name:      "metadata_config_nodes",
		Help:      "count of metadata config node",
	}, []string{"name", "router_host", "cluster_name"})
	metadataStatusGauge = promauto.NewGaugeVec(prometheus.GaugeOpts{
		Namespace: nameSpace,
		Name:      "metadata_status",
		Help:      "metadata status",
	}, []string{"name", "refresh_failed", "time_last_refresh_succeeded", "last_refresh_hostname", "last_refresh_port"})
	routeGauge = promauto.NewGaugeVec(prometheus.GaugeOpts{
		Namespace: nameSpace,
		Name:      "route",
		Help:      "route name",
	}, []string{"name"})
	routeActiveConnectionsGauge = promauto.NewGaugeVec(prometheus.GaugeOpts{
		Namespace: nameSpace,
		Name:      "route_active_connections",
		Help:      "route active connections",
	}, []string{"name", "router_hostname"})
	routeTotalConnectionsGauge = promauto.NewGaugeVec(prometheus.GaugeOpts{
		Namespace: nameSpace,
		Name:      "route_total_connections",
		Help:      "route total connections",
	}, []string{"name", "router_hostname"})
	routeBlockedHostsGauge = promauto.NewGaugeVec(prometheus.GaugeOpts{
		Namespace: nameSpace,
		Name:      "route_blocked_hosts",
		Help:      "route blocked_hosts",
	}, []string{"name", "router_hostname"})
	routeHealthGauge = promauto.NewGaugeVec(prometheus.GaugeOpts{
		Namespace: nameSpace,
		Name:      "route_health",
		Help:      "0: not active, 1: active",
	}, []string{"name", "router_hostname"})
	routeDestinationsGauge = promauto.NewGaugeVec(prometheus.GaugeOpts{
		Namespace: nameSpace,
		Name:      "route_destinations",
		Help:      "",
	}, []string{"name", "address", "port"})
	routeConnectionsByteFromServerGauge = promauto.NewGaugeVec(prometheus.GaugeOpts{
		Namespace: nameSpace,
		Name:      "route_connections_byte_from_server",
		Help:      "Route connections byte from server",
	}, []string{"name", "router_hostname", "source_address", "destination_address"})
	routeConnectionsByteToServerGauge = promauto.NewGaugeVec(prometheus.GaugeOpts{
		Namespace: nameSpace,
		Name:      "route_connections_byte_to_server",
		Help:      "Route connections byte to server",
	}, []string{"name", "router_hostname", "source_address", "destination_address"})
	routeConnectionsTimeStartedGauge = promauto.NewGaugeVec(prometheus.GaugeOpts{
		Namespace: nameSpace,
		Name:      "route_connections_time_started",
		Help:      "Route connections time started",
	}, []string{"name", "router_hostname", "source_address", "destination_address"})
	routeConnectionsTimeConnectedToServerGauge = promauto.NewGaugeVec(prometheus.GaugeOpts{
		Namespace: nameSpace,
		Name:      "route_connections_time_connected_to_server",
		Help:      "Route connections time connected to server",
	}, []string{"name", "router_hostname", "source_address", "destination_address"})
	routeConnectionsTimeLastSentToServerGauge = promauto.NewGaugeVec(prometheus.GaugeOpts{
		Namespace: nameSpace,
		Name:      "route_connections_time_last_sent_to_server",
		Help:      "Route connections time last sent to server",
	}, []string{"name", "router_hostname", "source_address", "destination_address"})
	routeConnectionsTimeLastReceivedFromServerGauge = promauto.NewGaugeVec(prometheus.GaugeOpts{
		Namespace: nameSpace,
		Name:      "route_connections_time_last_received_from_server",
		Help:      "Route connections time last received from server",
	}, []string{"name", "router_hostname", "source_address", "destination_address"})
)