Skip to content

Feature: Metrics support #618

@alko89

Description

@alko89

Bull and BullMQ support metrics, which can be enabled with metrics option:

// Bull
new Queue3(
  queueName, 
  {
    metrics: {
      maxDataPoints: MetricsTime.ONE_WEEK 
    }
  }
);

// BullMQ (in worker)
new Worker(
  queueName,
  async (job) => { ... },
  {
    metrics: {
      maxDataPoints: MetricsTime.ONE_WEEK,
    },
  }
);

This enables additional data in Redis, which can be fetched by using getMetrics method and provides information about job completion/failure over time with some additional metadata:

interface Metrics {
    meta: {
        count: number;
        prevTS: number;
        prevCount: number;
    };
    data: number[];
    count: number;
}

This would allow displaying a graph of completed and failed jobs over time, it should also provide information about job response time, process time and throughput.

image

Relates to #258

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions