Documentation
¶
Overview ¶
Package cronprom exposes cron scheduler events as Prometheus metrics.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidOption = errors.New("cronprom: invalid option")
ErrInvalidOption reports an invalid Recorder option.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*config) error
Option configures New.
func WithDurationBuckets ¶
WithDurationBuckets overrides the job duration histogram buckets (seconds). Buckets must be finite, positive and strictly increasing.
func WithLatenessBuckets ¶
WithLatenessBuckets overrides the missed-fire lateness histogram buckets (seconds). Buckets must be finite, positive and strictly increasing.
func WithNamespace ¶
WithNamespace sets the metric namespace. Default "cron".
func WithRegisterer ¶
func WithRegisterer(r prometheus.Registerer) Option
WithRegisterer sets where collectors register. Default prometheus.DefaultRegisterer. A nil r is rejected.
type Recorder ¶
type Recorder struct {
// contains filtered or unexported fields
}
Recorder records scheduler activity as Prometheus metrics. Use New.
func New ¶
New builds and registers a Recorder; install the result with cron.WithRecorder. It returns an error wrapping ErrInvalidOption for a nil or rejected option, and the registration error if any collector clashes with an existing one.
func (*Recorder) Collect ¶ added in v0.1.1
func (r *Recorder) Collect(ch chan<- prometheus.Metric)
Collect implements prometheus.Collector.
func (*Recorder) Describe ¶ added in v0.1.1
func (r *Recorder) Describe(ch chan<- *prometheus.Desc)
Describe implements prometheus.Collector.