Checking Loki configuration changes between versions

Comparing the effective configuration of your running and target Loki versions with -print-config-stderr shows changed defaults and removed options before they reach production.

On this page

Why checking Loki configuration changes between versions comes before every upgrade

Before you move a Loki cluster from an older version to a target version, compare the effective configuration of both versions with -print-config-stderr. Running each version's binary or image with that flag prints the full configuration Loki actually resolves, including defaults that the files you wrote never mention. Diffing the two outputs shows which defaults changed, which options were renamed or removed, and which settings now behave differently, so you can address them in a development environment before any production node restarts.

Loki's upgrade guide recommends upgrading sequentially rather than jumping straight to the newest release, and it advises testing any skipped versions in development first. Both recommendations matter for configuration. Each intermediate version can change defaults or remove options, and a diff between your current version and the final target hides the steps in between. Plan the upgrade path as a list of versions, and run the comparison for each hop that your environment will pass through.

A review of your own configuration files misses much of this risk. Your files list only the settings you chose, so a default that changed in the new version never appears in the diff of your repository, and a removed option may still parse without error while doing nothing. Ask your team to confirm which version of the configuration file is in use, to keep the printed output from both versions with the upgrade record, and to check that the effective settings match what the change plan expects before the rollout starts.

How to produce and compare the effective Loki configuration

This sequence dumps the full effective configuration of the running and target Loki versions, so you can read every changed default and removed option before the upgrade reaches production. The result is a diff file that goes into the change record.

  1. Confirm the invocation and image tags

    The platform or upgrade lead checks the exact container invocation, image tags and flag syntax for the -print-config-stderr option against the official upgrade guide for your source and target versions. Record the current running tag and the intended target tag, and confirm that the target image is the release you plan to deploy, not a weekly or development build. Done when both tags and the command are written in the change ticket and reviewed by a second engineer.

  2. Prepare the same configuration inputs for both runs

    Gather the Loki configuration file, environment variables and any command-line overrides that the running cluster uses, and mount them identically for each image. Keep the storage backend, auth settings and tenant limits identical so that the only variable is the version. Do not use real credentials in the captured output: confirm that secrets are passed through references or redacted before any file is shared. Done when a dry start of each image reads the same input file without errors.

  3. Dump the running version's effective configuration

    Run the current image with the -print-config-stderr flag, using your configuration file, and redirect standard error to a named file such as loki-current-effective.yaml. The output shows the full effective configuration, including defaults that your file never mentions. Done when the file contains a complete configuration document and the process exits without starting serving traffic.

  4. Dump the target version's effective configuration

    Run the target image with the same flag and the same input files, redirecting standard error to a second file such as loki-target-effective.yaml. Keep the two runs in the same environment so that host-specific values do not differ between them. Done when the second file exists, is complete, and its header or version context matches the target tag you recorded.

  5. Compare the two outputs and sort the changes

    Run a text diff on the two files and group each change as a new default, a changed default, a renamed or removed key, or a value that your own configuration sets explicitly. Changes to keys you do not set are the ones that are easy to miss, because they take effect without any edit on your side. Done when every differing block has a category and an owner who will decide whether it needs action.

  6. Map each change to a required action

    For each category, decide whether to keep the new default, pin the previous value in your configuration, or remove a key that the target version no longer accepts. Cross-check removed or renamed items against the upgrade guide and any release notes for the versions in between, and confirm limit changes with the storage and tenant owners. Done when each change has a recorded decision, and any change that could reject or drop logs is flagged for a test.

  7. Store the diff with the change record

    Save both captured files, the diff output, the decision log and the exact image tags and command in the change record for the upgrade, in the version control or document system your organization uses for infrastructure changes. Remove any secrets from the stored files before saving. Done when an auditor or a later engineer can reproduce the comparison from the record without access to the original host.

Which configuration changes to look for in the diff

