Documentation ¶
Index ¶
- func NewHandler(read, write *url.URL, opts ...HandlerOption) http.Handler
- type HandlerOption
- func HandlerInstrumenter(instrumenter handlerInstrumenter) HandlerOption
- func Logger(logger log.Logger) HandlerOption
- func ReadMiddleware(m func(http.Handler) http.Handler) HandlerOption
- func Registry(r *prometheus.Registry) HandlerOption
- func SpanRoutePrefix(spanRoutePrefix string) HandlerOption
- func WriteMiddleware(m func(http.Handler) http.Handler) HandlerOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHandler ¶
func NewHandler(read, write *url.URL, opts ...HandlerOption) http.Handler
NewHandler creates the new metrics v1 handler.
Types ¶
type HandlerOption ¶
type HandlerOption func(h *handlerConfiguration)
HandlerOption modifies the handler's configuration.
func HandlerInstrumenter ¶
func HandlerInstrumenter(instrumenter handlerInstrumenter) HandlerOption
HandlerInstrumenter adds a custom HTTP handler instrument middleware for the handler to use.
func Logger ¶
func Logger(logger log.Logger) HandlerOption
Logger add a custom logger for the handler to use.
func ReadMiddleware ¶
func ReadMiddleware(m func(http.Handler) http.Handler) HandlerOption
ReadMiddleware adds a middleware for all read operations.
func Registry ¶
func Registry(r *prometheus.Registry) HandlerOption
Registry adds a custom Prometheus registry for the handler to use.
func SpanRoutePrefix ¶
func SpanRoutePrefix(spanRoutePrefix string) HandlerOption
SpanRoutePrefix adds a prefix before the value of route tag in tracing spans.
func WriteMiddleware ¶
func WriteMiddleware(m func(http.Handler) http.Handler) HandlerOption
WriteMiddleware adds a middleware for all write operations.
Click to show internal directories.
Click to hide internal directories.