feat: implement application metrics and KPIs exposed via Prometheus e…#905
Open
whitezaddy wants to merge 1 commit into
Open
feat: implement application metrics and KPIs exposed via Prometheus e…#905whitezaddy wants to merge 1 commit into
whitezaddy wants to merge 1 commit into
Conversation
|
@whitezaddy Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Contributor
|
Great job so far There’s just one blocker — the workflow is failing. Could you take a look and fix it so all checks pass? Happy to review again once that’s done. |
Author
Will do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…ndpoint (#518)
feat(metrics): add comprehensive application metrics and KPIs (#518)
Closes #518
📝 Description
This pull request introduces a comprehensive metrics and KPI tracking system to monitor application health, business performance, and user behavior. It integrates with Prometheus by exposing a
/metricsendpoint and includes scheduled jobs for calculating key business indicators.This implementation directly addresses the need for business metrics and analytics dashboards by exposing critical data for monitoring and feature adoption measurement.
Key Features Implemented:
MetricsModuleexposes a/metricsendpoint for scraping. Includes default Node.js metrics.MetricsInterceptortracks API request latency (p50, p95, p99) using a Prometheus histogram.KpiServiceruns on a 5-minute cron schedule to calculate and update the following metrics:KpiServiceto ensure calculation logic is correct.✅ Checklist
Linked issue
#518usingCloses #518Branch & commits
develop)feature/issue-518-app-metricsCode quality & tests
npm run lint:cipasses with zero warningsnpm run format:checkpassesnpm run typecheckpasses with zero errorsnpm run test:cipasses and coverage threshold is maintainedkpi.service.spec.ts)Error handling & NestJS best practices
class-validator/class-transformerand are wired through NestJS validation pipes (N/A for this feature)Error(N/A for this feature)KpiService)/metricsis public)Documentation / Swagger
/metrics)/api/docs) reflects the changesREADME.mdorCONTRIBUTING.mdis updated if contributor workflow or API behaviour changes (No changes needed)Breaking changes
🧪 Test Evidence
The new functionality was validated locally through the following steps:
1. Run the application