extending /metrics endpoint #11244

Open
opened 2025-11-02 09:32:03 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @KlavsKlavsen on GitHub (Jul 17, 2023).

Feature Description

I would like to be able to do things like: "awards" on most MRs this week, Most "commits" and "most lines added / removed" - just like LWN does on the kernel development regulary :)

Its good fun :)

If you could suggest WHERE you would prefer we implement that - I could assign one of my developers to do a PR for this..
I would expect its about finding the right places to add a prometheus client counter for the above things - and then we can just do something to look at those metrics ingested by prometheus and do the awards :)

Screenshots

No response

Originally created by @KlavsKlavsen on GitHub (Jul 17, 2023). ### Feature Description I would like to be able to do things like: "awards" on most MRs this week, Most "commits" and "most lines added / removed" - just like LWN does on the kernel development regulary :) Its good fun :) If you could suggest WHERE you would prefer we implement that - I could assign one of my developers to do a PR for this.. I would expect its about finding the right places to add a prometheus client counter for the above things - and then we can just do something to look at those metrics ingested by prometheus and do the awards :) ### Screenshots _No response_
GiteaMirror added the type/proposal label 2025-11-02 09:32:03 -06:00
Author
Owner

@laurivosandi commented on GitHub (Aug 25, 2023):

I believe Prometheus endpoint is not the right place for this: are these metrics used for alerting and do are you using them at usual Prometheus resolution of 30 seconds?

I believe the right place for this is custom API endpoint where you can have a'la CronJob request it once per week and post to your preferred chat platform

Also check https://github.com/go-gitea/gitea/issues/17653

@laurivosandi commented on GitHub (Aug 25, 2023): I believe Prometheus endpoint is not the right place for this: are these metrics used for alerting and do are you using them at usual Prometheus resolution of 30 seconds? I believe the right place for this is custom API endpoint where you can have a'la CronJob request it once per week and post to your preferred chat platform Also check https://github.com/go-gitea/gitea/issues/17653
Author
Owner

@KlavsKlavsen commented on GitHub (Aug 25, 2023):

statistics are useful for many things and can be alertable.. f.ex. I could use alerts on specific changes in data - and prometheus is NOT only for alerting.. a LOT use it with grafana f.ex. - so they get dashboards that gives an overview over whats happening - and here statistics on data would be very useful to see whats going on in your gitea instance datasets.

I totally agree with your proposal for exposing this on a diff. endpoint f.ex. /statistics - so it can be consumed by a diff. prometheus - if thats what someone wants.

@KlavsKlavsen commented on GitHub (Aug 25, 2023): statistics are useful for many things and can be alertable.. f.ex. I could use alerts on specific changes in data - and prometheus is NOT only for alerting.. a LOT use it with grafana f.ex. - so they get dashboards that gives an overview over whats happening - and here statistics on data would be very useful to see whats going on in your gitea instance datasets. I totally agree with your proposal for exposing this on a diff. endpoint f.ex. /statistics - so it can be consumed by a diff. prometheus - if thats what someone wants.
Author
Owner

@senare commented on GitHub (Sep 6, 2023):

Would be lovely !

Anywhere I can put it into prometheus and use it inside Grafana dash is fine !

And yes it would be handy to be able to build alerts from this ...

I can try and give an example if it helps !

If i get a ticket it would be nice to be able to view this in the grafana dashboard also things like avarge closing time etc .. and if there are tickets no one is picking up for x minutes I would like an alert to trigger

So i.e. used with alertmanager / prometeheus / grafana

Hope fully this makes sense to more than just me !

@senare commented on GitHub (Sep 6, 2023): Would be lovely ! Anywhere I can put it into prometheus and use it inside Grafana dash is fine ! And yes it would be handy to be able to build alerts from this ... I can try and give an example if it helps ! If i get a ticket it would be nice to be able to view this in the grafana dashboard also things like avarge closing time etc .. and if there are tickets no one is picking up for x minutes I would like an alert to trigger So i.e. used with alertmanager / prometeheus / grafana Hope fully this makes sense to more than just me !
Author
Owner

@KlavsKlavsen commented on GitHub (Sep 6, 2023):

An example would be much appreciated - then I can ask a colleague to work on it from there
and that would make it easier for others to add other metrics in the future (like the ones you're talking about) to add on useful statistics - and for those that "have a cost" - we'd probably add a setting to enable/disable them

@KlavsKlavsen commented on GitHub (Sep 6, 2023): An example would be much appreciated - then I can ask a colleague to work on it from there and that would make it easier for others to add other metrics in the future (like the ones you're talking about) to add on useful statistics - and for those that "have a cost" - we'd probably add a setting to enable/disable them
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#11244