feat(engine): add Prometheus /metrics endpoint for HTTP requests, chaos faults, and SEP-24 states
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 58/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- backend-api-design, observability-sre, testing
Research direction
Read engine/app/main.py, engine/app/chaos.py, and engine/app/inspector.py, then check how ChaosState and Sep24Transaction are represented. Add the endpoint and metrics coverage in engine/app/metrics.py and engine/tests/test_metrics.py; update engine/requirements.txt as needed. Done means /metrics returns the specified Prometheus format, exports the requested metrics, is protected from chaos and traffic-buffer noise, and the pytest suite passes.
Written by the indexing model from the issue text.
Description
Context
engine currently exposes an in-memory traffic ring buffer (/admin/traffic) and structured JSON logs, plus in-memory chaos counters in ChaosState. Exposing a standard Prometheus /metrics scrape endpoint enables local Grafana/Prometheus dashboards and quantitative SLA monitoring during chaos fault injection tests.
Target Files
- Create
engine/app/metrics.py - Create
engine/tests/test_metrics.py - Modify
engine/app/main.py - Modify
engine/app/chaos.py(PROTECTED_PREFIXES) - Modify
engine/app/inspector.py - Modify
engine/requirements.txt
Acceptance Criteria
- Add
GET /metricsreturning Prometheus text exposition format (text/plain; version=0.0.4; charset=utf-8). - Export HTTP request counters (labeled by
method, normalizedpath, andstatus_code) and request duration metrics. - Export Chaos Engine gauges/counters reflecting
ChaosState(total_inspected,injected_errors,injected_delays) and SEP-24 transaction totals grouped bykindandstatusfromSep24Transaction. - Exempt
/metricsfrom chaos fault injection (PROTECTED_PREFIXES) and/admin/trafficring-buffer noise. - Add pytest coverage in
engine/tests/test_metrics.pyand verifypytest -vpasses in CI.
- Dominant language
- Python
- Stars
- 0
- Forks
- 1
- Avg merge
- 19h 43m
- 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 sepbox-dev/sepbox
-
complexity: trivial engine good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
sepbox-dev/sepbox#19 ·
-
complexity: trivial contracts good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
sepbox-dev/sepbox#18 ·
-
complexity: trivial good first issue inspector
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sepbox-dev/sepbox#17 ·
-
complexity: medium engine
Difficulty 4/5 3-5 days Newbie friendliness 52/100
sepbox-dev/sepbox#13 ·
-
complexity: medium engine
Difficulty 3/5 1-2 days Newbie friendliness 76/100
sepbox-dev/sepbox#12 ·
All issues in sepbox-dev/sepbox
Similar issues
-
docs(contributing): the two things that silently block a PRPossibly taken A pull request linked to this issue is open or already merged. Openavailable documentation good first issue
Difficulty 1/5 1-3 hours Newbie friendliness 95/100
Nixitov/Riptide-Native#944 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
JTHCode/secretguard#24 ·
Maintainers usually reply within 1 day
-
area: middleware documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
good first issue
Difficulty 1/5 Under an hour Newbie friendliness 95/100
omarelshamy25x/shamy-hijri#63 ·
Maintainers usually reply within 1 day