-
Notifications
You must be signed in to change notification settings - Fork 474
/
metrics_definitions.go
69 lines (66 loc) · 1.34 KB
/
metrics_definitions.go
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
package prometheus
type istioMetric struct {
kialiName string
istioName string
isHisto bool
useErrorLabels bool
}
var istioMetrics = []istioMetric{
{
kialiName: "request_count",
istioName: "istio_requests_total",
isHisto: false,
},
{
kialiName: "request_error_count",
istioName: "istio_requests_total",
isHisto: false,
useErrorLabels: true,
},
{
kialiName: "request_duration",
istioName: "istio_request_duration_seconds",
isHisto: true,
},
{
kialiName: "request_duration_millis",
istioName: "istio_request_duration_milliseconds",
isHisto: true,
},
{
kialiName: "request_throughput",
istioName: "istio_request_bytes_sum",
isHisto: false,
},
{
kialiName: "response_throughput",
istioName: "istio_response_bytes_sum",
isHisto: false,
},
{
kialiName: "request_size",
istioName: "istio_request_bytes",
isHisto: true,
},
{
kialiName: "response_size",
istioName: "istio_response_bytes",
isHisto: true,
},
{
kialiName: "tcp_received",
istioName: "istio_tcp_received_bytes_total",
isHisto: false,
},
{
kialiName: "tcp_sent",
istioName: "istio_tcp_sent_bytes_total",
isHisto: false,
},
}
func (in *istioMetric) labelsToUse(labels string, labelsError []string) []string {
if in.useErrorLabels {
return labelsError
}
return []string{labels}
}