mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 18:43:34 +00:00
rebase: update kubernetes to 1.28.0 in main
updating kubernetes to 1.28.0 in the main repo. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
committed by
mergify[bot]
parent
b2fdc269c3
commit
ff3e84ad67
18
vendor/k8s.io/component-base/metrics/http.go
generated
vendored
18
vendor/k8s.io/component-base/metrics/http.go
generated
vendored
@ -19,19 +19,28 @@ package metrics
|
||||
import (
|
||||
"io"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||
)
|
||||
|
||||
var (
|
||||
processStartedAt time.Time
|
||||
)
|
||||
|
||||
func init() {
|
||||
processStartedAt = time.Now()
|
||||
}
|
||||
|
||||
// These constants cause handlers serving metrics to behave as described if
|
||||
// errors are encountered.
|
||||
const (
|
||||
// Serve an HTTP status code 500 upon the first error
|
||||
// HTTPErrorOnError serve an HTTP status code 500 upon the first error
|
||||
// encountered. Report the error message in the body.
|
||||
HTTPErrorOnError promhttp.HandlerErrorHandling = iota
|
||||
|
||||
// Ignore errors and try to serve as many metrics as possible. However,
|
||||
// if no metrics can be served, serve an HTTP status code 500 and the
|
||||
// ContinueOnError ignore errors and try to serve as many metrics as possible.
|
||||
// However, if no metrics can be served, serve an HTTP status code 500 and the
|
||||
// last error message in the body. Only use this in deliberate "best
|
||||
// effort" metrics collection scenarios. In this case, it is highly
|
||||
// recommended to provide other means of detecting errors: By setting an
|
||||
@ -41,7 +50,7 @@ const (
|
||||
// alerts.
|
||||
ContinueOnError
|
||||
|
||||
// Panic upon the first error encountered (useful for "crash only" apps).
|
||||
// PanicOnError panics upon the first error encountered (useful for "crash only" apps).
|
||||
PanicOnError
|
||||
)
|
||||
|
||||
@ -50,6 +59,7 @@ const (
|
||||
type HandlerOpts promhttp.HandlerOpts
|
||||
|
||||
func (ho *HandlerOpts) toPromhttpHandlerOpts() promhttp.HandlerOpts {
|
||||
ho.ProcessStartTime = processStartedAt
|
||||
return promhttp.HandlerOpts(*ho)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user