Files
2026-02-20 22:50:45 +08:00
..
2026-02-20 22:50:45 +08:00
2026-02-20 22:50:45 +08:00
2026-02-20 22:50:45 +08:00
2026-02-20 22:50:45 +08:00
2026-02-20 22:50:45 +08:00
2026-02-20 22:50:45 +08:00
2026-02-20 22:50:45 +08:00
2026-02-20 22:50:45 +08:00
2026-02-20 22:50:45 +08:00
2026-02-20 22:50:45 +08:00

Gitea Actions Queue Exporter

Prometheus exporter for Gitea Actions queue metrics, designed for KEDA autoscaling of Gitea Action Runners.

Features

  • Prometheus Metrics: Expose queue length, running jobs, and oldest job age
  • Lightweight: Python-based with minimal dependencies
  • Configurable: Environment variable configuration
  • Health Checks: Built-in health check endpoint

Metrics

Metric Type Description
gitea_actions_pending_jobs Gauge Number of pending/waiting jobs
gitea_actions_running_jobs Gauge Number of running jobs
gitea_actions_total_jobs Gauge Total number of jobs
gitea_actions_queue_oldest_job_age_seconds Gauge Age of oldest pending job (seconds)
gitea_exporter_scrape_errors_total Counter Total scrape errors
gitea_exporter_last_scrape_timestamp Gauge Last successful scrape timestamp

Environment Variables

Variable Default Description
GITEA_URL http://192.168.1.83:33000 Gitea server URL
GITEA_TOKEN - Gitea API token (optional for public repos)
EXPORTER_PORT 9999 Exporter listening port
SCRAPE_INTERVAL 15 Metrics scrape interval (seconds)

Build

docker build -t harbor.omniverseai.net:8080/library/gitea-actions-exporter:latest .
docker push harbor.omniverseai.net:8080/library/gitea-actions-exporter:latest

Run Locally

# With Python
python exporter.py

# With Docker
docker run -p 9999:9999 \
  -e GITEA_URL=http://192.168.1.83:33000 \
  gitea-actions-exporter:latest

Deploy to Kubernetes

kubectl apply -f k8s-manifests/

Usage with KEDA

triggers:
  - type: prometheus
    metadata:
      serverAddress: http://monitoring-kube-prometheus-prometheus.observability.svc.cluster.local:9090
      threshold: '5'
      query: sum(gitea_actions_pending_jobs{instance="http://192.168.1.83:33000"})

Development

# Install dependencies
pip install -r requirements.txt

# Run exporter
python exporter.py

# Access metrics
curl http://localhost:9999/metrics