Skip to content

Commit

Permalink
feat(api): active and completed jobs metric services health indicators
Browse files Browse the repository at this point in the history
  • Loading branch information
LetItRock committed Sep 14, 2023
1 parent e8986b8 commit 4c487a5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 7 additions & 1 deletion apps/worker/src/app/health/health.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import {
DalServiceHealthIndicator,
StandardQueueServiceHealthIndicator,
WorkflowQueueServiceHealthIndicator,
ActiveJobsMetricQueueServiceHealthIndicator,
CompletedJobsMetricQueueServiceHealthIndicator,
} from '@novu/application-generic';

import { version } from '../../../package.json';
Expand All @@ -16,7 +18,9 @@ export class HealthController {
private healthCheckService: HealthCheckService,
private dalHealthIndicator: DalServiceHealthIndicator,
private standardQueueHealthIndicator: StandardQueueServiceHealthIndicator,
private workflowQueueHealthIndicator: WorkflowQueueServiceHealthIndicator
private workflowQueueHealthIndicator: WorkflowQueueServiceHealthIndicator,
private activeJobsMetricQueueServiceHealthIndicator: ActiveJobsMetricQueueServiceHealthIndicator,
private completedJobsMetricQueueServiceHealthIndicator: CompletedJobsMetricQueueServiceHealthIndicator
) {}

@Get()
Expand All @@ -26,6 +30,8 @@ export class HealthController {
async () => this.dalHealthIndicator.isHealthy(),
async () => this.standardQueueHealthIndicator.isHealthy(),
async () => this.workflowQueueHealthIndicator.isHealthy(),
async () => this.activeJobsMetricQueueServiceHealthIndicator.isHealthy(),
async () => this.completedJobsMetricQueueServiceHealthIndicator.isHealthy(),
async () => {
return {
apiVersion: {
Expand Down
2 changes: 2 additions & 0 deletions packages/application-generic/src/modules/queues.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@ import {

const PROVIDERS: Provider[] = [
ActiveJobsMetricQueueService,
ActiveJobsMetricQueueServiceHealthIndicator,
ActiveJobsMetricWorkerService,
bullMqTokenList,
BullMqService,
CompletedJobsMetricQueueService,
CompletedJobsMetricQueueServiceHealthIndicator,
CompletedJobsMetricWorkerService,
InboundParseQueue,
InboundParseWorker,
Expand Down

0 comments on commit 4c487a5

Please sign in to comment.