Documentation ¶
Overview ¶
Package metricsrv provides a default set of configuration for hosting http prometheus metrics in a service.
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:5117" // DefaultPath is the path where we expose prometheus by default. DefaultPath = "/metrics" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
Server represents a prometheus metrics server.
func (*Server) Addr ¶ added in v0.8.0
Addr will block until you have received an address for your server.
func (*Server) Run ¶
Run will start the metrics server.
Example ¶
package main import ( "context" "net/http" "github.com/LUSHDigital/core/workers/metricsrv" ) var ctx context.Context func main() { srv := metricsrv.New(&metricsrv.Config{ Server: &http.Server{ Addr: "0.0.0.0:5117", }, Path: "/metrics", }) srv.Run(ctx) }
Output:
Click to show internal directories.
Click to hide internal directories.