istio.io/istio@v0.0.0-20240520182934-d79c90f27776/security/pkg/nodeagent/cache/monitoring.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 cache
    16  
    17  import (
    18  	"istio.io/istio/pkg/monitoring"
    19  )
    20  
    21  var (
    22  	RequestType  = monitoring.CreateLabel("request_type")
    23  	ResourceName = monitoring.CreateLabel("resource_name")
    24  )
    25  
    26  // Metrics for outgoing requests from citadel agent to external services such as token exchange server or a CA.
    27  // This is different from incoming request metrics (i.e. from Envoy to citadel agent).
    28  var (
    29  	outgoingLatency = monitoring.NewSum(
    30  		"outgoing_latency",
    31  		"The latency of outgoing requests (e.g. to a token exchange server, CA, etc.) in milliseconds.",
    32  	)
    33  
    34  	numOutgoingRequests = monitoring.NewSum(
    35  		"num_outgoing_requests",
    36  		"Number of total outgoing requests (e.g. to a token exchange server, CA, etc.)",
    37  	)
    38  
    39  	numFailedOutgoingRequests = monitoring.NewSum(
    40  		"num_failed_outgoing_requests",
    41  		"Number of failed outgoing requests (e.g. to a token exchange server, CA, etc.)",
    42  	)
    43  
    44  	numFileWatcherFailures = monitoring.NewSum(
    45  		"num_file_watcher_failures_total",
    46  		"Number of times file watcher failed to add watchers")
    47  
    48  	numFileSecretFailures = monitoring.NewSum(
    49  		"num_file_secret_failures_total",
    50  		"Number of times secret generation failed for files",
    51  	)
    52  
    53  	certExpirySeconds = monitoring.NewDerivedGauge(
    54  		"cert_expiry_seconds",
    55  		"The time remaining, in seconds, before the certificate chain will expire. "+
    56  			"A negative value indicates the cert is expired.",
    57  	)
    58  )