Support common “batch job” metrics

It would be nice if Phoebe would be able to add metrics common to batch jobs: when the job last ran, how long it took. When an exporter is executed, fetches data and yields metrics to the parent class implementation which takes care of creating the output. We would hook into this workflow, extending

Exporter class:

* when https://gitlab.com/testing-farm/phoebe/blob/master/phoebe/__init__.py#L105 starts, save the current time,
*when we reach https://gitlab.com/testing-farm/phoebe/blob/master/phoebe/init.py#L95, add gauges for started, finished and elapsed timestamps.

This feature would be controlled by command-line options:

* enable/disable,
* configurable names of the metrics: let user decide whether they want to have task_last_success_unixtime or job_last_success_timestamp,
* labels for the metrics – we will need to tweak them, to emit e.g. task_last_success_unixtime{task=”export-some-funny-data”} by one exporter, task_last_success_unixtime{task=”export-something-else”} by another (or even the same one, used with a different config file from another batch job).

This would greatly simplify steps each task would have to take to add these metrics on its own, leaving it to Phoebe core to solve once and for all.

Red Hat Mentor: Milos Prchlik

Status

Project Resources

RIGs

Affiliations