The Loki RPM starts the service before dnf prints “Complete!”, and it starts it on a demo config that writes chunks to /tmp/loki. Debug logging is switched on too. Rocky Linux and AlmaLinux age out /tmp on a 10 day timer, so a server left on that config slowly loses its oldest logs. That is the first thing to fix when you install Grafana Loki on Rocky Linux 10 or AlmaLinux 10, and the package has a few more surprises behind it.
We built two servers, pointed Grafana Alloy at them, and pushed two million access log lines through to find where Loki throttles, how much disk it really takes and which errors you will meet. Every command and output below comes from Rocky Linux 10.2 and AlmaLinux 10.3 in December 2026, with Loki 3.7.11, Alloy 1.22.0 and Grafana 13.3.2 from the Grafana RPM repository, and SELinux enforcing on both.
Check the lab and what you need
The lab is one Loki server and one remote agent, which is the smallest layout that still tests the network path, the firewall and two distros. loki01 runs Loki, Alloy, logcli and Grafana. loki02 got its own Loki install to prove the steps on AlmaLinux, then an Alloy agent that ships its journal to loki01 across the network.

Only port 3100 crosses the network. gRPC on 9096 is Loki talking to itself, and Grafana on 3000 stays local until you decide who should reach it, so the firewall section later opens exactly one port.
| Host | OS | Role | Size |
|---|---|---|---|
| loki01 (10.0.1.50) | Rocky Linux 10.2 | Loki server, Alloy, logcli, Grafana | 2 vCPU, 7.6 GB RAM, 30 GB disk |
| loki02 (10.0.1.51) | AlmaLinux 10.3 | Loki install check, remote Alloy agent | 2 vCPU, 7.6 GB RAM, 30 GB disk |
Treat that size as a floor for a single node, not a target. Three things drive the real number, and you should know all three before you order hardware.
- Ingest rate in MB/s at your busiest hour
- Days of retention you have to keep
- How many people run wide queries at once
Our measurements further down give you ratios to plan with, roughly 5.6x compression on web access logs and a write-ahead log that briefly grew larger than the raw data. You also need sudo on each host and outbound HTTPS to rpm.grafana.com, because every package in this guide comes from there.
Add the Grafana RPM repository
Loki, logcli, Alloy and Grafana all ship from one signed repository, so a single repo file covers the whole guide and upgrades later arrive through plain dnf upgrade. Create it on every host that gets a Grafana package.
sudo vim /etc/yum.repos.d/grafana.repo
Paste these lines and save the file.
[grafana]
name=grafana
baseurl=https://rpm.grafana.com
repo_gpgcheck=1
enabled=1
gpgcheck=1
gpgkey=https://rpm.grafana.com/gpg.key
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
With repo_gpgcheck=1 set, dnf checks the repository metadata as well as each package, and it imports the Grafana Labs key the first time you install. Compare the fingerprint it prints with the one in the next section before you trust it, because that import is the only moment the key gets checked by a human.
Install Loki and logcli
Install the server and the command line client together. logcli is a separate package, and it is the quickest way to prove that logs actually land without opening a browser.
sudo dnf install -y loki logcli
On loki01 the key import and the scriptlet output looked like this, trimmed to the lines worth reading.
Importing GPG key 0x10458545:
Userid : "Grafana Labs <[email protected]>"
Fingerprint: B53A E77B ADB6 30A6 8304 6005 963F A277 1045 8545
From : https://rpm.grafana.com/gpg.key
Key imported successfully
...
Installing : loki-3.7.11-1.x86_64 1/1
Running scriptlet: loki-3.7.11-1.x86_64 1/1
Post Install of a clean install
Reload the service unit from disk
Unmask the service
Set the preset flag for the service unit
Set the enabled flag for the service unit
Created symlink '/etc/systemd/system/multi-user.target.wants/loki.service' → '/etc/systemd/system/loki.service'.
That scriptlet does more than enable the unit. It also runs systemctl restart loki, so Loki is already accepting pushes when the install finishes, using the packaged /etc/loki/config.yml. The package is tiny in file count (the binary, that config and a unit that runs as the loki user), which means everything else in this guide is yours to create.

