Add DORA metrics exporter service #1
No reviewers
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ldraney/pal-e-dora-exporter!1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "1-dora-exporter-service"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Initial scaffold of the DORA metrics exporter -- a FastAPI service that polls Woodpecker CI and Forgejo APIs on a configurable interval and exposes DORA-aligned Prometheus metrics at
/metrics. This is Phase 1 of theplan-2026-03-01-dora-metrics-dashboard.--extra-index-urlfor SDK dependenciesChanges
src/main.py-- FastAPI app with/healthand/metricsendpoints, lifespan-managed background collector taskssrc/config.py-- Environment variable configuration (WOODPECKER_URL, WOODPECKER_TOKEN, FORGEJO_URL, FORGEJO_USER, FORGEJO_PASSWORD, POLL_INTERVAL)src/collectors/woodpecker.py-- Polls Woodpeckerlist_repos+list_pipelines, updatesdora_deployments_total(Counter),dora_deployment_duration_seconds(Histogram),dora_deployment_last_success_timestamp(Gauge)src/collectors/forgejo.py-- Polls Forgejorepo_search+repo_list_pull_requests+repo_list_pull_reviews, updatesdora_pr_merges_total(Counter),dora_pr_lead_time_seconds(Histogram),dora_pr_review_count(Histogram)Dockerfile-- Python 3.12-slim, installs from Forgejo PyPI, runs uvicorn on port 8000.woodpecker.yaml-- CI pipeline builds Docker image and pushes to Harbor on push to mainrequirements.txt-- fastapi, uvicorn, prometheus-client, ldraney-woodpecker-sdk, ldraney-forgejo-sdk.gitignore-- Python standard ignoresREADME.md-- Metrics reference, configuration table, run instructionsTest Plan
python -m py_compile)docker build -t dora-exporter .curl localhost:8000/healthcurl localhost:8000/metricsReview Checklist
woodpecker_sdk,forgejo_sdk)repo_searchRelated Notes
plan-2026-03-01-dora-metrics-dashboard-- parent planissue-pal-e-dora-exporter-service-- tracking issuedora-framework-- the DORA axiom this implementsReview-fix round 1:
Fixed
asyncio.get_event_loop()->asyncio.get_running_loop()in both collectors. The former is deprecated in Python 3.10+ and emits a DeprecationWarning when called from within an already-running event loop. Since_run_sync()is always called from async task context,get_running_loop()is the correct API.