Documentation
¶
Overview ¶
Package daemon implements a daemon to import librdkafka metrics from JSON and export librdkafka metrics in Prometheus exposition format over an HTTP API. An example command to run the daemon is provided at the root of this distribution.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
ListenAddr string // Address and TCP port to listen on, e.g. "127.0.0.1:8080"
ReadTimeout time.Duration // Amount of time allowed to read request
WriteTimeout time.Duration // Amount of time allowed to write response
ShutdownTimeout time.Duration // Amount of time allowed for graceful shutdown
}
Config holds configuration for the daemon.
type Daemon ¶
type Daemon struct {
// contains filtered or unexported fields
}
Daemon holds internal state and contains no exported fields.
type Metrics ¶
Metrics is the interface required for the daemon to support metrics functionality, including the POST /metrics endpoint, which uses the ReadFrom() method to accept metric values in JSON format, and the GET /metrics endpoint, which uses the Handler() method to returns metric values in Prometheus exposition format.
See github.com/allsopp/librdkafka-exporter/metrics.Metrics for the reference implementation of this interface.