#3812 Exposing Koji metrics for Prometheus
Opened by alexi. Modified

We'd like to be able to extract metrics in Prometheus format from Koji, things like the number of tasks executed, number of builds, etc. Some of the information that's currently available as a Report, plus some other things that aren't, but in a format that we could plug into our monitoring system.

Our original idea was to start working on this as a hub plugin and then contribute it upstream if there was any interest, but it seems like this wouldn't be possible to implement as a hub plugin. It could also work as a web plugin, but sadly there's no such thing. Our next option would be as a new web method.

We'd like to do this as a native part of Koji if possible and not as an external component, as that would make it easier to contribute upstream so other people could benefit from it as well. We feel it would make Koji easier to monitor and benefit others, but we wanted to gauge the interest first.

What do you think, @mikem @tkopecek? Is this of interest, and if so how should we approach it?


It sounds like the data can be from koji-hub or even from koji database directly.

I found a polling exporter [1] which might be helpful

[1] https://github.com/release-engineering/koji-prometheus-exporter

Metadata Update from @julian8628:
- Custom field Size adjusted to None

Yes, thanks, we found that as well. As I said, we'd like this to be a part of Koji directly, but if not we'll do something like that.

We wouldn't want to use the database directly to get the data, we would always go through koji-hub.

This sort of reporting tends to be highly specific to a deployment. I'm not sure it belongs in upstream Koji. Even it if were, it would likely still be in the form of a plugin or a helper script.

Ok, fair enough. Can we have web plugins, then? :)

We created a patch in our Koji repo to introduce the Prometheus metrics implemented as web script.
Please take a look https://gitlab.cern.ch/linuxsupport/rpms/koji/-/blob/master/src/prometheus-metrics.patch and let us know if it is something that you would like to add upstream.
We will be happy to do it :)

Cheers,
Marta

This issue has been migrated to Fedora Forge:
https://forge.fedoraproject.org/koji/koji/issues/3812

Please continue any further discussion there.

Metadata