@message-queue-toolkit/metrics
TypeScript icon, indicating that this package has built-in type declarations

3.0.0 • Public • Published

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.

/@message-queue-toolkit/metrics/

    Package Sidebar

    Install

    npm i @message-queue-toolkit/metrics

    Weekly Downloads

    2,517

    Version

    3.0.0

    License

    MIT

    Unpacked Size

    18.6 kB

    Total Files

    26

    Last publish

    Collaborators

    • kibertoad
    • dariacm
    • carlos_gamero