Promtail or Alloy gets HTTP 429 from Loki and log lines go missing
Your error
server returned HTTP status 429 Too Many Requests (429): ingestion rate limit exceeded for user fake (limit: 4194304 bytes/sec) while attempting to ingest '2000' lines totaling '1048576' bytes, reduce log volume or contact your Loki administrator to see if the limit can be increased5 more lines it can showFix it fast
Most common cause, 1 of 3The tenant sends more bytes per second than ingestion_rate_mb allows
Raise both values in limits_config if the cluster has the CPU and memory for it, or set them for one tenant in the runtime overrides file.
# loki config
limits_config:
ingestion_rate_mb: 16
ingestion_burst_size_mb: 32
# or per tenant, in the runtime config file
overrides:
team-a:
ingestion_rate_mb: 16Short answer
"server returned HTTP status 429 Too Many Requests" in Promtail or Alloy logs means Loki refused the push because a limit was reached: the tenant's ingestion_rate_mb, one stream's per_stream_rate_limit, or max_global_streams_per_user. The text after the colon names the limit. Raise it in limits_config or send fewer lines (Loki 3.x); Promtail is end of life.
Which cause do you have?
Ask Loki which limit it enforced. Every refused push is counted in loki_discarded_samples_total with a reason label, and the reason maps one to one onto the causes below: rate_limited, per_stream_rate_limit or stream_limit. In a split deployment, read the metric from the distributors and the ingesters.
curl -s http://localhost:3100/metrics | grep '^loki_discarded_samples_total'Then find the line you see in this list and open its fix:
- 1The tenant sends more bytes per second than ingestion_rate_mb allows
reason="rate_limited", and the client log quotes 'ingestion rate limit exceeded for user ...' with the limit in bytes per second (Loki 2.x starts the same text with a capital I) - 2One stream is pushing faster than per_stream_rate_limit
reason="per_stream_rate_limit", and the error quotes one stream's labels with 'Per stream rate limit exceeded' - 3The tenant has reached its active stream cap
reason="stream_limit", and the error says 'maximum active stream limit exceeded when trying to create stream' (Loki 2.x: 'Maximum active stream limit exceeded')
What does the error look like?
server returned HTTP status 429 Too Many Requests (429): ingestion rate limit exceeded for user fake (limit: 4194304 bytes/sec) while attempting to ingest '2000' lines totaling '1048576' bytes, reduce log volume or contact your Loki administrator to see if the limit can be increasedIngestion rate limit exceeded for user fake (limit: 4194304 bytes/sec) while attempting to ingest '2000' lines totaling '1048576' bytes, reduce log volume or contact your Loki administrator to see if the limit can be increasedPer stream rate limit exceeded (limit: 3MB/sec) while attempting to ingest for stream '{job="app"}' totaling 5MB, consider splitting a stream via additional labels or contact your Loki administrator to see if the limit can be increasedmaximum active stream limit exceeded when trying to create stream {...}, reduce the number of active streams (reduce labels or reduce label values)msg="error sending batch, will retry" status=429final error sending batch, no retries left, dropping data
Cause 1 of 3
The tenant sends more bytes per second than ingestion_rate_mb allows
You seereason="rate_limited", and the client log quotes 'ingestion rate limit exceeded for user ...' with the limit in bytes per second (Loki 2.x starts the same text with a capital I)
Check
Loki answers 429 when a tenant's total push rate passes ingestion_rate_mb (default 4 MB per second) or a burst goes above ingestion_burst_size_mb (default 6 MB), which should be at least the size of the largest single push. The distributor enforces it. With the default global strategy the limit is shared out across the healthy distributors, so adding distributors does not raise it. In single-tenant mode the tenant is named fake. An empty result from the check means the defaults are in force.
curl -s 'http://localhost:3100/config?mode=diff' | grep -E 'ingestion_rate|ingestion_burst'Fix
Raise both values in limits_config if the cluster has the CPU and memory for it, or set them for one tenant in the runtime overrides file. Where the volume is noise, drop lines in the collector instead of raising the limit.
# loki config
limits_config:
ingestion_rate_mb: 16
ingestion_burst_size_mb: 32
# or per tenant, in the runtime config file
overrides:
team-a:
ingestion_rate_mb: 16Verify
After Loki reloads, the rate_limited series stops increasing and the client logs no more 429 lines.
curl -s http://localhost:3100/metrics | grep 'reason="rate_limited"'Confirmed by grafana.com
Cause 2 of 3
One stream is pushing faster than per_stream_rate_limit
You seereason="per_stream_rate_limit", and the error quotes one stream's labels with 'Per stream rate limit exceeded'
Check
Loki also returns 429 when a single label set (one stream) passes per_stream_rate_limit, 3 MB per second by default, with a 15 MB burst. The ingester enforces it, so the tenant can be far below its own limit while one busy stream, for example every node's logs under one job label, is refused.
curl -s http://localhost:3100/metrics | grep 'reason="per_stream_rate_limit"'Fix
Split the stream by adding a label with a small, fixed set of values, such as the host or the container, so its lines spread over several streams. Grafana's guidance is to keep per_stream_rate_limit at 5 MB or less, so raise it only a little.
limits_config:
per_stream_rate_limit: 5MB
per_stream_rate_limit_burst: 20MBVerify
The per_stream_rate_limit counter holds still, and the stream from the error shows up in Grafana as several streams.
curl -s http://localhost:3100/metrics | grep 'reason="per_stream_rate_limit"'Confirmed by grafana.com
Cause 3 of 3
The tenant has reached its active stream cap
You seereason="stream_limit", and the error says 'maximum active stream limit exceeded when trying to create stream' (Loki 2.x: 'Maximum active stream limit exceeded')
Check
Loki refuses new streams with 429 once a tenant holds max_global_streams_per_user active streams, 5000 by default. The usual cause is a label with many values, such as a request ID, user ID or file path, which creates a new stream for each value. List the labels and count the values of the suspicious one.
curl -s http://localhost:3100/loki/api/v1/labels
curl -s http://localhost:3100/loki/api/v1/label/request_id/values | jq '.data | length'
# add -H 'X-Scope-OrgID: <tenant>' when auth_enabled is trueFix
Remove the high-cardinality label from the collector's label set and keep that value in the log line, where queries can still filter it. Raise max_global_streams_per_user only once the label set is under control.
limits_config:
max_global_streams_per_user: 10000Verify
The value count for the removed label stops growing, and the stream_limit counter stays flat.
curl -s http://localhost:3100/metrics | grep 'reason="stream_limit"'Confirmed by github.com
How do I stop it coming back?
- Alert on sum by (reason) (increase(loki_discarded_samples_total[5m])) > 0, so a limit is seen before the client gives up and drops the batch.
- Review new labels in collector config changes: a label whose values are unbounded becomes the next stream_limit outage.
- Plan the move from Promtail to Grafana Alloy; Promtail is end of life and gets no further fixes.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.