istio.io/istio@v0.0.0-20240520182934-d79c90f27776/pkg/istio-agent/metrics/metrics.go (about) 1 // Copyright Istio Authors 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 package metrics 16 17 import ( 18 "istio.io/istio/pkg/monitoring" 19 ) 20 21 const ( 22 Cancel = "cancelled" 23 Error = "error" 24 ) 25 26 var ( 27 disconnectionTypeTag = monitoring.CreateLabel("type") 28 29 // IstiodConnectionFailures records total number of connection failures to Istiod. 30 IstiodConnectionFailures = monitoring.NewSum( 31 "istiod_connection_failures", 32 "The total number of connection failures to Istiod", 33 ) 34 35 // istiodDisconnections records total number of unexpected disconnections by Istiod. 36 istiodDisconnections = monitoring.NewSum( 37 "istiod_connection_terminations", 38 "The total number of connection errors to Istiod", 39 ) 40 41 // envoyDisconnections records total number of unexpected disconnections by Envoy. 42 envoyDisconnections = monitoring.NewSum( 43 "envoy_connection_terminations", 44 "The total number of connection errors from envoy", 45 ) 46 47 // TODO: Add type url as type for requeasts and responses if needed. 48 49 // XdsProxyRequests records total number of downstream requests. 50 XdsProxyRequests = monitoring.NewSum( 51 "xds_proxy_requests", 52 "The total number of Xds Proxy Requests", 53 ) 54 55 // XdsProxyResponses records total number of upstream responses. 56 XdsProxyResponses = monitoring.NewSum( 57 "xds_proxy_responses", 58 "The total number of Xds Proxy Responses", 59 ) 60 61 IstiodConnectionCancellations = istiodDisconnections.With(disconnectionTypeTag.Value(Cancel)) 62 IstiodConnectionErrors = istiodDisconnections.With(disconnectionTypeTag.Value(Error)) 63 EnvoyConnectionCancellations = envoyDisconnections.With(disconnectionTypeTag.Value(Cancel)) 64 EnvoyConnectionErrors = envoyDisconnections.With(disconnectionTypeTag.Value(Error)) 65 )