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