Skip to content

Latest commit

 

History

History
27 lines (18 loc) · 1.36 KB

File metadata and controls

27 lines (18 loc) · 1.36 KB

Metrics

This packages contains utilities for collecting metrics in @message-queue-toolkit

Prometheus metrics

Metrics that use Prometheus toolkit and prom-client library

MessageProcessingPrometheusMetric

Abstract class implementing MessageMetricsManager interface, that can be injected into AbstractQueueService from @message-queue-toolkit/core.

It uses Histogram metric to collect message processing times with labels:

  • messageType - message type
  • version - message version
  • queue - name of the queue or topic
  • result - processing result

See MessageProcessingPrometheusMetric.ts for available parameters.

There are following non-abstract implementations available:

  • MessageProcessingTimeMetric - registers elapsed time from start to the end of message processing
  • MessageLifetimeMetric - registers elapsed time from the point where message was initially sent, to the point when it was processed. Note: if message is waiting in the queue due to high load or barrier, the waiting time is included in the measurement

MessageProcessingMultiMetrics

Implementation of MessageMetricsManager that allows to use multiple MessageProcessingPrometheusMetric instances.