Documentation ¶
Index ¶
Examples ¶
Constants ¶
View Source
const ( // DefaultAddr is the port that we listen to the prometheus path on by default. DefaultAddr = "0.0.0.0:9090" // DefaultPath is the path where we expose prometheus by default. DefaultPath = "/metrics" // DefaultReadTimeout is the default read timeout for the http server. DefaultReadTimeout = 5 * time.Second // DefaultReadHeaderTimeout is the default read header timeout for the http server. DefaultReadHeaderTimeout = 1 * time.Second // DefaultIdleTimeout is the default idle timeout for the http server. DefaultIdleTimeout = 1 * time.Second // DefaultWriteTimeout is the default write timeout for the http server. DefaultWriteTimeout = 15 * time.Second )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger interface {
Printf(format string, v ...interface{})
}
Logger defines any logger able to call Printf.
type Option ¶
type Option func(s *Server)
Option is a type of func that allows you change defaults of the *Server returned by New.
func WithAddr ¶
WithAddr allows you to specify the address the HTTP server should bind to. If provided, this option will override the use of METRICS_ADDR environment variable.
func WithLogger ¶
WithLogger allows you to set a logger for the server.
func WithPath ¶
WithPath allows you to specify the path Prometheus metrics should be served on. If provided, this option will override the use of METRICS_PROMETHEUS_PATH environment variable.
func WithServer ¶
WithServer allows you to provide your own HTTP server to be used to serve metrics.
Click to show internal directories.
Click to hide internal directories.