Skip to content

Conversation

@AtilaU19
Copy link
Contributor

Description

This PR introduces Prometheus monitoring to the feedback backend to improve observability.

It adds a new /metrics endpoint (exposed on port ${METRICS_PORT}, defaulting to 3099 as per server.js) that exposes key application metrics for scraping.

Changes Made

  • Added prom-client as a new backend dependency.
  • Created PrometheusScrapeAgent and HTTPServer to handle metrics collection and exposure.
  • Modified server.js to initialize the agent and register new metrics.
  • Instrumented the application to track:
    • API call counts and errors (feedback_app_api_calls_total)
    • Webhook event counts and errors (feedback_app_webhook_events_total)
    • Feedback submission counts and failures (feedback_app_registrations_total, feedback_app_failures_total)
    • A histogram for submitted user ratings (feedback_app_ratings_histogram)
  • Updated docker-compose.yml to expose the new metrics port and add the METRICS_PORT environment variable.

How to Test

  1. Build and run the application:
    docker-compose up --build
  2. In a separate terminal, access the new metrics endpoint:
    curl http://localhost:3099/metrics
  3. You should see the default Node.js metrics and the newly defined feedback_app_ metrics.
  4. Trigger a feedback submission by running through the feedback flow in a meeting.
  5. Run the curl command again and verify that the feedback_app_registrations_total counter and the feedback_app_ratings_histogram_count have incremented.

This change adds the `prom-client` dependency and a new PrometheusAgent
class to expose a `/metrics` endpoint (on port $METRICS_PORT, default 3099).

New metrics are registered for:
- API calls (success/errors)
- Webhook processing (events/errors)
- Feedback submissions (total/failures)
- A histogram for feedback ratings (1-10).

The server.js file is instrumented to track these metrics,
and the docker-compose.yml is updated to expose the new metrics port.
@prlanzarin prlanzarin self-requested a review October 20, 2025 17:05
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.

1 participant