This table lists the categories of change a configuration diff between two Loki versions can reveal, with the effect each one has on a running cluster and the action to take. Use it as a checklist when reading the diff output, then confirm each specific changed key against the upgrade guide for your target version.

Change categoryImpact on a running clusterAction to take
Changed default valuesA setting you never wrote may now take a different value, so behavior changes after restart even though your config file is untouched.Find each changed default in the diff, compare it with your effective running value, and set it explicitly in your config if the behavior matters to you.
Removed optionsLoki may ignore or refuse to start with a key that no longer exists, and the effect can look like a silent loss of a feature.Remove the key from your config, find its replacement in the upgrade guide, and confirm the replacement with a test rollout in development.
Renamed optionsThe old key may be ignored while the new key falls back to its default, which can change ingestion, storage or retention behavior.Map each old key to its new name, set the new key with your intended value, and check the effective config again after the change.
Options that now require a different valueStartup can fail, or a component can run with a setting that conflicts with your storage or index layout.Confirm the allowed values for the target version, update your config, and verify the schema and storage settings before promoting the change.
New options that take effect by defaultNew limits, features or clients can start working as soon as the new version runs, including limits that reject logs that were accepted before.Review every new default in the diff against your traffic, set limits deliberately, and monitor rejected lines during the first days after the upgrade.
Settings tied to deprecated stores or modesDeprecated index stores and the simple scalable mode are on the removal path, so a diff may show options that a later major release will drop.Record these settings for planning, check the upgrade guide for the planned removal version, and schedule the change before that release.

What to prepare before running the diff

The diff is only as useful as the inputs behind it. These six items give you a baseline to compare against, a list of settings that deserve attention, a way back if something goes wrong, and a place to test the result before production sees it.

Live configuration under version control

Export the configuration that the running cluster actually loads, including every file passed with -config.file and any runtime overrides, and commit it to your infrastructure repository. The diff compares effective settings, but you need a dated copy of what production used today so you can explain any difference later. Check that the export matches what the running process reports, not only what is stored in your templates.

Loki upgrade guide

Inventory of custom settings and overrides

List every setting your team has changed from defaults, including limits, retention rules, compactor options, storage clients and per-tenant overrides. Record who set each one and why. This list becomes your review checklist: each entry should be marked as kept, changed or removed once the diff shows what the target version does with it. Settings nobody can explain are the first candidates for review.

Object storage and index backups

Loki keeps its chunks and index in object storage, so a rollback after a failed schema or storage change depends on data you can restore. Confirm that your bucket has versioning, replication or a recent copy, and that someone has tested restoring a sample of objects. Ask your storage provider how retention and lifecycle rules interact with backups, because a lifecycle rule can remove data your backup plan assumed was still there.

Staging environment that mirrors storage

Prepare a non-production Loki that uses the same deployment mode, index store and object storage type as production, even if the data set is smaller. A test against filesystem storage will not reveal problems that appear with S3-compatible or cloud object stores. Load a representative sample of logs, run your usual queries and confirm that ingestion, retention and Grafana dashboards behave the same before the target version reaches production.

Upgrade guide for the target version

Download the upgrade notes for the exact version you plan to reach, and read every section between your current version and the target. The guide names configuration keys that changed, defaults that moved and steps that must happen in a particular order. Record which items apply to your deployment, because the diff shows what changed in the binary but not the operational steps the project expects you to take.

Upgrade path and test plan

Write down the sequence of versions you will pass through, the skipped versions you will test in development first, and the owner for each sign-off. The project recommends sequential upgrades, so a jump across several releases needs its own test run. Agree on the rollback point for each step and on the signals that will stop the rollout, such as ingestion errors or query latency above your baseline.

How the diff review differs by deployment mode and object store