The packaged config is a demo, and it shows. It sets path_prefix: /tmp/loki, stores chunks and rules under /tmp/loki as well, and runs at log_level: debug, which writes ring lookups to the journal every second. systemd-tmpfiles on both distros carries q /tmp 1777 root root 10d, and nothing in the package creates /var/lib/loki. So you replace the config before any real data goes in, not after.
Write a config that keeps data on disk
Create the data directory first and hand it to the loki user. It inherits the standard var_lib_t SELinux label from /var/lib, which is all Loki needs, so there is no semanage fcontext step here.
sudo mkdir -p /var/lib/loki
sudo chown loki:loki /var/lib/loki
ls -ldZ /var/lib/loki
The listing confirms the owner and the label.
drwxr-xr-x. 2 loki loki unconfined_u:object_r:var_lib_t:s0 6 Dec 2 14:28 /var/lib/loki
Now open the packaged config, delete everything in it and paste the config we ran for the second benchmark pass.
sudo vim /etc/loki/config.yml
This is the exact file from loki01.
auth_enabled: false
server:
http_listen_port: 3100
grpc_listen_port: 9096
log_level: info
common:
instance_addr: 127.0.0.1
path_prefix: /var/lib/loki
storage:
filesystem:
chunks_directory: /var/lib/loki/chunks
rules_directory: /var/lib/loki/rules
replication_factor: 1
ring:
kvstore:
store: inmemory
schema_config:
configs:
- from: 2024-01-01
store: tsdb
object_store: filesystem
schema: v13
index:
prefix: index_
period: 24h
limits_config:
retention_period: 744h
reject_old_samples: true
reject_old_samples_max_age: 168h
ingestion_rate_mb: 16
ingestion_burst_size_mb: 32
compactor:
working_directory: /var/lib/loki/compactor
compaction_interval: 10m
retention_enabled: true
retention_delete_delay: 2h
delete_request_store: filesystem
analytics:
reporting_enabled: false
Most of it is boilerplate for a single node, but four settings carry real weight, and each one traces back to something that bit us in the lab.
retention_period: 744hkeeps 31 daysdelete_request_store: filesystemis required once retention is oningestion_rate_mb: 16with a 32 MB burst replaces the 4 and 6 defaultsreject_old_samples_max_age: 168hrefuses lines older than 7 days
Retention only works with a 24h index period, which the schema block already sets, so leave that alone even if you change everything else. The default ingest limits throttled our first 186 MB push, which the benchmark section shows in detail. If your agents are quiet you can keep the defaults, but you will want to know the number before a noisy service finds it for you. One packaged setting we left out is pattern_ingester, which the demo config turns on. It feeds the patterns view in Grafana’s Logs Drilldown, so add pattern_ingester: with enabled: true at the top level if you use that view.
Validate the config before the restart
Run Loki’s own validator as the loki user. The service reads the file as that user, and on our hosts the config was root:loki mode 0640, so a plain run from your login fails on permissions and tells you nothing about the YAML.
sudo -u loki loki -config.file=/etc/loki/config.yml -verify-config
A clean file returns one line and exit code 0.
level=info ts=2026-12-02T14:34:00.7537282Z caller=main.go:109 msg="config is valid"
We also fed it a copy without delete_request_store to see what a broken file looks like. It exits 1 with the compactor error in the first command below, which is far better than finding the same message in a systemd restart loop at 2 a.m.

