github.com/kiali/kiali@v1.84.0/business/metrics_definitions.go (about)

     1  package business
     2  
     3  type istioMetric struct {
     4  	kialiName      string
     5  	istioName      string
     6  	isHisto        bool
     7  	useErrorLabels bool
     8  }
     9  
    10  var istioMetrics = []istioMetric{
    11  	{
    12  		kialiName: "grpc_received",
    13  		istioName: "istio_response_messages_total",
    14  		isHisto:   false,
    15  	},
    16  	{
    17  		kialiName: "grpc_sent",
    18  		istioName: "istio_request_messages_total",
    19  		isHisto:   false,
    20  	},
    21  	{
    22  		kialiName: "request_count",
    23  		istioName: "istio_requests_total",
    24  		isHisto:   false,
    25  	},
    26  	{
    27  		kialiName:      "request_error_count",
    28  		istioName:      "istio_requests_total",
    29  		isHisto:        false,
    30  		useErrorLabels: true,
    31  	},
    32  	{
    33  		kialiName: "request_duration_millis",
    34  		istioName: "istio_request_duration_milliseconds",
    35  		isHisto:   true,
    36  	},
    37  	{
    38  		kialiName: "request_throughput",
    39  		istioName: "istio_request_bytes_sum",
    40  		isHisto:   false,
    41  	},
    42  	{
    43  		kialiName: "response_throughput",
    44  		istioName: "istio_response_bytes_sum",
    45  		isHisto:   false,
    46  	},
    47  	{
    48  		kialiName: "request_size",
    49  		istioName: "istio_request_bytes",
    50  		isHisto:   true,
    51  	},
    52  	{
    53  		kialiName: "response_size",
    54  		istioName: "istio_response_bytes",
    55  		isHisto:   true,
    56  	},
    57  	{
    58  		kialiName: "tcp_received",
    59  		istioName: "istio_tcp_sent_bytes_total", // L4 telemetry is backwards, see https://github.com/istio/istio/issues/32399
    60  		isHisto:   false,
    61  	},
    62  	{
    63  		kialiName: "tcp_sent",
    64  		istioName: "istio_tcp_received_bytes_total", // L4 telemetry is backwards, see https://github.com/istio/istio/issues/32399
    65  		isHisto:   false,
    66  	},
    67  	{
    68  		kialiName: "tcp_opened",
    69  		istioName: "istio_tcp_connections_opened_total",
    70  		isHisto:   false,
    71  	},
    72  	{
    73  		kialiName: "tcp_closed",
    74  		istioName: "istio_tcp_connections_closed_total",
    75  		isHisto:   false,
    76  	},
    77  }
    78  
    79  func (in *istioMetric) labelsToUse(labels string, labelsError []string) []string {
    80  	if in.useErrorLabels {
    81  		return labelsError
    82  	}
    83  	return []string{labels}
    84  }