Documentation ¶
Overview ¶
Package prom provides prometheus metrics handler options for httpserver module.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithMetrics ¶
func WithMetrics(p *metrics.Prometheus) httpserver.Opt
WithMetrics replaces servers handler with http.Handler which is instrumented with /metrics endpoint. This option is meant be used with stand alone metrics server, not embedded inside application server. For serving metrics endpoint inside your application web server check lower level functionalities from metrics.
Example ¶
package main import ( "github.com/elisasre/go-common/metrics" "github.com/elisasre/go-common/service/module/httpserver" "github.com/elisasre/go-common/service/module/httpserver/prom" ) func main() { httpserver.New( httpserver.WithAddr(":6062"), prom.WithMetrics(metrics.New()), ) }
Output:
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.