Skip to content

feat: add /metrics endpoint for backend monitoring#81

Open
precious-akpan wants to merge 4 commits intoCreditra:mainfrom
precious-akpan:feature/metrics-endpoint
Open

feat: add /metrics endpoint for backend monitoring#81
precious-akpan wants to merge 4 commits intoCreditra:mainfrom
precious-akpan:feature/metrics-endpoint

Conversation

@precious-akpan
Copy link

Description

Add a /metrics endpoint exposing Prometheus-style metrics for request counts, latencies, errors, and background job stats.

Changes

  • Install prom-client and fast-check dependencies
  • Create MetricsCollector interface

Related Issue

Closes #33

Testing

  • Unit tests added
  • Property-based tests added
  • Integration tests added
  • 95%+ test coverage achieved

Documentation

  • Metrics documentation added
  • Configuration guide updated

Status

��� Work in progress - Task 1 of 13 completed

- Install prom-client@^15.1.0 for Prometheus metrics
- Install fast-check@^3.15.0 for property-based testing
- Create MetricsCollector interface in src/services/metricsCollector.ts

Task: Set up metrics infrastructure and dependencies
Issue: Creditra#33
@greatest0fallt1me
Copy link
Contributor

@precious-akpan Can you resolve the conflicts?

- Fix duplicate 'test:coverage' script entries
- Fix missing commas in dependencies
- Remove duplicate 'dependencies' section
- Consolidate duplicate devDependencies entries
- Keep both upstream packages (jest, ts-jest, zod) and our additions (prom-client, fast-check)
- Maintain proper JSON syntax throughout

This resolves the merge conflict between our metrics dependencies
and the upstream changes.
Resolved conflicts by keeping our clean package.json which fixes
the upstream corruption and includes our metrics dependencies.
- Remove all duplicate dependencies from package.json
- Remove invalid 'test:coverage' entry from dependencies
- Fix vitest.config.ts duplicate content from bad merge
- Consolidate vitest configuration with proper coverage settings

These files had merge conflicts that resulted in invalid JSON/TS syntax.
@precious-akpan
Copy link
Author

@greatest0fallt1me conflicts resolved. Awaiting your approval.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement metrics endpoint (/metrics) for monitoring

2 participants