forked from kiali/kiali
-
Notifications
You must be signed in to change notification settings - Fork 0
/
metrics_definitions.go
54 lines (51 loc) · 1.08 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
package prometheus
type istioMetric struct {
kialiName string
istioName string
isHisto bool
useErrorLabels bool
}
var istioMetrics = []istioMetric{
istioMetric{
kialiName: "request_count",
istioName: "istio_requests_total",
isHisto: false,
},
istioMetric{
kialiName: "request_error_count",
istioName: "istio_requests_total",
isHisto: false,
useErrorLabels: true,
},
istioMetric{
kialiName: "request_duration",
istioName: "istio_request_duration_seconds",
isHisto: true,
},
istioMetric{
kialiName: "request_size",
istioName: "istio_request_bytes",
isHisto: true,
},
istioMetric{
kialiName: "response_size",
istioName: "istio_response_bytes",
isHisto: true,
},
istioMetric{
kialiName: "tcp_received",
istioName: "istio_tcp_received_bytes_total",
isHisto: false,
},
istioMetric{
kialiName: "tcp_sent",
istioName: "istio_tcp_sent_bytes_total",
isHisto: false,
},
}
func (in *istioMetric) labelsToUse(labels, labelsError string) string {
if in.useErrorLabels {
return labelsError
}
return labels
}