Skip to content

Forgejo

Prometheus Metrics

Forgejo is a self-hosted, lightweight Git service (fork of Gitea) that exposes native Prometheus metrics.

Edit the Forgejo configuration file (usually /etc/forgejo/app.ini) and add or update the [metrics] section:

[metrics]
ENABLED = true
; Optional: protect the endpoint with a token
; TOKEN = my-secret-token

Restart Forgejo for the changes to take effect. The metrics endpoint will be available at http://localhost:3000/metrics.

Terminal window
sudo tee /etc/glouton/conf.d/99-forgejo.conf > /dev/null << 'EOF'
metric:
prometheus:
targets:
- url: "http://localhost:3000/metrics"
name: "forgejo"
allow_metrics:
- "forgejo_*"
- "process_resident_memory_bytes"
- "go_goroutines"
EOF

If you set a TOKEN in app.ini, add an Authorization header to the target:

metric:
prometheus:
targets:
- url: "http://localhost:3000/metrics"
name: "forgejo"
headers:
Authorization: "Bearer my-secret-token"
allow_metrics:
- "forgejo_*"
- "process_resident_memory_bytes"
- "go_goroutines"
Metric Description
forgejo_accesses Total number of HTTP accesses
forgejo_issues Number of issues
forgejo_organizations Number of organizations
forgejo_repositories Number of repositories
forgejo_users Number of users
process_resident_memory_bytes Resident memory size of the Forgejo process
go_goroutines Number of active goroutines