Monolithic mode runs Loki as a single binary and is documented for deployments up to about 20 GB of logs per day. Its effective configuration is the smallest of the three modes, so the diff is usually short, but it still includes the storage, schema and limits blocks that every version can change. Because there is one process, a single changed default affects the whole system at once.

  • Storage block: Check the common and storage sections, since the object store settings are where a single-node setup most often differs from the defaults.
  • Schema config: Compare schema_config entries, including the index store type and schema version, against what the running version reports.
  • Limits: Review limits_config defaults, because new limits can reject logs on ingestion even when nothing else changes.
  • Compactor and retention: Confirm whether retention_enabled is set in the target configuration, since retention is off by default.
  • Auth settings: Check auth_enabled and how tenant headers are handled, because Loki has no built-in authentication layer.

Confirm the exact key names and defaults for your target version in its documentation before you edit any file.

What to do with each finding before the upgrade

Sort every difference from the -print-config-stderr diff into one of three groups before anyone edits a file. The first group is changes that need an explicit config update: a key that was renamed, moved or removed, or a value your current file sets that the target version no longer reads the same way. These go into your target values file or config with a named owner. The second group is changes that are safe to accept: a default that changed for a setting you never override and that does not affect your data, such as a cache or internal tuning value. Record why it is safe, because a reviewer will ask. The third group is changes that block the upgrade until someone decides: anything that can reject writes, delete data or alter query results. Limits that refuse logs and retention behavior are the usual examples. Do not accept these by default.

Retention needs particular care. Loki retention is disabled by default, so logs are kept indefinitely until retention_enabled is set, and it is applied by the compactor. If the target version changes any default in the compactor, limits or retention blocks, you must confirm whether retention is still off, what it is set to per tenant or per stream selector, and whether a new default would start deleting data your compliance team expects to keep. Record each retention decision in the change ticket with the value, the tenant or selector it applies to, and the approver, typically the platform owner together with the security or compliance owner of the logs. Ask the same question for any setting that governs deletion or access.

Once edits are made, rerun the diff against the target image and confirm that every remaining difference is one you recorded as accepted or intentionally changed. Keep both outputs with the decision log so the final configuration is traceable. Store the target configuration in version control, and have the sign-off recorded by the person who owns each group. The Loki upgrade guide recommends testing skipped versions in development first, so run the rerun against that development environment before production and confirm the final values match what was signed off.

The configuration check and upgrade sequence

The sequence turns the configuration diff into a tested, versioned change set that moves through development, staging and production with a rollback point at each stage, so changed defaults and removed options are found before users are affected.

  1. Capture the running configuration

    Before anything changes, record the effective configuration of the Loki version that runs in production. Run the current image with the -print-config-stderr flag, save the output with the image tag, date and the values files or config files that feed it, and store it in version control next to the deployment code. The step is done when you can name the exact image tag and config source for the baseline, and a second run from the same inputs produces the same output. Ask your platform team to confirm which config inputs are not captured by this output, such as secrets mounted at runtime.

  2. Run the diff for each sequential hop

    Run the same flag against the target image for each minor or major step in the upgrade path, then diff each output against the previous one. The Loki upgrade guide recommends sequential upgrades, so the hops follow the documented path rather than jumping straight to the newest release. Review every changed default, renamed key and removed option, and record the decision for each one: keep, set explicitly, or remove from your config. The check is complete when every difference has a recorded decision and no key is unexplained.

  3. Fix configuration in version control

    Apply the decisions from the diff to the configuration files in a branch, with one commit per hop so each change can be reviewed and reverted on its own. Set explicitly any value whose default changed if your current behavior depends on the old default, and remove options the target version no longer accepts. Have a second engineer review the branch against the diff output. The step is done when regenerating the configuration from the branch produces a diff that matches your recorded decisions exactly.

  4. Test in development, including skipped versions

    Deploy the target version in a development environment with a copy of your configuration and a representative sample of production traffic or replayed logs. If the upgrade skips any versions, test each skipped version in development as well, since the upgrade guide recommends this before moving production. Confirm that ingestion, queries, retention and authentication behave as before, and check the logs for startup warnings. The step is complete when each tested version passes the same checks and every warning has an owner and a decision.

  5. Take a rollback point before each change

    Before every staging or production change, take a backup of the object storage bucket and index state, export the current configuration and image tags, and record the exact versions that can be restored. Confirm the backup can be read back, not just that the job finished. Agree in advance who makes the rollback call and what evidence triggers it. The step is done when the rollback point is recorded and a restore test has been run against a non-production target.

  6. Promote to staging and verify

    Apply the reviewed configuration and target image to a staging environment that mirrors production topology, using the same rollback point procedure. Run the same ingestion, query, retention and access checks used in development, and compare the staging output of the configuration command with the diff you approved. The step is complete when staging matches the approved diff, the checks pass, and no unexpected configuration key appears in the runtime output.

  7. Promote to production with a rollback point

    Repeat the rollback point step immediately before the production change, then apply the same configuration and image in a controlled window with monitoring open. Watch ingestion errors, query latency, compactor activity and authentication failures during and after the rollout. Keep the rollback point until the cluster has run cleanly through a full retention and compaction cycle that your team has confirmed. The step is done when production matches the approved diff, the monitoring checks are clean, and the configuration baseline in version control is updated to the new version.

