# IMQMetricsServerOptions.queueLengthFormatter property · @imqueue/rpc

Source: https://imqueue.org/api/rpc/latest/rpc.imqmetricsserveroptions.queuelengthformatter/
Published: 2026-08-04
Author: @imqueue maintainers (https://github.com/imqueue)
Package: @imqueue/rpc 3.5.3 — generated reference, not hand-written

Renders the response body from the current queue length and the metric name, which is always the literal `'queue_length'`.

**Signature:**

```typescript
queueLengthFormatter?: (length: number, metricName: string) => string;
```

## Remarks

Defaults to a Prometheus-style rendering. A falsy return falls back to the bare number. Note that the queue length reports `0` while the queue's writer is disconnected.

