mirror of
https://github.com/minio/minio.git
synced 2025-04-22 19:35:47 -04:00
remove logging for invalid metadata values (#18068)
This commit is contained in:
parent
69c0e18685
commit
9788d85ea3
@ -3667,8 +3667,12 @@ func (c *minioClusterCollector) Collect(out chan<- prometheus.Metric) {
|
|||||||
prometheus.GaugeValue,
|
prometheus.GaugeValue,
|
||||||
float64(v),
|
float64(v),
|
||||||
append(values, k)...)
|
append(values, k)...)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.LogOnceIf(GlobalContext, fmt.Errorf("unable to validate prometheus metric (%w) %v:%v", err, values, metric.Histogram), "cluster-metrics-histogram")
|
// Enable for debugging
|
||||||
|
if serverDebugLog {
|
||||||
|
logger.LogOnceIf(GlobalContext, fmt.Errorf("unable to validate prometheus metric (%w) %v:%v", err, values, metric.Histogram), "cluster-metrics-histogram")
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
out <- pmetric
|
out <- pmetric
|
||||||
}
|
}
|
||||||
@ -3692,7 +3696,10 @@ func (c *minioClusterCollector) Collect(out chan<- prometheus.Metric) {
|
|||||||
metric.Value,
|
metric.Value,
|
||||||
values...)
|
values...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.LogOnceIf(GlobalContext, fmt.Errorf("unable to validate prometheus metric (%w) %v", err, values), "cluster-metrics")
|
// Enable for debugging
|
||||||
|
if serverDebugLog {
|
||||||
|
logger.LogOnceIf(GlobalContext, fmt.Errorf("unable to validate prometheus metric (%w) %v", err, values), "cluster-metrics")
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
out <- pmetric
|
out <- pmetric
|
||||||
}
|
}
|
||||||
@ -3890,11 +3897,9 @@ func metricsServerHandler() http.Handler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mfs, err := gatherers.Gather()
|
mfs, err := gatherers.Gather()
|
||||||
if err != nil {
|
if err != nil && len(mfs) == 0 {
|
||||||
if len(mfs) == 0 {
|
writeErrorResponseJSON(r.Context(), w, toAdminAPIErr(r.Context(), err), r.URL)
|
||||||
writeErrorResponseJSON(r.Context(), w, toAdminAPIErr(r.Context(), err), r.URL)
|
return
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
contentType := expfmt.Negotiate(r.Header)
|
contentType := expfmt.Negotiate(r.Header)
|
||||||
|
@ -616,7 +616,7 @@ func AuthMiddleware(h http.Handler) http.Handler {
|
|||||||
tc, ok := r.Context().Value(mcontext.ContextTraceKey).(*mcontext.TraceCtxt)
|
tc, ok := r.Context().Value(mcontext.ContextTraceKey).(*mcontext.TraceCtxt)
|
||||||
|
|
||||||
claims, groups, owner, authErr := metricsRequestAuthenticate(r)
|
claims, groups, owner, authErr := metricsRequestAuthenticate(r)
|
||||||
if authErr != nil || !claims.VerifyIssuer("prometheus", true) {
|
if authErr != nil || (claims != nil && !claims.VerifyIssuer("prometheus", true)) {
|
||||||
if ok {
|
if ok {
|
||||||
tc.FuncName = "handler.MetricsAuth"
|
tc.FuncName = "handler.MetricsAuth"
|
||||||
tc.ResponseRecorder.LogErrBody = true
|
tc.ResponseRecorder.LogErrBody = true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user