Diff the running and target configurations before any upgrade step

The diagram starts with two captures: the effective configuration of the running Loki image and of the target image, each produced with -print-config-stderr. The diff feeds a review where each change is accepted, turned into a configuration update or treated as a blocker. Accepted changes move to a development test, and a failed test returns to review. The branch that keeps the running version is the rollback point, because nothing has reached production yet. When the upgrade spans more than one version, the sequential-hop check repeats the cycle for the next version before the target is promoted.

The config diff gates each upgrade hop before production promotion.

What makes the configuration review take longer

This table lists the factors that stretch a Loki configuration comparison between versions and what each one means for the work. Read each row as a question to answer about your own environment before estimating the review. The main takeaway is that the number of custom overrides, the number of upgrade hops and the absence of a test environment usually matter most.

DriverEffect on effortWhat to confirm in your environment
Number of custom overridesEach non-default setting in the rendered config must be matched against the target version, so effort grows with every override.Count the settings you set explicitly, including limits, storage and compactor blocks, and any raw config passed to the chart.
Deployment mode and component countMonolithic runs one target to compare, while simple scalable and microservices modes multiply the config paths to diff per component.Confirm which mode you run and whether read, write and backend targets, or separate microservice components, each have their own config.
Helm values or raw config filesHelm users must render templates and diff the values and rendered output, which adds a step compared with editing a config file directly.Identify where the source of truth lives, the chart version in use and whether values are overridden in several places.
Sequential upgrade hopsEach skipped minor or major version adds a diff, and the upgrade guide recommends sequential upgrades, so more hops mean more comparisons.List the current and target versions and every release between them, then decide which intermediate diffs you need.
Tenants with per-tenant limitsPer-tenant overrides must be checked against new default limits, since a changed default can reject logs for specific tenants.Export the runtime overrides file and count tenants with custom limits, retention rules or stream selectors.
Existence of a test environmentWithout a test environment, the diff findings cannot be confirmed by running ingestion and queries, so more review time moves into production planning.Confirm whether a non-production cluster runs the same mode, storage backend and configuration, and whether it can ingest realistic traffic.

Questions teams ask before checking Loki configuration changes

Can our in-house team run the Loki configuration diff themselves?

Yes, the method itself is simple enough for an in-house platform or SRE team to run. The upgrade guide describes running each Loki version's Docker image with -print-config-stderr and comparing the full effective configuration the two versions produce. The harder part is interpreting the result: deciding which changed default matters for your deployment, which removed option your configuration still sets, and which change needs a test before a cutover. Teams with a clear owner for Loki configuration and a staging copy of their cluster usually handle this well. Teams that have never run Loki in production should expect to learn the configuration model during the first review.

How much effort does the configuration review take, and what drives it?

