Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.
/ flexmetrics Public archive
forked from go-flexible/flexmetrics

The package go-flexible/flexmetrics provides a default set of configuration for hosting prometheus and pprof metrics.

License

Notifications You must be signed in to change notification settings

BenefexLtd/flexmetrics

 
 

Repository files navigation

Metrics Server

Go Reference Go

The package go-flexible/flexmetrics provides a default set of configuration for hosting prometheus and pprof metrics.

Configuration

The metric server can be configured through the environment to match setup in the infrastructure.

  • PROMETHEUS_ADDR default: :2112
  • PROMETHEUS_PATH default: /metrics

Examples

Starting server and exposing metrics

// Rely on the package defaults
srv := flexmetrics.New()
srv.Run(ctx)

// Or bring your own
httpServer := &http.Server{
        Addr: ":8081",
}
srv := flexmetrics.New(
        flexmetrics.WithServer(httpServer),
        flexmetrics.WithPath("/__/metrics"),
)
srv.Run(ctx)

pprof metrics will be exposed on:

/debug/pprof/
/debug/pprof/cmdline
/debug/pprof/profile
/debug/pprof/symbol
/debug/pprof/trace

About

The package go-flexible/flexmetrics provides a default set of configuration for hosting prometheus and pprof metrics.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%