Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var WithDisableMetrics taskset.Property = func(task *taskset.Task) {
task.ModifyProperty(disableMetricsProperty{}, func(_ interface{}) interface{} {
return struct{}{}
})
}
WithDisableMetrics disables metric collection for a particular task.
Functions ¶
func NewPrometheus ¶
func NewPrometheus(metrics Metrics) taskset.Middleware
NewPrometheus creates a middleware that reports basic metrics on each task.
Metric collection can be disabled for a particular task using WithDisableMetrics.
Every metric is reported using label values equal to {properties.Name(task)}. If any of the metrics are nil, then that metric won't be reported.
Types ¶
type Metrics ¶
type Metrics struct { // Duration is used to report each task's run duration in seconds. // The reported duration will exclude the time a task spends in depend() calls. Duration *prometheus.HistogramVec // Success is used to report each task's successful execution. Success *prometheus.CounterVec // Failure is used to report each task's failed execution. Failure *prometheus.CounterVec }
Metrics is a set of metrics reported by prometheus middleware.
Click to show internal directories.
Click to hide internal directories.