fxpromhttp

package
v0.30.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 12, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Module is an fx compatible module.

Functions

func NewLogger

func NewLogger(params LoggerParams) promhttp.Logger

NewLogger creates a new, promhttp compliant logger instance.

Types

type Handler

type Handler interface {
	http.Handler
}

Handler is a unique type intended to be the return type for the handler constructor. Consuming packages can use this interface the register the handler in a HTTP mux.

func NewHandler

func NewHandler(params HandlerParams) Handler

NewHandler returns a new HTTP handler for Prometheus metrics.

type HandlerParams

type HandlerParams struct {
	dig.In

	Gatherer prometheus.Gatherer

	Logger promhttp.Logger      `optional:"true"`
	Opts   promhttp.HandlerOpts `optional:"true"`
}

HandlerParams provides a set of dependencies for a HTTP handler constructor.

type LoggerParams

type LoggerParams struct {
	dig.In

	Logger log.Logger `optional:"true"`
}

LoggerParams provides a set of dependencies for a HTTP handler logger constructor.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL