---
title: "Loki limits | Grafana Cloud documentation"
description: "Understand the ingestion and query limits Grafana Cloud enforces on Loki, including limits that Grafana Cloud doesn't change per tenant."
---

> For a curated documentation index, see [llms.txt](/llms.txt). For the complete documentation index, see [llms-full.txt](/llms-full.txt).

# Loki limits

Grafana Cloud enforces limits on how much data you can send to and query from Loki. These limits protect the stability and performance of the platform for all tenants.

This page covers limits for the standard Loki push API, `POST /loki/api/v1/push`. If you send logs using OpenTelemetry Protocol (OTLP), refer to [OTLP: OpenTelemetry Protocol format considerations](../../otlp/otlp-format-considerations/#logs-ingestion-limits) for the limits that apply to the `/otlp/v1/logs` endpoint instead.

## Ingestion limits

The following limits apply when you push logs to Loki using the standard push API. If a request exceeds one of these limits, Grafana Cloud rejects the affected log lines or streams and returns an error.

Expand table

| Limit                                     | Value                          | When you exceed the limit                                                                                                                                                                                                                                      |
|-------------------------------------------|--------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Maximum length of a log line.             | 256 KB                         | Log lines that exceed the limit cause an ingestion exception (`line_too_long`, `400 Bad Request`). You can configure Loki to truncate long lines instead of rejecting them. Refer to [Configure Loki settings](../config-self-serve-ui/) for more information. |
| Maximum number of labels per stream.      | 15                             | Streams that exceed the limit cause an ingestion exception (`max_label_names_per_series`, `400 Bad Request`).                                                                                                                                                  |
| Maximum length of a label name.           | 1024 bytes                     | Label names that exceed the limit cause an ingestion exception (`label_name_too_long`, `400 Bad Request`).                                                                                                                                                     |
| Maximum length of a label value.          | 2048 bytes                     | Label values that exceed the limit cause an ingestion exception (`label_value_too_long`, `400 Bad Request`).                                                                                                                                                   |
| Maximum structured metadata per log line. | 128 entries, up to 64 KB total | Log lines that exceed the limit cause an ingestion exception (`400 Bad Request`).                                                                                                                                                                              |
| Ingestion rate.                           | 5 MB per second, per tenant    | Requests that exceed the limit are rejected and can be retried (`rate_limited`, `429 Too Many Requests`).                                                                                                                                                      |
| Maximum active streams.                   | 5,000 per tenant               | New streams are rejected until existing streams age out (`stream_limit`, `429 Too Many Requests`).                                                                                                                                                             |
| Maximum push request size.                | 64 MB decompressed             | Requests that exceed the limit are rejected (`413 Request Entity Too Large`).                                                                                                                                                                                  |

Ingestion rate and maximum active streams aren’t fixed ceilings for every tenant. Grafana Cloud automatically increases both limits as your usage grows: active streams can scale up to 80,000 for larger tenants, with a hard ceiling around 200,000, and the ingestion rate is continuously adjusted to stay close to your actual usage.

When you send a batch of logs, Loki ingests the log lines and streams that don’t exceed these limits, and returns errors only for the ones that do.

## Query limits

The following limits apply when you query logs in Grafana Cloud.

Expand table

| Limit                                             | Value               | When you exceed the limit                                                                              |
|---------------------------------------------------|---------------------|--------------------------------------------------------------------------------------------------------|
| Maximum query time range.                         | 30 days and 1 hour  | Queries that exceed the limit are rejected.                                                            |
| Maximum lookback.                                 | Disabled by default | Loki adjusts the query’s start time to fit within the allowed window instead of rejecting the request. |
| Maximum unique series returned by a metric query. | 500                 | Queries that exceed the limit are rejected.                                                            |

## Limits that cannot be changed

Grafana Cloud doesn’t change the following limits on a per-tenant basis, because doing so would risk the stability or performance of the platform for other tenants.

Expand table

| Limit                          | Value     | Why Grafana Cloud doesn’t change it                                                                                                                                                                                                                                                                            |
|--------------------------------|-----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Query timeout.                 | 5 minutes | A longer timeout lets one tenant reserve query execution workers for longer, which reduces the query capacity available to other tenants.                                                                                                                                                                      |
| Maximum labels per stream.     | 15        | Cardinality from extra labels is one of the main drivers of query cost. More than 15 labels per stream usually indicates a labeling problem to fix, rather than a limit to raise. Consider using [structured metadata](/docs/loki/next/get-started/labels/structured-metadata/) instead of adding more labels. |
| Maximum log line length.       | 256 KB    | This limit protects ingestion performance and stability. You can configure Loki to truncate longer lines instead of dropping them, but truncation can break JSON parsing of large log lines.                                                                                                                   |
| Out-of-order ingestion window. | 1 hour    | This window is half of the `max_chunk_age` setting (2 hours in Grafana Cloud), which is an environment-wide setting rather than a per-tenant override.                                                                                                                                                         |

If you need to ingest logs that are older than the out-of-order ingestion window, you can enable per-tenant time sharding, which splits incoming streams so that logs are never rejected for being too old. Time sharding has some limitations:

- Newly ingested old logs aren’t queryable for a few hours, until they’re flushed to object storage.
- Time sharding doesn’t change the separate limit on how old a log entry’s timestamp can be. Very old logs can still be rejected.
- Recording rules don’t work against the old data.

Contact [Grafana Support](/profile/org/tickets/new) to enable time sharding for your tenant.

## Next steps

- [Troubleshoot Cloud Logs write issues](../troubleshoot/)
- [Configure Loki settings](../config-self-serve-ui/)
- [OTLP: OpenTelemetry Protocol format considerations](../../otlp/otlp-format-considerations/#logs-ingestion-limits)
