feat: add Prometheus worker metrics and enhance webhook signature ver… - #172
Conversation
…ification Closes ASTROIDX556#73 Closes ASTROIDX556#74 ASTROIDX556#73 — Prometheus metrics exporter for queue depths and worker latencies - Added `worker_job_duration_seconds` histogram and `worker_jobs_total` counter to MetricsService for tracking BullMQ worker processing latency and outcomes - Created `WorkerMetricsService` with an `instrumentJob()` wrapper that automatically measures job execution time and records success/failure - Wired metrics into all workers (webhook delivery, notification delivery, analytics aggregation, balance sync) via optional WorkerMetricsService injection - Updated WebhooksProcessor to track delivery latency and outcomes - Added MetricsModule import to WebhookModule and WorkersModule - Added comprehensive unit tests for WorkerMetricsService and new metric collection ASTROIDX556#74 — Cryptographic verification middleware for incoming webhook signatures - Created `RawBodyMiddleware` for capturing raw request body before JSON parsing, ensuring accurate HMAC computation on webhook endpoints - Enhanced `WebhookSignatureGuard` with configurable per-integration secret resolution via `WebhookSecretResolver` callback and `WebhookSignatureGuardOptions` - Added `WEBHOOK_SIGNING_SECRET` env var as additional fallback - Added descriptive error response when no signing secret is configured - Extended tests: per-integration secrets, custom tolerance, raw body extraction, missing headers, non-numeric timestamps, no-secret-configured scenarios Co-Authored-By: Codebuff <noreply@codebuff.com>
|
@Hotmopo 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! 🚀 |
|
MergeKeeper review Scope: in scope for linked issue The PR successfully implements the Prometheus metrics exporter for queue depths/worker latencies (#73) and the cryptographic webhook signature verification middleware (#74) with complete unit test coverage. Reviewed commit: |
|
MergeKeeper merge status Status: blocked Reason: One or more required CI checks failed. Failing checks:
Next steps:
|
|
MergeKeeper review unavailable AI provider review response did not contain valid JSON No approval or merge action was taken. |
Move Express Request type augmentation to a separate .d.ts file to avoid @typescript-eslint/no-namespace, and replace `as any` casts in the test file with properly typed mock objects to satisfy @typescript-eslint/no-explicit-any. Co-Authored-By: Codebuff <noreply@codebuff.com>
|
Merged Merged with |
ASTROIDX556#172) * feat: add Prometheus worker metrics and enhance webhook signature verification Closes ASTROIDX556#73 Closes ASTROIDX556#74 ASTROIDX556#73 — Prometheus metrics exporter for queue depths and worker latencies - Added `worker_job_duration_seconds` histogram and `worker_jobs_total` counter to MetricsService for tracking BullMQ worker processing latency and outcomes - Created `WorkerMetricsService` with an `instrumentJob()` wrapper that automatically measures job execution time and records success/failure - Wired metrics into all workers (webhook delivery, notification delivery, analytics aggregation, balance sync) via optional WorkerMetricsService injection - Updated WebhooksProcessor to track delivery latency and outcomes - Added MetricsModule import to WebhookModule and WorkersModule - Added comprehensive unit tests for WorkerMetricsService and new metric collection ASTROIDX556#74 — Cryptographic verification middleware for incoming webhook signatures - Created `RawBodyMiddleware` for capturing raw request body before JSON parsing, ensuring accurate HMAC computation on webhook endpoints - Enhanced `WebhookSignatureGuard` with configurable per-integration secret resolution via `WebhookSecretResolver` callback and `WebhookSignatureGuardOptions` - Added `WEBHOOK_SIGNING_SECRET` env var as additional fallback - Added descriptive error response when no signing secret is configured - Extended tests: per-integration secrets, custom tolerance, raw body extraction, missing headers, non-numeric timestamps, no-secret-configured scenarios Co-Authored-By: Codebuff <noreply@codebuff.com> * fix: resolve ESLint errors in raw-body middleware Move Express Request type augmentation to a separate .d.ts file to avoid @typescript-eslint/no-namespace, and replace `as any` casts in the test file with properly typed mock objects to satisfy @typescript-eslint/no-explicit-any. Co-Authored-By: Codebuff <noreply@codebuff.com> --------- Co-authored-by: Hotmopo <297505646+Hotmopo@users.noreply.github.com> Co-authored-by: Codebuff <noreply@codebuff.com>
…ification
Closes #73
Closes #74
#73 — Prometheus metrics exporter for queue depths and worker latencies
worker_job_duration_secondshistogram andworker_jobs_totalcounter to MetricsService for tracking BullMQ worker processing latency and outcomesWorkerMetricsServicewith aninstrumentJob()wrapper that automatically measures job execution time and records success/failure#74 — Cryptographic verification middleware for incoming webhook signatures
RawBodyMiddlewarefor capturing raw request body before JSON parsing, ensuring accurate HMAC computation on webhook endpointsWebhookSignatureGuardwith configurable per-integration secret resolution viaWebhookSecretResolvercallback andWebhookSignatureGuardOptionsWEBHOOK_SIGNING_SECRETenv var as additional fallbackSummary
Type of change
Related issue
Closes #
Checklist
npm run buildpassesnpm testpassesnpm run lintpassesnpm run typecheckpasses