Loki: Get Volume
loki_get_volumeCalculate log volume in bytes per service, namespace, or stream from the Loki index over a time range, ranked largest first, to identify noisy sources and compare selectors before querying.
Instructions
How many bytes of logs each service, namespace or stream produced over a range, largest first, from the index alone — no lines are read, so it is cheap over days. Use it to find the noisiest sources, to see what a selector covers before querying it, or to compare: {namespace=~".+"} by ["namespace"] ranks every namespace. Needs volume_enabled (see loki_auth_status).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"selector": "<selector>"
},
"name": "loki_get_volume"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| by | No | Labels to group by, e.g. ["namespace"] or ["namespace", "app"]. Defaults to the labels named in the selector. | |
| end | No | Range end: now, now-1h, -30m, an RFC3339 timestamp (2026-01-31T12:00:00Z, nanosecond fractions kept) or unix seconds/nanoseconds. Defaults to now. | |
| limit | No | Maximum rows to return (1-1000), largest first. Defaults to 20. | |
| start | No | Range start: now, now-1h, -30m, an RFC3339 timestamp (2026-01-31T12:00:00Z, nanosecond fractions kept) or unix seconds/nanoseconds. Defaults to 1 hour before end. | |
| selector | Yes | A stream selector, e.g. `{namespace="payments", app="api"}`. Label matchers only: no line filters or parsers. At least one matcher must not match the empty string: `{app=~".+"}` works, `{app=~".*"}` and `{}` are rejected. | |
| aggregate_by | No | series: bytes per value of the `by` labels (the usual answer). labels: bytes per label NAME, i.e. how much of the volume carries each label at all. | series |