package
0.24.0
Repository: https://github.com/lushdigital/core.git
Documentation: pkg.go.dev

# README

Metric Server

The package core/workers/metricsrv provides a default set of configuration for hosting a http prometheus metrics in a service.

Configuration

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

  • PROMETHEUS_ADDR default: :5117
  • PROMETHEUS_PATH default: /metrics

Examples

Starting server and exposing metrics

srv := metricsrv.New(&metricsrv.Config{
    Server: &http.Server{
        Addr: "0.0.0.0:5117",
    },
    Path: "/metrics",
})
srv.Run(ctx)

# Functions

New creates a new default metrics server.

# Constants

DefaultAddr is the port that we listen to the prometheus path on by default.
DefaultPath is the path where we expose prometheus by default.

# Structs

Config represents the configuration for the metrics server.
Server represents a prometheus metrics server.