handler wraps an unfiltered http.Handler but uses a filtered handler, created on the fly, if filtering is requested. Create instances with newHandler.
| 43 | // created on the fly, if filtering is requested. Create instances with |
| 44 | // newHandler. |
| 45 | type handler struct { |
| 46 | unfilteredHandler http.Handler |
| 47 | // enabledCollectors list is used for logging and filtering |
| 48 | enabledCollectors []string |
| 49 | // exporterMetricsRegistry is a separate registry for the metrics about |
| 50 | // the exporter itself. |
| 51 | exporterMetricsRegistry *prometheus.Registry |
| 52 | includeExporterMetrics bool |
| 53 | maxRequests int |
| 54 | logger *slog.Logger |
| 55 | } |
| 56 | |
| 57 | func newHandler(includeExporterMetrics bool, maxRequests int, logger *slog.Logger) *handler { |
| 58 | h := &handler{ |
no outgoing calls
no test coverage detected