The validator has a blind spot worth knowing. retention_period: 12h passed it, and Loki then ran on it without a single warning. Loki’s retention documentation explains why, because the 24 hour minimum applies only to per-stream retention_stream rules, not the global period. A typo of h for d therefore goes through silently, so read the number back after every edit.
Restart Loki and wait for ready
Use restart, not enable --now. The scriptlet already enabled and started the service, so enable --now does nothing and Loki stays on the /tmp config, which is exactly what happened on loki02 for about five minutes until we noticed.
sudo systemctl restart loki
curl -s localhost:3100/ready
For roughly 15 seconds the ready endpoint answers with a wait message instead of ready. That’s the ingester settling into its ring, not a fault, and our hosts reported ready between 18 and 30 seconds after the restart. Once it is ready, sudo rm -rf /tmp/loki removes what the demo config wrote, since nothing reads it any more.
Ingester not ready: waiting for 15s after being ready
Once it reports ready, check the unit, the listening sockets and the build in one go.
systemctl status loki --no-pager
sudo ss -tlnp | grep loki
curl -s localhost:3100/loki/api/v1/status/buildinfo
A healthy Loki shows active (running) and two sockets, 3100 for HTTP and 9096 for gRPC, both bound on all interfaces. Startup itself took 267 ms, so if you’re waiting much longer than 30 seconds for ready, read the journal instead of waiting more.

The build info call returns the version the RPM installed, which is handy when you script upgrades across a fleet.
{"version":"3.7.11","revision":"56f8c86a","branch":"release-3.7.x","buildUser":"root@e08f4a1011a9","buildDate":"2026-11-27T13:38:57Z","goVersion":""}
That revision matches the Loki 3.7.11 release. The same install, config and restart ran unchanged on AlmaLinux 10.3, and the only difference we found was the loki user’s UID (994 instead of 995), which you will never need.
Leave SELinux enforcing
Older guides, the earlier version of this one included, add ports 3100 and 9096 to http_port_t with semanage. Our lab shows that step does nothing useful, because the RPM binary is labelled bin_t and systemd runs it in the unconfined_service_t domain, which SELinux does not restrict on ports or paths. You can confirm the domain yourself.
ps -eZ | grep loki
ls -Z /usr/bin/loki
Both hosts reported the same contexts.
system_u:system_r:unconfined_service_t:s0 6568 ? 00:00:00 loki
system_u:object_r:bin_t:s0 /usr/bin/loki
Then look for denials after Loki has been running and ingesting for a while, since a denial only shows up when the blocked action actually happens.
sudo ausearch -m avc -ts recent
Nothing came back on either host.
<no matches>
A minimal Rocky or AlmaLinux install doesn’t even ship semanage (it lives in policycoreutils-python-utils), and with the service unconfined there’s no port label to add. Skip those steps. If you ever see an AVC that names loki, read it before you change policy, because on a stock install there were none and a new one means something changed.
Open port 3100 in firewalld
Only remote Alloy agents and a Grafana on another host need port 3100, so if everything lives on one box you can skip this section. Otherwise check which zone your interface sits in first, because a rule added to the wrong zone does nothing.
sudo firewall-cmd --get-active-zones
A stock install uses public. Our cloud images shipped with trusted as the default zone, which accepts everything, so port 3100 answered loki02 before we touched the firewall at all. If you see trusted, your Loki is open to the whole network whatever you add, so switch the default zone to public first. Check the next paragraph before you do it on a remote box.
sudo firewall-cmd --set-default-zone=public
sudo firewall-cmd --list-services
On loki01 public allowed only cockpit dhcpv6-client ssh, so SSH on port 22 survives the switch. If your sshd listens on another port, add that port to public before switching, or the change locks you out and only the console gets you back. Run sudo firewall-cmd --get-active-zones again afterwards, because a NetworkManager connection pinned to trusted keeps eth0 there; ours showed public (default) with interfaces: eth0. With eth0 in public, a request from loki02 failed in a millisecond.
curl: (7) Failed to connect to 10.0.1.50 port 3100 after 1 ms: Could not connect to server
Add the port permanently to the zone, reload, and confirm it’s listed.
sudo firewall-cmd --permanent --zone=public --add-port=3100/tcp
sudo firewall-cmd --reload
sudo firewall-cmd --zone=public --list-ports
Each command answered success and the list shows the port.

Run the same check from the remote host again to prove the path end to end.
curl -s -m 5 http://10.0.1.50:3100/ready
It now returns ready. Leave 9096 closed, because a single-node Loki only uses gRPC between its own components, and an open gRPC port is one more thing someone can probe.
Ship logs with Grafana Alloy
Alloy is the agent Grafana now recommends for pushing logs, and it installs from the same repo. On loki01 it reads the systemd journal, the two main rsyslog files and a test directory we used for the benchmark. Our Alloy install guide for Rocky and AlmaLinux covers its metrics side, so here you only need the log pipeline.
sudo dnf install -y alloy
sudo vim /etc/alloy/config.alloy
Replace the sample with this pipeline. It turns two journal fields into unit and level labels and stamps every line with host, so you can tell the servers apart once a second one joins. Drop the /var/log/loadgen line unless you want to repeat our benchmark.
loki.relabel "journal" {
forward_to = []
rule {
source_labels = ["__journal__systemd_unit"]
target_label = "unit"
}
rule {
source_labels = ["__journal_priority_keyword"]
target_label = "level"
}
}
loki.source.journal "system" {
max_age = "12h"
relabel_rules = loki.relabel.journal.rules
labels = {job = "journal"}
forward_to = [loki.write.local.receiver]
}
local.file_match "varlogs" {
path_targets = [
{__path__ = "/var/log/messages", job = "varlogs"},
{__path__ = "/var/log/secure", job = "varlogs"},
{__path__ = "/var/log/loadgen/*.log", job = "varlogs"},
]
}
loki.source.file "varlogs" {
targets = local.file_match.varlogs.targets
forward_to = [loki.write.local.receiver]
}
loki.write "local" {
endpoint {
url = "http://127.0.0.1:3100/loki/api/v1/push"
}
external_labels = {
host = "loki01",
}
}
Run sudo alloy fmt /etc/alloy/config.alloy to check the syntax. It needs sudo because /etc/alloy is root:alloy mode 0770, and without it you get a permission error instead of a syntax check. Then start the agent and look straight for errors.
sudo systemctl enable --now alloy
sudo journalctl -u alloy --no-pager | grep -i error
The journal source worked at once because the package adds the alloy user to the systemd-journal and adm groups. The two files did not, since rsyslog on Rocky 10 creates both as root:root mode 0600 and group membership can’t get past that.

