...

Source file src/sigs.k8s.io/controller-runtime/pkg/certwatcher/metrics/metrics.go

Documentation: sigs.k8s.io/controller-runtime/pkg/certwatcher/metrics

     1  /*
     2  Copyright 2022 The Kubernetes Authors.
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8      http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  
    17  package metrics
    18  
    19  import (
    20  	"github.com/prometheus/client_golang/prometheus"
    21  	"sigs.k8s.io/controller-runtime/pkg/metrics"
    22  )
    23  
    24  var (
    25  	// ReadCertificateTotal is a prometheus counter metrics which holds the total
    26  	// number of certificate reads.
    27  	ReadCertificateTotal = prometheus.NewCounter(prometheus.CounterOpts{
    28  		Name: "certwatcher_read_certificate_total",
    29  		Help: "Total number of certificate reads",
    30  	})
    31  
    32  	// ReadCertificateErrors is a prometheus counter metrics which holds the total
    33  	// number of errors from certificate read.
    34  	ReadCertificateErrors = prometheus.NewCounter(prometheus.CounterOpts{
    35  		Name: "certwatcher_read_certificate_errors_total",
    36  		Help: "Total number of certificate read errors",
    37  	})
    38  )
    39  
    40  func init() {
    41  	metrics.Registry.MustRegister(
    42  		ReadCertificateTotal,
    43  		ReadCertificateErrors,
    44  	)
    45  }
    46  

View as plain text