Conversation
- 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
|
No actionable comments were generated in the recent review. 🎉 📝 WalkthroughSummary by CodeRabbit
WalkthroughThis PR integrates Prometheus into the Fastify app and adds business metrics for webhook processing. 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(eventType)
Fastify->>Prom: webhookDelayMsHistogram.observe(eventType, timeSinceEventCreatedMs)
Note right of Fastify: On 5xx errors -> internalServerErrorsCounter.inc()
Prom->>Client: GET /metrics (scrape)
Assessment against linked issues
Out-of-scope changes
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".
Uh oh!
There was an error while loading. Please reload this page.