The effort depends mainly on how far apart the two versions are, how much of Loki's configuration you have overridden, and how many environments you run. A small single-binary setup with a short, mostly default configuration produces a short diff to read. A multi-tenant cluster with per-tenant limits, custom retention rules and several storage settings produces a longer one, and each override needs a check against the target version. Ask any partner for a fixed-scope quote that names the versions, the number of configuration files and environments, and whether the review includes a test deployment. Those inputs determine the price, not the diff command itself.

What does the team need to provide for the review?

The review needs access to the running configuration, the Loki version it runs, and the target version you plan to move to. It also needs a copy of your configuration files, including any values passed through Helm or environment variables, because the effective configuration printed by Loki reflects them. Add a list of the tenants, limits and retention rules you rely on, plus the object store and index settings, since those are where changes tend to matter most. Someone who can approve changes to production and a non-production environment where the new configuration can start are also needed.

Can we skip Loki versions when upgrading?

The upgrade guide recommends sequential upgrades and advises testing any skipped versions in development first. Skipping a version means the configuration diff covers more changes at once, and each intermediate version may have changed defaults or removed options that you would otherwise see in turn. Before you plan a jump, run the diff from your current version to the target and to each intermediate release, then review the upgrade guide sections for every version in between. Treat a skipped-version upgrade as a larger project with more testing time, not as a single step.

Does the configuration diff replace testing the upgrade?

No. The diff shows what the configuration says and what defaults changed, but it does not show how your workload behaves on the new version. Limits that reject logs, query behavior, storage clients and performance only appear when real ingestion and queries run against the target version. Use the diff to decide what to change and what to test, then run a staging cluster with representative log volume, tenants and dashboards. Keep a rollback plan that includes the storage layout, since some schema changes are not reversible in a simple way.

Which parts of the diff usually carry the most risk?

Changed default values carry the most risk because they take effect without any edit in your files. Removed or renamed options are the next concern, because Loki may ignore or reject them after the upgrade, and the failure can appear only at startup or under load. Storage and index settings deserve close review because they affect where data is written and how it is read. Ask your team to tag each diff line as no action, config change, test required or blocking, and to record the owner and the environment where each item was verified.

When is it worth bringing in a partner for this review?

A partner is worth considering when the review would otherwise compete with production work, when the upgrade spans several versions, or when the cluster carries compliance or tenant commitments that need documented evidence. DeployOpen plans, implements, upgrades, documents and supports self-hosted open-source platforms in your own infrastructure, and most engagements are fixed-scope with scope, deliverables and timelines agreed in writing before work starts. Ask for the written scope to name the configuration files, versions, environments and test steps covered. DeployOpen does not publish a price list, so the quote follows from that scope.

How DeployOpen works on this

DeployOpen treats the configuration diff as a planned, written step in a Loki upgrade rather than a one-off command. We scope which running and target versions are compared, produce the effective configuration for each, and review the differences against your own deployment files before any production change is made.

How we scope

  • Confirm the running Loki version and every target version on the upgrade path, including any skipped versions.
  • Inventory the configuration files, Helm values and container arguments that feed each Loki deployment.
  • Agree in writing which differences count as blocking, which need an owner decision and which are informational.

How we build

  • Run each Loki image with -print-config-stderr and capture the full effective configuration for both versions.
  • Diff the captured output against your live configuration and map each changed default to the settings you actually use.
  • Test the target version in a non-production environment that mirrors your storage, tenancy and limits settings.

How we hand over

  • Deliver a written change register listing each changed default, removed option and renamed key with its required action.
  • Provide updated configuration files with comments explaining each change and the reason it was made.
  • Document the rollback point, the verification queries and the sign-off steps your team needs before production.

How we support

  • Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts.
  • Ongoing support, upgrades and continuous testing for Loki are available as a retainer after handover.
  • Ask for a quote based on the written scope, which sets out the number of versions and environments covered.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.