Documentation ¶
Overview ¶
prometheus implements a Prometheus-compatible metrics exporter.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Listen represents a net.Dial compatible string indicating the network address to bind the Prometheus metrics // scraping endpoint server. If not specified, the server won't be started. Listen string `yaml:"listen"` // FlushInterval represents the time interval in seconds at which the metrics reporter's registry metrics are // flushed to the Prometheus registry. FlushInterval int `yaml:"flush_interval"` // Namespace represents the namespace to apply to registered Prometheus metrics. Namespace string `yaml:"namespace"` // Subsystem represents the subsystem to apply to registered Prometheus metrics. Subsystem string `yaml:"subsystem"` // Debug represents a flags indicating whether to enable internal exporter activity logging. // This is mainly for debug purposes. Debug bool `yaml:"debug"` }
Config represents a prometheus metrics export configuration.
type Exporter ¶
Exporter represents a metrics exporter to a Prometheus server.
func New ¶
New returns a new Prometheus metrics exporter based on provided configuration. If a go-metrics registry is provided, it is hooked into the exporter's internal Prometheus registry and its metrics will be flushed periodically to the Prometheus endpoint (flush interval to be specified in the config).
func (*Exporter) HTTPHandler ¶
HTTPHandler returns an HTTP.Handler exposing the Prometheus exporter registry.
func (*Exporter) MustRegister ¶
MustRegister registers the provided metric to the Prometheus exporter registry, and panics if an error occur.
func (*Exporter) Register ¶
Register registers the provided metric to the Prometheus exporter registry.