Skip to content

Gitea

Prometheus Metrics

Gitea is a lightweight, self-hosted Git service that exposes native Prometheus metrics.

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

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

Restart Gitea 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-gitea.conf > /dev/null << 'EOF'
metric:
prometheus:
targets:
- url: "http://localhost:3000/metrics"
name: "gitea"
allow_metrics:
- "gitea_*"
- "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: "gitea"
headers:
Authorization: "Bearer my-secret-token"
allow_metrics:
- "gitea_*"
- "process_resident_memory_bytes"
- "go_goroutines"
Metric Description
gitea_accesses Total number of HTTP accesses
gitea_issues Number of issues
gitea_organizations Number of organizations
gitea_repositories Number of repositories
gitea_users Number of users
process_resident_memory_bytes Resident memory size of the Gitea process
go_goroutines Number of active goroutines