Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Central YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Cache: Disabled due to Reviews > Disable Cache setting Disabled knowledge base sources:
⛔ Files ignored due to path filters (1)
📒 Files selected for processing (13)
🚧 Files skipped from review as they are similar to previous changes (7)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThis PR integrates Prometheus into the Fastify service and adds webhook and infrastructure metrics. A new Sequence Diagram(s)sequenceDiagram
participant Sender as Webhook Sender
participant Fastify as Fastify App
participant OrbSync as orb-sync-lib
participant Prom as Prometheus (prom-client / /metrics)
Sender->>Fastify: POST /webhooks (payload, headers)
Fastify->>OrbSync: processWebhook(payload, headers)
OrbSync-->>Fastify: { eventType, timeSinceEventCreatedMs }
Fastify->>Prom: webhooksProcessedCounter.inc(label=eventType)
Fastify->>Prom: webhookDelayMsHistogram.observe(label=eventType, value=timeSinceEventCreatedMs)
alt 5xx error
Fastify->>Prom: internalServerErrorsCounter.inc()
end
Prom->>Client: GET /metrics (scrape)
sequenceDiagram
participant Scheduler as Background Task
participant Fastify as Fastify App
participant PGPool as Postgres Pool
participant Prom as Prometheus (prom-client)
Scheduler->>PGPool: collect pool stats (total, idle, waiting)
PGPool-->>Fastify: stats
Fastify->>Prom: pgPoolTotalGauge.set(total)
Fastify->>Prom: pgPoolIdleGauge.set(idle)
Fastify->>Prom: pgPoolWaitingGauge.set(waiting)
Prom->>Client: GET /metrics (scrape)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/node-fastify/src/prometheus.ts`:
- Line 6: The CI fails because explicit "as any" casts are used when
constructing prom-client metrics; replace those casts with the correct
prom-client types: change the type of the config parameter/variable to the
appropriate prom-client config interface (e.g., client.CounterConfiguration) and
remove "as any" so you call new client.Counter(config) with a properly typed
config; do the same for the other occurrence (line 11) using the corresponding
prom-client metric config type (use client.<MetricName>Configuration or import
the specific type) and update any variable signatures so TypeScript infers the
correct types instead of using "any".
- Integrate Prometheus and expose via /metrics endpoint - Add custom metrics to help identify operational issues - Added missing log in case of server errors - Increases webhook max size to 10 MB - Bumped deps to resolve security warning
9b76dc1 to
0585c57
Compare
|
🎉 This PR is included in version 1.14.14 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Uh oh!
There was an error while loading. Please reload this page.