metrics: add metric for unread system notices #12374

Closed
opened 2025-11-02 10:07:52 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @r10r on GitHub (Jan 23, 2024).

Feature Description

I think it would be great if gitea had a metrics for the number of unread system notices
(web UI path /admin/notices, model https://github.com/go-gitea/gitea/blob/main/models/system/notice.go)

# HELP gitea_system_notices Number of system notices
# TYPE gitea_system_notices gauge
gitea_system_notices 524

It would be even greater if it possible to distinguish between success and error notices. (See NOTICE_ON_SUCCESS settings in https://docs.gitea.com/administration/config-cheat-sheet) e.g.:

# HELP gitea_system_notices Number of system notices
# TYPE gitea_system_notices gauge
gitea_system_notices{type="success"} 123
gitea_system_notices{type="error"}  0

I really like to contribute and can create a PR if you consider this useful.

Originally created by @r10r on GitHub (Jan 23, 2024). ### Feature Description I think it would be great if gitea had a metrics for the number of unread system notices (web UI path **/admin/notices**, model https://github.com/go-gitea/gitea/blob/main/models/system/notice.go) ```prometheus # HELP gitea_system_notices Number of system notices # TYPE gitea_system_notices gauge gitea_system_notices 524 ``` It would be even greater if it possible to distinguish between success and error notices. (See **NOTICE_ON_SUCCESS** settings in https://docs.gitea.com/administration/config-cheat-sheet) e.g.: ```prometheus # HELP gitea_system_notices Number of system notices # TYPE gitea_system_notices gauge gitea_system_notices{type="success"} 123 gitea_system_notices{type="error"} 0 ``` I really like to contribute and can create a PR if you consider this useful.
GiteaMirror added the type/proposal label 2025-11-02 10:07:52 -06:00
Author
Owner

@r10r commented on GitHub (Jan 23, 2024):

Just a note to myself. Merged PR's that add new metrics:

@r10r commented on GitHub (Jan 23, 2024): Just a note to myself. Merged PR's that add new metrics: * [include build info in Prometheus metrics #22819](https://github.com/go-gitea/gitea/pull/22819)
Author
Owner

@KN4CK3R commented on GitHub (Jan 23, 2024):

Just a note: the system notices didn't get much love and may be removed in the future.

@KN4CK3R commented on GitHub (Jan 23, 2024): Just a note: the system notices didn't get much love and may be removed in the future.
Author
Owner

@r10r commented on GitHub (Jan 24, 2024):

Just a note: the system notices didn't get much love and may be removed in the future.

Thanks for the information. I thought that adding these metrics would be a rather easy task and a real
benefit for monitoring. Is there any chance to keep the system notices in long term ?
Is there an issue for the removal of system notices ?

Maybe you give me some advice how to monitor gitea system health (task/job errors) with prometheus / grafana ?
The only thing that comes to my mind is processing the logfiles (loki, grok_exporter ...)

@r10r commented on GitHub (Jan 24, 2024): > Just a note: the system notices didn't get much love and may be removed in the future. Thanks for the information. I thought that adding these metrics would be a rather easy task and a real benefit for monitoring. Is there any chance to keep the system notices in long term ? Is there an issue for the removal of system notices ? Maybe you give me some advice how to monitor gitea system health (task/job errors) with prometheus / grafana ? The only thing that comes to my mind is processing the logfiles (loki, grok_exporter ...)
Author
Owner

@lunny commented on GitHub (Nov 1, 2024):

Merge into #14724

@lunny commented on GitHub (Nov 1, 2024): Merge into #14724
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#12374