A chgrp adm and chmod 640 on both files stops the errors, but only until the next rotation. We forced one with sudo logrotate -f /etc/logrotate.d/rsyslog to check, the new files came back as 0600 root, and Alloy logged unable to open file /var/log/secure: open /var/log/secure: permission denied again. Left alone, that would break collection silently every week. The durable fix is to make logrotate create the files readable by adm, so open its rsyslog file.
sudo vim /etc/logrotate.d/rsyslog
Add the create line as the first line inside the braces.
/var/log/cron
/var/log/maillog
/var/log/messages
/var/log/secure
/var/log/spooler
{
create 0640 root adm
missingok
sharedscripts
postrotate
/usr/bin/systemctl reload rsyslog.service >/dev/null 2>&1 || true
endscript
}
That only affects files created at the next rotation, so fix the two current files once by hand and restart Alloy.
sudo chgrp adm /var/log/messages /var/log/secure
sudo chmod 640 /var/log/messages /var/log/secure
sudo systemctl restart alloy
After another forced rotation the files were root:adm 0640 and Alloy logged zero permission errors. Now ask Loki which labels it has received.
curl -s localhost:3100/loki/api/v1/labels
Look at service_name in the answer. We never set it, because Loki derives it from job when a stream doesn’t carry a service name of its own, and you’ll see it offered in Grafana’s label picker.
{"status":"success","data":["filename","host","job","level","service_name","unit"]}
The agent on loki02 is shorter. It ships only the journal, and its writer points at loki01 instead of localhost.
loki.relabel "journal" {
forward_to = []
rule {
source_labels = ["__journal__systemd_unit"]
target_label = "unit"
}
rule {
source_labels = ["__journal_priority_keyword"]
target_label = "level"
}
}
loki.source.journal "system" {
max_age = "12h"
relabel_rules = loki.relabel.journal.rules
labels = {job = "journal"}
forward_to = [loki.write.remote.receiver]
}
loki.write "remote" {
endpoint {
url = "http://10.0.1.50:3100/loki/api/v1/push"
}
external_labels = {
host = "loki02",
}
}
Twenty-five seconds after systemctl enable --now alloy on loki02, a host label query on loki01 listed both servers.
{"status":"success","data":["loki01","loki02"]}
That remote push only works because port 3100 is open. If loki02 ever goes quiet, test the port from loki02 with curl before you suspect Alloy, because a closed port and a broken pipeline look identical from the Grafana side.
Query logs with logcli
Point logcli at the server once per shell, then list labels, filter lines and run a metric query. The --quiet flag drops the request URL that logcli otherwise prints to stderr on every call.
export LOKI_ADDR=http://localhost:3100
logcli labels job --quiet
logcli query '{filename="/var/log/secure"} |= "nobody"' --limit 3 --since 30m --quiet
logcli instant-query 'sum by (host) (count_over_time({job="journal"}[1h]))' --quiet
The nobody lines are failed SSH logins we triggered on purpose so the filter had something to find. The instant query counts journal lines per host over the last hour.

loki02 sent three times as many journal lines as loki01, and the reason is worth a minute. It ran on the packaged debug config for about five minutes before we restarted it, every debug line went into its journal, and Alloy’s 12 hour max_age shipped the lot to loki01. The test job comes from the old timestamp test in the troubleshooting section.
Don’t trust logcli stats on fresh data. Over the last hour it returned 0 bytes, 0 chunks and 0 streams while queries were returning thousands of lines, because stats read the index and recent data was still in the ingester’s memory. Use count_over_time when you need a number you can believe.
Connect Grafana with a provisioned data source
Skip the clicking and write a provisioning file, which adds Loki to Grafana at startup and survives a rebuild. If Grafana isn’t installed yet, the Prometheus and Grafana guide for Rocky and AlmaLinux covers it, and from this repo it’s one sudo dnf install -y grafana.
sudo vim /etc/grafana/provisioning/datasources/loki.yaml
Use localhost when Grafana and Loki share a host, as on loki01, and Loki’s address in url otherwise. The fixed uid gives scripts and the health check below a stable name to call.
apiVersion: 1
datasources:
- name: Loki
type: loki
uid: loki
access: proxy
url: http://localhost:3100
jsonData:
maxLines: 1000
Give the file to the grafana group and start Grafana so it reads the file at boot.
sudo chown root:grafana /etc/grafana/provisioning/datasources/loki.yaml
sudo chmod 640 /etc/grafana/provisioning/datasources/loki.yaml
sudo systemctl enable --now grafana-server
Grafana’s own log records the insert, and the health API runs the same test as the Save and test button in the UI. A fresh install logs in as admin with password admin until you change it.
sudo journalctl -u grafana-server --no-pager | grep provisioning.datasources
curl -s -u admin:admin http://localhost:3000/api/datasources/uid/loki/health
Both answers came back clean on loki01.
Dec 02 14:58:38 loki01 grafana[11281]: logger=provisioning.datasources t=2026-12-02T14:58:38.888565888Z level=info msg="inserting datasource from configuration" name=Loki uid=loki
{"message":"Data source successfully connected.","status":"OK"}
Change the admin password before you open port 3000 to anyone, because the default is the first thing a scanner tries. From here, Explore in Grafana runs the same LogQL you just ran with logcli.
Measure ingest speed and disk use
We wanted numbers you can plan with, so we wrote one million nginx-style access log lines (185,792,580 bytes, about 186 bytes each) into /var/log/loadgen/ and let Alloy tail them into Loki on loki01. The first pass ran at Loki’s default limits and the second at 16 MB/s with a 32 MB burst. The defaults came straight from curl -s "localhost:3100/config?mode=defaults".
ingestion_rate_strategy: global
ingestion_rate_mb: 4
ingestion_burst_size_mb: 6
Every line arrived in both runs, which we confirmed afterwards with count_over_time per file. What changed was how long it took and how much noise it made.
| Measurement | Run 1 (4 MB/s, burst 6 MB) | Run 2 (16 MB/s, burst 32 MB) |
|---|---|---|
| Lines sent / accepted | 1,000,000 / 1,000,000 | 1,000,000 / 1,000,000 |
| Time to ingest | 41 s window of 429 responses | 20.1 s, including file discovery |
| Throughput | held at the 4 MB/s limit | about 49,800 lines/s, 9.2 MB/s |
| HTTP 429 responses to Alloy | 40 | 0 |
| Lines dropped by Alloy | 0 | 0 |
Loki discarded_samples (rate_limited) | 213,116 (retried later) | 0 |
The rate limiter did its job without losing data. Each throttled batch got a 429, Alloy backed off and resent it, and Loki’s discarded counter tallied the rejected attempts rather than lost lines. If you alert on that counter alone, you’ll think a fifth of your data vanished when none did, so pair it with Alloy’s own dropped entries count.

