diff --git a/backend/src/utils/prometheus.ts b/backend/src/utils/prometheus.ts index 619e3cdd2..b90a4bd8b 100644 --- a/backend/src/utils/prometheus.ts +++ b/backend/src/utils/prometheus.ts @@ -277,3 +277,17 @@ const collectionSize = new Gauge({ export function setCollectionSize(collection: string, size: number): void { collectionSize.set({ collection }, size); } + +const queueLength = new Gauge({ + name: "queue_length", + help: "Length of the queues", + labelNames: ["queueName", "countType"], +}); + +export function setQueueLength( + queueName: string, + countType: string, + length: number +): void { + queueLength.set({ queueName, countType }, length); +}