Add a performance budget regression check to CI using the existing Prometheus metrics
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- github-actions, nodejs, prometheus, typescript
- Domain
- ci-cd, observability, performance
Research direction
Start with .github/workflows/build-check.yml to see the current steps, then read PROFILING.md (around lines 96-99) and performance-baseline.service.ts to find where baseline numbers would come from. The pure analytics functions in performance-analytics.service.ts are the suggested benchmark target. Done means a committed baseline, a deterministic benchmark, and a CI failure when a regression exceeds the stated tolerance. The scope is still open, so confirm the approach with the maintainers before starting.
Written by the indexing model from the issue text.
Description
Problem
The repository has a capable performance instrumentation stack — @willsoto/nestjs-prometheus, prom-client, OpenTelemetry, src/observability/, src/profiling/, and a performance-baseline.service.ts that "establishes baseline performance on startup" and "continuously compares current metrics against baseline" (per PROFILING.md:96-99).
None of it is enforced. .github/workflows/build-check.yml runs codegen, tsc --noEmit, a narrow Jest subset, and npm run build — no performance step. PROFILING.md documents the tooling but no baseline numbers, targets, or budget exist, and there is no coverage threshold either (see the separate coverage issue).
ROADMAP.md sets "Reach 80% code coverage" and "Achieve 99.9% uptime in staging" as v0.2.0 goals with no mechanism to measure either.
Why it matters
Performance regressions are invisible without a gate. A change that adds an N+1 or drops a cache passes every existing check — type checking, lint, and the small test subset all succeed while latency quietly doubles. Since this is exactly the failure mode most of the performance issues in this batch describe, a budget is what stops them recurring.
The instrumentation is already paid for; nothing consumes it.
Constraints in the current setup
Two things to be careful about:
- The CI test filter is narrow (
src/graphqlplus two spec files), so a performance test that needs broad coverage would run very little. - Running real load in CI is slow and flaky. Prefer a deterministic micro-benchmark over a throughput test.
Suggested Direction
- Record a baseline first. Use
PROFILING.md's tooling to capture current p50/p95 for a small set of representative endpoints, and commit those numbers as the budget. Without a recorded baseline there is nothing to compare against. - Add a deterministic benchmark step, not a load test.
autocannonis already used bytest/portfolio/portfolio-management.loadtest.sh, but CI-friendlier options exist. A small set of micro-benchmarks over pure functions — the analytics calculations inperformance-analytics.service.tsare ideal, since they are deterministic and take no I/O. - Assert the budget in CI. A regression beyond a stated tolerance (e.g. 20%) fails the build. Keep the tolerance generous initially; the goal is catching order-of-magnitude regressions, not 5% noise.
- Export the Prometheus metrics from the build-check job as an artifact, or run the service briefly and scrape
/metrics, so PR-level latency is visible without deploying. - Track the ROADMAP goal by reporting coverage and budget status on each run, so the 80% target becomes measurable.
Constraints
- Benchmarks in CI are notoriously flaky on shared runners. Pin to a fixed workload size, discard warmup iterations, and take the median of several runs rather than a single measurement.
- Do not make CI fail on absolute latency numbers alone; relative regression against a committed baseline is more stable across runner types.
- Keep the benchmark suite fast — it runs on every PR.
- Do not let the benchmark depend on network or a live database.
Acceptance Criteria
- A baseline of representative metrics is recorded and committed.
- At least one deterministic benchmark covers a hot code path.
- CI fails on a regression beyond the stated tolerance.
- The benchmark is stable across repeated runs on the CI runner.
- Prometheus metrics are exported as a CI artifact.
- The benchmark completes within a reasonable PR budget (document the actual time).
- Dominant language
- TypeScript
- Stars
- 7
- Forks
- 55
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 5
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from SourceXXL/alian_structure-api
-
good first issue help wanted security
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SourceXXL/alian_structure-api#266 ·
-
Parallelize the cache-warming loop in `cache-warming.service.ts` — warmers run strictly sequentiallyPossibly taken @syntaxsuuvam-spec claimed this 3 days ago. Opengood first issue performance
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SourceXXL/alian_structure-api#240 ·
-
documentation help wanted intermediate refactor
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
SourceXXL/alian_structure-api#215 ·
-
good first issue refactor tooling
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
SourceXXL/alian_structure-api#199 ·
-
help wanted intermediate refactor
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
SourceXXL/alian_structure-api#196 ·
All issues in SourceXXL/alian_structure-api
Similar issues
-
afk-ok area:data-quality importer size:S
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
enorm-labs/event-junkie#3301 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
one-zero-eight/apply-bot#39 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
bigbluebutton/bbb-ui-components-react#108 ·
Maintainers usually reply within 2 days
-
area: app type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
ExpidetGames/code-reviewer#308 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day