Skip to content

feat(diagnostics): add lightweight validation endpoints for analytics…#666

Open
Confidence001Jewel-cmd wants to merge 1 commit into
rinafcode:mainfrom
Confidence001Jewel-cmd:Implement_zero_trust_security_architecture
Open

feat(diagnostics): add lightweight validation endpoints for analytics…#666
Confidence001Jewel-cmd wants to merge 1 commit into
rinafcode:mainfrom
Confidence001Jewel-cmd:Implement_zero_trust_security_architecture

Conversation

@Confidence001Jewel-cmd
Copy link
Copy Markdown

Close #645

PR Description

  • Summary: Add lightweight diagnostics endpoints to enable local end-to-end validation of analytics and cost tracking and provide a minimal Grafana dashboard import for quick verification.
  • Changes: Added validation endpoints and registered them in the app module; imported a minimal Grafana dashboard for TeachLink Overview.
    • Files: validation.controller.ts, app.module.ts
  • Behavior:
    • POST /analytics/event — accepts {category, action, label?, value?} and increments feature_events_total.
    • POST /metrics/cost — accepts {amountUsd} and sets infrastructure_hourly_cost_usd.
    • GET /metrics — exposes Prometheus-format metrics for scraping.
  • Why: Facilitates fast local validation of analytics → Prometheus → Grafana without requiring the app Docker image build; useful for CI/debugging and onboarding.
  • Testing performed (local):
npm install
npm run start:dev
cd infra/monitoring
docker compose up -d prometheus grafana
# Send events
curl -X POST http://localhost:3000/analytics/event -H 'Content-Type: application/json' -d '{"category":"feature","action":"launch_button_clicked"}'
curl -X POST http://localhost:3000/metrics/cost -H 'Content-Type: application/json' -d '{"amountUsd": 5}'
# Verify Prometheus
http://localhost:9090/api/v1/query?query=feature_events_total
http://localhost:9090/api/v1/query?query=infrastructure_hourly_cost_usd
# Grafana UI
http://localhost:3001 (admin/admin)
.

@RUKAYAT-CODER
Copy link
Copy Markdown
Contributor

RUKAYAT-CODER commented May 27, 2026

kindly resolve conflict and fix wokflow

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 zero trust security architecture

2 participants