The 2 vCPU box was not the bottleneck in run 2, but disk gave us the real surprise. Right after both runs and a /flush, the write-ahead log was larger than all the raw data put together.

Twelve minutes later the WAL checkpoint ran and the directory settled at 66 MB. A disk sized for the settled figure would have filled during the burst, so size for the peak.
| Item | Measured |
|---|---|
| Raw log data | 371.6 MB (2,000,000 lines) |
| Chunks on disk | 66.8 MB in 397 files, about 5.6x compression |
| WAL right after the runs | 431.6 MB (463M in du -sh) |
| WAL after checkpoint | 348 KB |
| TSDB index, index cache and compactor files | 164 KB |
| Loki RSS after the runs / settled | about 385 MiB / 370 MiB |
| Alloy RSS after the runs / settled | about 316 MiB / 300 MiB |
Query speed on those two million lines held up well for one node on local disk. A line filter that returns 1,000 matches is the fast path, while anything that parses every line costs seconds.
| Query over 2M lines (1h range) | Time |
|---|---|
Line filter |= "POST /api/login", limit 1000 | 0.24 s cold, 0.22 s warm |
| Count of 5xx lines with a regex line filter | 1.89 s |
Total count_over_time | 3.19 s |
Count by status code with regexp extraction | 5.07 s |
Our verdict is to keep labels few and push filtering into line filters wherever you can, because the regexp breakdown cost twenty times the plain filter. Plan disk at roughly raw size for the WAL burst plus about a sixth of a day’s raw volume for each day of chunks you keep.
Confirm retention actually runs
Retention is the compactor’s job, and it does not start right away. After every restart it logs waiting 10m0s for ring to stay stable and previous compactions to finish before starting compactor, so a check in the first ten minutes tells you nothing. After that, read the compactor metrics.
curl -s localhost:3100/metrics | grep -E '^loki_compactor_apply_retention_(operation_total|last_successful)'
A successful pass shows up as a success counter and a fresh Unix timestamp. If the counter shows failures or the timestamp stops moving, the compactor is stuck and your disk will keep growing past the retention window.
loki_compactor_apply_retention_last_successful_run_timestamp_seconds 1.7962231392724817e+09
loki_compactor_apply_retention_operation_total{status="success"} 1
The /config endpoint shows what Loki filled in around your settings, and it is worth a look because one value differs from what you wrote.
curl -s localhost:3100/config | grep -A6 '^compactor:'
These are the first lines of the compactor block from loki01.
compactor:
working_directory: /var/lib/loki/compactor
compaction_interval: 10m0s
apply_retention_interval: 15m0s
retention_enabled: true
retention_delete_delay: 2h0m0s
retention_delete_worker_count: 150
Retention runs every 15 minutes, not 10. When apply_retention_interval is unset it follows the compaction interval, and Loki then adds half of it (capped at 10 minutes) so the two jobs don’t start together. Marked chunks are then deleted two hours later (retention_delete_delay), so disk usage drops in steps rather than the moment data turns 31 days old. Don’t panic if du lags the calendar by a few hours.
Fix the errors we hit
Every message below appeared in the lab, and the headings keep the part of each one you’d paste into a search box. The Alloy permission error has its own fix in the Alloy section above.
compactor.delete-request-store should be configured when retention is enabled
You turned on retention_enabled without telling the compactor where to keep delete requests, and Loki refuses to start rather than guess. Add delete_request_store: filesystem under compactor for a single node, then rerun -verify-config before the restart so you know the next start will stick.
failed parsing config: open /etc/loki/config.yml: permission denied
This came from running loki -verify-config as our own login on loki02. The config is readable only by root and the loki group, which is right for a file that may later hold object storage credentials. Run the check with sudo -u loki instead of loosening the mode, because that also tests what the service itself will see.
Ingester not ready: waiting for 15s after being ready
Not an error. The ingester holds off for 15 seconds after it joins the ring, so a health check or deploy script that hits /ready straight after a restart will fail if it doesn’t retry. Let it retry for at least 30 seconds, which covered every restart in our lab.
ingestion rate limit exceeded for user fake (limit: 4194304 bytes/sec)
The tenant is called fake because auth_enabled is false, and 4194304 bytes is the default 4 MB/s. Alloy retries 429s, so nothing was lost during our burst, but a source that outruns the limit for hours keeps Alloy retrying and its backlog growing. Raise ingestion_rate_mb and ingestion_burst_size_mb above your measured peak and restart Loki.
POST /loki/api/v1/push (500) Response: empty ring
Loki logged five of these while it restarted with the new limits, and Alloy’s metrics counted five HTTP 500s to match. Pushes that arrive before the ingester rejoins the ring get a 500, and Alloy retries them once the ring is back. Expect a handful per restart, but a steady stream means the ingester isn’t coming up, so go to the journal.
entry for stream has timestamp too old
We pushed one line stamped ten days back to /loki/api/v1/push with curl. Loki answered HTTP 400 and named the cutoff, which is the current time minus reject_old_samples_max_age.
entry for stream '{job="test", service_name="test"}' has timestamp too old: 2026-11-22T14:39:05Z, oldest acceptable timestamp is: 2026-11-25T14:39:05Z
HTTP 400
You will hit this when backfilling old files or when an agent’s clock has drifted. For a one-off import, raise reject_old_samples_max_age and put it back afterwards. For a clock problem, fix chrony on the sender, because raising the limit only hides it.
Harden it before real traffic
You now have a single-node Loki that keeps 31 days, survives reboots and takes pushes from a second host. The lab made four gaps obvious, and each one is cheaper to close now than after the first incident.
- Restrict port 3100 to the agents’ subnet, or front it with an authenticating proxy
- Put
/var/lib/lokion its own volume, sized for the WAL peak - Set ingest limits from your own measured peak
- Ship the
create 0640 root admlogrotate change to every tailed host
The first one matters most, because with auth_enabled: false anyone who reaches port 3100 can push and read every log you store. When one box stops being enough, the same config ideas carry over to Loki on Kubernetes with object storage. On these hosts, Grafana Tempo and Grafana Mimir add traces and metrics, and the observability stack with SLOs and error budgets shows the alerting layer on top. Running Debian instead? The Ubuntu and Debian Loki guide follows the same layout.