Skip to content

OTEL Metrics

Queuert emits OpenTelemetry metrics through the @queuert/otel adapter. Users must configure their OTEL SDK with desired exporters (Prometheus, OTLP, etc.) before using the adapter. See the ObservabilityAdapter TSDoc for the adapter interface.

All metrics follow the naming pattern:

queuert.{component}.{operation}[.{suboperation}]

The ObservabilityAdapter interface accepts milliseconds; the @queuert/otel adapter converts duration values to seconds per OTEL Messaging Semantic Conventions.

Attribute names follow OpenTelemetry semantic conventions (lowercase, dotted) and match the span attributes documented in OTEL Tracing:

  • queuert.worker.id — worker identifier
  • queuert.job.type — job type name
  • queuert.chain.type — chain (entry job) type name
  • queuert.job.continued — boolean: true if the completion produced a continuation, false otherwise
  • queuert.adapter.operation — adapter operation that produced an error
MetricAttributesDescription
queuert.worker.startedqueuert.worker.idWorker started processing
queuert.worker.errorqueuert.worker.idWorker encountered an error
queuert.worker.stoppingqueuert.worker.idWorker received stop signal
queuert.worker.stoppedqueuert.worker.idWorker fully stopped
MetricAttributesDescription
queuert.job.createdqueuert.job.type, queuert.chain.typeJob created
queuert.job.completedqueuert.job.type, queuert.chain.type, queuert.worker.id, queuert.job.continuedJob completed. queuert.worker.id is omitted for workerless completion.
queuert.job.reapedqueuert.job.type, queuert.chain.type, queuert.worker.idStale job reclaimed by reaper
queuert.job.blockedqueuert.job.type, queuert.chain.typeJob blocked by pending blocker chains
queuert.job.triggeredqueuert.job.type, queuert.chain.typePending job triggered to run immediately
queuert.job.unblockedqueuert.job.type, queuert.chain.typeJob unblocked after blocker chain completed
MetricAttributesDescription
queuert.job.attempt.startedqueuert.job.type, queuert.chain.type, queuert.worker.idWorker began processing an attempt
queuert.job.attempt.completedqueuert.job.type, queuert.chain.type, queuert.worker.idAttempt completed successfully
queuert.job.attempt.failedqueuert.job.type, queuert.chain.type, queuert.worker.idAttempt failed (may retry)
queuert.job.attempt.taken_by_another_workerqueuert.job.type, queuert.chain.type, queuert.worker.idJob already leased by another worker
queuert.job.attempt.already_completedqueuert.job.type, queuert.chain.type, queuert.worker.idJob already completed when worker tried to process it
queuert.job.attempt.lease_expiredqueuert.job.type, queuert.chain.type, queuert.worker.idLease expired before attempt finished
queuert.job.attempt.lease_renewedqueuert.job.type, queuert.chain.type, queuert.worker.idLease successfully renewed during processing
MetricAttributesDescription
queuert.chain.createdqueuert.chain.typeChain created
queuert.chain.completedqueuert.chain.typeChain completed
queuert.chain.deletedqueuert.chain.typeChain deleted
MetricAttributesDescription
queuert.state_adapter.errorqueuert.adapter.operationState adapter operation failed
queuert.notify_adapter.errorqueuert.adapter.operationNotify adapter operation failed

Histograms track duration distributions at three levels. Unit is seconds.

MetricAttributesDescription
queuert.chain.durationqueuert.chain.typeDuration from chain creation to completion
queuert.job.durationqueuert.job.type, queuert.chain.typeDuration from job creation to completion
queuert.job.attempt.durationqueuert.job.type, queuert.chain.type, queuert.worker.idDuration of a single attempt

These form a hierarchy — chain duration encompasses job durations (plus wait time between continuations), and job duration encompasses attempt durations (plus wait time between retries):

queuert.chain.duration
├── queuert.job.duration (first job)
│ ├── queuert.job.attempt.duration (attempt 1)
│ └── queuert.job.attempt.duration (attempt 2, retry)
├── queuert.job.duration (continuation)
│ └── queuert.job.attempt.duration
└── (wait time between jobs)

Two gauges track real-time worker state. They are incremented/decremented via delta values.

MetricAttributesDescription
queuert.job_type.idlequeuert.job.type, queuert.worker.idWorkers currently idle for this job type
queuert.job_type.processingqueuert.job.type, queuert.worker.idJobs of this type currently being processed