HandlerFor returns an uninstrumented http.Handler for the provided Gatherer. The behavior of the Handler is defined by the provided HandlerOpts. Thus, HandlerFor is useful to create http.Handlers for custom Gatherers, with non-default HandlerOpts, and/or with custom (or no) instrumentation. Use the
(reg prometheus.Gatherer, opts HandlerOpts)
| 106 | // instrumentation. Use the InstrumentMetricHandler function to apply the same |
| 107 | // kind of instrumentation as it is used by the Handler function. |
| 108 | func HandlerFor(reg prometheus.Gatherer, opts HandlerOpts) http.Handler { |
| 109 | return HandlerForTransactional(prometheus.ToTransactionalGatherer(reg), opts) |
| 110 | } |
| 111 | |
| 112 | // HandlerForTransactional is like HandlerFor, but it uses transactional gather, which |
| 113 | // can safely change in-place returned *dto.MetricFamily before call to `Gather` and after |