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:
Madhu Rajanna
2023-08-17 07:15:28 +02:00
committed by mergify[bot]
parent b2fdc269c3
commit ff3e84ad67
706 changed files with 45252 additions and 16346 deletions

View File

@ -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)
}