This packages contains utilities for collecting metrics in @message-queue-toolkit
Metrics that use Prometheus toolkit and prom-client library
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
Implementation of MessageMetricsManager
that allows to use multiple MessageProcessingPrometheusMetric
instances.