Skip to content

Commit

Permalink
metric names feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
denwilliams committed Sep 3, 2024
1 parent 611e452 commit c07a9ce
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/metrics.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
import { Counter, Histogram, Registry } from "prom-client";

export const messagesReceivedCounter = new Counter({
name: "queue_messages_received_total",
name: "queue_handler_messages_total",
help: "Total number of messages received from the queue",
labelNames: ["queue", "provider"],
});
export const messagesFailedCounter = new Counter({
name: "queue_messages_failed_total",
name: "queue_handler_failures_total",
help: "Total number of messages failed to handle",
labelNames: ["queue", "provider"],
});
export const messageHandlerDuration = new Histogram({
name: "queue_handler_duration_seconds",
help: "Queue message handler processing time in seconds.",
labelNames: ["queue", "provider"],
});

export const messagesQueuedCounter = new Counter({
name: "queue_messages_queued_total",
help: "Total number of messages published to the queue",
labelNames: ["queue", "provider"],
});
export const messageHandlerDuration = new Histogram({
name: "queue_message_handler_duration_ms",
help: "Queue message handler processing time in milliseconds.",
labelNames: ["queue", "provider"],
});

export function registerMetrics(registry: Pick<Registry, "registerMetric">) {
registry.registerMetric(messagesReceivedCounter);
Expand Down

0 comments on commit c07a9ce

Please sign in to comment.