Add tier label to all Prometheus metrics #2

Closed
opened 2026-05-29 12:26:27 +00:00 by ldraney · 0 comments
Owner

Type

Feature

Lineage

Parent: ldraney/DORA#1

Repo

ldraney/pal-e-dora-exporter

User Story

As a platform operator, I want playground repos excluded from DORA composite scores so that metrics reflect real production health.

Context

The exporter currently treats all Forgejo repositories equally. Adding a tier label at the exporter level enables Grafana filtering, per-app drill-downs, and composite scoring.

File Targets

  • src/config.py — add DORA_TIERS_FILE env var, YAML tier config loading
  • src/collectors/forgejo.py — add tier label to PR metrics
  • src/collectors/woodpecker.py — add tier label to deployment metrics
  • src/main.py — pass tier config to collectors
  • tiers.yaml — initial tier mapping file
  • tests/test_tiers.py — unit tests

Acceptance Criteria

  • Exporter emits tier="1", tier="2", or tier="3" labels on all metric families
  • Config uses YAML-based repo-to-tier mapping
  • Unlabeled repos default to tier 3
  • Match on repo name part only (strip owner prefix)

Test Expectations

  • Unit test: config loader parses tier mapping correctly
  • Unit test: collectors attach correct tier label per repo

Constraints

  • Keep config format simple; YAML preferred
  • No breaking changes to existing metric names or labels

Checklist

  • tiers.yaml created with correct mappings
  • config.py loads YAML file
  • forgejo.py adds tier label
  • woodpecker.py adds tier label
  • main.py passes tier config
  • Unit tests pass
### Type Feature ### Lineage Parent: ldraney/DORA#1 ### Repo ldraney/pal-e-dora-exporter ### User Story As a platform operator, I want playground repos excluded from DORA composite scores so that metrics reflect real production health. ### Context The exporter currently treats all Forgejo repositories equally. Adding a tier label at the exporter level enables Grafana filtering, per-app drill-downs, and composite scoring. ### File Targets - `src/config.py` — add DORA_TIERS_FILE env var, YAML tier config loading - `src/collectors/forgejo.py` — add tier label to PR metrics - `src/collectors/woodpecker.py` — add tier label to deployment metrics - `src/main.py` — pass tier config to collectors - `tiers.yaml` — initial tier mapping file - `tests/test_tiers.py` — unit tests ### Acceptance Criteria - Exporter emits tier="1", tier="2", or tier="3" labels on all metric families - Config uses YAML-based repo-to-tier mapping - Unlabeled repos default to tier 3 - Match on repo name part only (strip owner prefix) ### Test Expectations - Unit test: config loader parses tier mapping correctly - Unit test: collectors attach correct tier label per repo ### Constraints - Keep config format simple; YAML preferred - No breaking changes to existing metric names or labels ### Checklist - [ ] tiers.yaml created with correct mappings - [ ] config.py loads YAML file - [ ] forgejo.py adds tier label - [ ] woodpecker.py adds tier label - [ ] main.py passes tier config - [ ] Unit tests pass ### Related - ldraney/DORA#1
ldraney 2026-06-13 19:50:06 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ldraney/pal-e-dora-exporter#2
No description provided.