File tree 2 files changed +8
-2
lines changed
2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -303,8 +303,12 @@ type Logger interface {
303
303
// HandlerOpts specifies options how to serve metrics via an http.Handler. The
304
304
// zero value of HandlerOpts is a reasonable default.
305
305
type HandlerOpts struct {
306
- // ErrorLog specifies an optional logger for errors collecting and
307
- // serving metrics. If nil, errors are not logged at all.
306
+ // ErrorLog specifies an optional Logger for errors collecting and
307
+ // serving metrics. If nil, errors are not logged at all. Note that the
308
+ // type of a reported error is often prometheus.MultiError, which
309
+ // formats into a multi-line error string. If you want to avoid the
310
+ // latter, create a Logger implementation that detects a
311
+ // prometheus.MultiError and formats the contained errors into one line.
308
312
ErrorLog Logger
309
313
// ErrorHandling defines how errors are handled. Note that errors are
310
314
// logged regardless of the configured ErrorHandling provided ErrorLog
Original file line number Diff line number Diff line change @@ -215,6 +215,8 @@ func (err AlreadyRegisteredError) Error() string {
215
215
// by a Gatherer to report multiple errors during MetricFamily gathering.
216
216
type MultiError []error
217
217
218
+ // Error formats the contained errors as a bullet point list, preceded by the
219
+ // total number of errors. Note that this results in a multi-line string.
218
220
func (errs MultiError ) Error () string {
219
221
if len (errs ) == 0 {
220
222
return ""
You can’t perform that action at this time.
0 commit comments