Migrating Loki to the Thanos object storage clients

Teams running Loki on S3, GCS, Azure or a filesystem need to move to the Thanos-based storage clients before Loki 4.0 makes them the default. This page covers what changes, what maps cleanly, and how to sequence the switch.

On this page

Why moving Loki to the Thanos object storage clients is a config change with real risk

Moving an existing Loki cluster to the Thanos objstore clients is mostly a configuration change, but it touches every component that reads or writes chunks and index files, so the risk lies in the rollout rather than the edit. Loki added these clients in 3.4, and in 3.x they are opt-in through use_thanos_objstore: true. Loki 4.0 makes them the default and deprecates the legacy clients, so a cluster that stays on the old clients will need to move before or during its 4.0 upgrade. The core task is to change storage configuration and roll it out consistently across the write, read and backend paths, plus any compactor or ruler that touches the same bucket.

The risk comes from mixed state. If some components load the new client and others still use the legacy one during a rolling restart, you need to confirm that every component can read data written by the other before you move on. Start by inventorying each pod, container or host that carries the Loki configuration file, including the compactor, since retention deletes objects and a wrong bucket or prefix there can remove data you meant to keep. Confirm the exact configuration keys in the storage client documentation for your Loki version, and test the change in a non-production bucket with a copy of real data before touching production.

Effort depends on how many components share one configuration, whether you run in monolithic, simple scalable or microservices mode, and how many storage backends you operate. Confirm with your platform team how configuration is delivered (Helm values, a shared file or a secret) and how long a rolling restart takes in your environment, since neither is supplied here. The Loki storage client migration guide is the primary reference for the switch and should be read against your exact version before you schedule the change.

Which storage settings map cleanly to the Thanos clients and which need review

This table compares each storage backend Loki uses for chunks and indexes with what changes under the Thanos objstore clients. Read the status column first: backends marked as likely carrying over still need key-by-key confirmation, and rows marked for review should be checked against the migration documentation before you change a running cluster.

Backend or settingStatus under the Thanos clientsWhat to confirm before switching
Amazon S3Recommended production store, likely carries overConfirm region, endpoint, bucket and prefix keys in the migrate storage clients docs before editing values
Google Cloud StorageRecommended production store, likely carries overConfirm bucket and prefix keys and how service account credentials are supplied in the new format
Azure Blob StorageRecommended production store, needs reviewConfirm account, container and authentication settings, since key names may differ from the legacy block
MinIO and other S3-compatible storesSupported, not typically recommended for productionConfirm endpoint, path-style addressing, TLS and insecure flags against the new client settings
Local filesystemSupported, not typically recommended for productionConfirm the directory path and that existing chunk and index files remain readable after the switch
Credentials and identityNeeds review on every backendCheck whether static keys, IAM roles, workload identity or managed identity are supported in the same form
Bucket names and prefixesNeeds review on every backendA changed prefix can make existing objects unreachable, so keep the current path until the migration is verified
Shared config with MimirChanges the review scopeConfirm that shared settings do not force Mimir to change its own storage keys during the same window

How use_thanos_objstore changes the storage configuration

In Loki 3.x, the Thanos-based object storage clients are opt-in. Loki added them in 3.4, and you enable them by setting use_thanos_objstore: true in the storage configuration. Until you set that switch, Loki keeps reading the legacy clients, so the change is a deliberate step rather than something that happens on upgrade. Loki 4.0 uses the Thanos-based clients by default and deprecates the legacy ones, which is why the switch is worth planning for now. The official migration guide at Migrate to Thanos storage clients describes the new layout, and you should read it against the exact Loki version you run before editing anything.

The reason Grafana Labs gives for the change is consistent storage configuration across Loki, Mimir and other Grafana telemetry databases. In practice, the new format lets you describe the bucket for each backend in the same way across those products, so an operator who has configured one of them can recognize the layout in another. The important operational rule is that every component (ingesters, queriers, compactor, index gateway and ruler) must read the same storage block. If the compactor applies retention with one bucket definition while the queriers read another, you get chunks that are written, deleted or never found depending on which component touches them. Before a rollout, compare the storage block on every component, not just on the component you edited first.

Confirm three things in your own environment before you change a value. First, confirm the exact key names and nesting that your Loki version expects for S3, GCS, Azure and filesystem storage, because the layout is the part of the migration most likely to differ between releases. Second, confirm which components in your deployment mode read the storage block, including the index gateway and ruler if you run them. Third, record the current configuration for every component so you can roll back to the legacy form if a component fails to start. Ask your vendor or internal platform owner to confirm the bucket names, credentials source and endpoint values match what the Thanos-based clients will read, since a mismatch here usually shows up as missing data rather than an obvious startup error.

How the move differs by storage backend

Amazon S3 is one of the recommended production object stores for Loki, so most production clusters start here. The move is mainly about carrying identity and endpoint settings into the new client without changing where data lives. Confirm which authentication method your ingesters, queriers, compactor and index gateway use today, whether that is an access key pair, an instance or pod role, or a web identity token, and make sure every component receives the same permissions after the switch.

  • Credentials and roles: Verify that each component's IAM role or key still grants read, write, list and delete on the Loki bucket, since the compactor needs delete rights when retention is on.
  • Endpoint and region: Confirm the region and any custom endpoint, and whether path-style addressing is in use for S3-compatible services.
  • Bucket layout: Keep the existing bucket name and prefixes unchanged so chunks and index files written before the switch stay readable.
  • Encryption and lifecycle rules: Check bucket policies, server-side encryption settings and any lifecycle rules that could delete objects Loki still needs.
  • Pre-cutover test: In a non-production cluster, run a write, a query over data written before the change, and a compactor pass against a copy of the bucket.

Check the exact configuration keys in the Loki migration guide before editing any file.

Sharing one storage configuration with Mimir

The reason Grafana Labs gives for the move to Thanos-based object storage clients is consistent storage configuration across Loki, Mimir and other Grafana telemetry databases, so a team running both can describe its bucket access in one way. Sharing a storage block is possible in principle, but it is a decision you make on purpose, not a side effect of the migration. Before you point Loki and Mimir at the same bucket, confirm with your own platform team and the Loki migration documentation how the shared configuration is expected to look for your versions, because the layout you choose will be hard to reverse once data is written.

Decide four things first. The first is bucket layout: whether Loki and Mimir get separate buckets, or one bucket with separate prefixes. Separate buckets make access and lifecycle boundaries obvious, while prefixes reduce the number of buckets to manage but make one misconfigured policy reach both systems. The second is IAM scope: each component should hold only the object permissions it needs on its own location, so Loki's compactor and ingesters and Mimir's compactor and store-gateways do not inherit broad delete rights on the whole bucket. The third is lifecycle and retention ownership: Loki retention is applied by its compactor and is disabled by default, while Mimir has its own block retention, so name one owner for every bucket lifecycle rule and confirm that no bucket-level expiration policy deletes objects that either system still needs. The fourth is who approves changes to the shared block, since a credential rotation or endpoint change is a storage change for both teams.

The main risk is that one team's change affects the other. A change to a bucket policy, a lifecycle rule, a region, an encryption key or a credential can make the other system fail reads or writes without any change on its side, and the failure may appear first as query errors rather than as a storage alert. Plan a test in a non-production environment that exercises writes and reads from both systems after each storage change, keep separate dashboards for each system's storage errors, and agree on a rollback step before the migration starts. Confirm the exact behavior with your storage vendor and with the Loki and Mimir documentation for your versions rather than assuming that a shared block is safe for your setup.

How to sequence the storage client switch with a parallel check and cutover

This sequence moves a running Loki cluster from the legacy object storage clients to the Thanos-based clients with a tested staging run, a rollback path and a clean removal of legacy settings.

  1. Inventory storage blocks and running versions

    The platform owner records the Loki version on every component, the current storage_config block, the object store in use (S3, GCS, Azure Blob Storage or filesystem), the period_config and schema entries, and where the same bucket or credentials are shared with other Grafana systems such as Mimir. Confirm that the running version is 3.4 or later, since the use_thanos_objstore switch is documented from that release, and that the cluster is on a version that supports the switch in your planned upgrade path. The step is done when the inventory is written down and reviewed by the team that owns the buckets and credentials.

  2. Build a staging copy with the new clients enabled

    The team deploys a copy of the cluster in a non-production environment, pointing at a copy or snapshot of the production bucket where the access policy allows it, and sets use_thanos_objstore: true in the storage configuration. Engineers check the official migration guide for the exact configuration keys and any changes required for the new format before editing values. The step is done when the staging Loki starts on every component with no configuration errors in the logs.

  3. Verify reads and writes of chunks and index

    Engineers push a known set of test streams through the staging write path, then query them back through the read path and compare results with the production copy for the same time range. They confirm that new chunks land in the expected object prefixes, that the index is readable for each period, and that queries across old and new periods return the same line counts. The step is done when the written and queried results match and the verification is recorded with the Loki version and configuration hash tested.

  4. Prepare the rollback configuration

    Before production changes, the team saves the complete current configuration for every component, including the legacy storage settings, and stores it in version control with a tag tied to the change window. They document the exact steps to restore the previous configuration and confirm that the rollback has been rehearsed in staging. The step is done when the saved configuration can be redeployed to all components and the rollback steps have a named owner.

  5. Roll the change across all components

    The team applies the new storage configuration one component group at a time, following the rolling pattern used for your deployment mode, and checks ingestion, query and compactor health after each group. Because all components must read the same storage configuration, the team confirms that no component is still running the legacy client before the change is considered complete. The step is done when every component reports healthy, writes and queries succeed against production, and no storage errors appear in the component logs.

  6. Confirm shared configuration and monitor after cutover

    If the same bucket or storage settings are used by Mimir or other Grafana telemetry databases, the team checks that those systems still read and write correctly and that the shared configuration keys match the intended values. The team watches ingestion, query latency and storage error metrics for a period agreed in advance by the owners. The step is done when the owners sign off that the cluster is stable on the new clients and the rollback configuration is still retained.

  7. Remove legacy settings and retire the rollback copy

    Once the stable period is complete, the team removes the legacy storage settings from the configuration in version control, updates the runbooks and the upgrade plan for the planned Loki 4.0 release, and records the final configuration. They confirm that the next upgrade does not depend on the removed keys. The step is done when the configuration in version control contains only the Thanos-based settings and the change record links to the verification results.

How Loki components share one storage configuration during the switch

The diagram starts at the Loki components that write and read chunks and index data in object storage: ingesters and the compactor on the write and maintenance side, queriers and the ruler on the read side. The legacy client path and the Thanos objstore client path sit side by side as a transition choice, and Mimir appears as a second consumer of the same bucket. Check that every Loki component reads the same storage block after the switch, and that Mimir's block is configured with the same client settings you intend to share.

Loki components and Mimir reading one object store through either client path.

What drives the effort of the storage client migration

The migration is a configuration change on paper, but the effort depends on how many Loki components and clusters share the same storage settings, and on what the store and credentials look like. The cards below cover the drivers that change the work most and what to ask for before agreeing a fixed scope.

Clusters and components in scope

Each Loki cluster carries its own storage_config and common block, and each component (ingester, querier, compactor, ruler, index gateway) must load the new client settings. More clusters and more components mean more rollout waves, more restart windows and more verification. Ask the partner to list every cluster, every deployed component and the config source for each, including Helm values or templated files.

Storage backend type

Amazon S3, Google Cloud Storage, Azure Blob Storage and the filesystem each have their own keys and authentication fields in the new format. S3-compatible stores such as MinIO need endpoint and path-style settings checked against the documented options. Filesystem storage is the simplest to switch but usually has no shared-access path. Ask which backend each cluster uses and whether any custom endpoint or certificate handling applies.

Migration docs

Mimir sharing the same store

When Loki and Mimir write to one bucket or one set of Grafana telemetry storage settings, the change has to be planned for both systems together. A shared configuration block can be aligned once, but a mismatch can break one product while the other keeps running. Ask whether the partner will review Mimir's storage configuration, which team owns it and whether both change windows can be coordinated.

Current Loki version

The switch is optional in 3.x, which means a cluster on a recent 3.x release can be migrated on its own schedule. A cluster still on an older release may need an upgrade first, and that upgrade adds its own schema and configuration work. Ask for the exact version of every running component, because mixed versions during a rolling change are a common source of delay.

Default client switch
4.0

Credential model

Static access keys in configuration are the simplest case to convert, since the keys move into the new format and can be rotated afterward. Workload identity, such as IAM roles bound to Kubernetes service accounts, requires the pods to receive the right identity and the config to rely on it without embedded secrets. Ask whether keys are stored in plain config, a secret store or injected identities, and who can rotate them during the change.

Data that must stay readable

Logs already written under the old clients must remain queryable through the cutover, and retention, compaction and deletion must keep working on the same objects. The amount of data and the number of schema periods determine how much verification is needed before and after the change. Ask how much data is retained, how many schema periods exist, and whether a test query set can prove that older logs still return results.

Questions teams ask before changing Loki storage clients

How much does it cost to move Loki to the Thanos object storage clients?

The cost is mostly the engineering time to change configuration, test reads and writes against a copy of your storage settings, and roll the change out across every Loki component. No supplied source gives a price for this work, and DeployOpen does not publish prices. Costs rise with the number of Loki components and environments, the number of storage backends in use, and how many change windows you need. Ask any partner for a quote built from a written scope that lists the environments, components, and test steps covered.

How long does a storage client migration take?

No supplied source gives a duration, so confirm the timeline against your own environment before planning. The main variables are how many clusters share the storage configuration, whether you run Loki 3.x with the switch or move straight to 4.0, and how long your change approval process takes. Read the Loki migration guide for the exact steps, then size a test cluster run and a staged production rollout from that list.

What does the team need to provide for this work?

Plan for access to the Loki configuration as deployed, the storage backend details (bucket or container names, endpoints, and credentials handling), and a way to restart or roll each Loki component. You also need a non-production Loki cluster that mirrors production storage settings so you can confirm reads of existing chunks and indexes. Confirm who owns the object storage account and who can approve a change to live configuration.

Can our own team make this change without a partner?

Yes, if your team already operates Loki and understands its configuration. The change is a configuration migration: it turns on the new clients, moves storage settings into the new format, and verifies that existing data stays readable. Teams without recent Loki operations experience usually benefit from a written test plan and a rollback path before touching production. A partner can supply that plan as part of a fixed-scope engagement if your team prefers not to build it.

Do we have to copy our existing log data to a new bucket?

Based on the supplied migration documentation, the switch changes the client library Loki uses to talk to storage, not where the data lives. Confirm this against the official migration guide for your exact version before relying on it. If your plan does involve a new bucket, container, or endpoint, the data copy becomes a separate project with its own cost, verification, and retention checks. Keep existing chunks and index periods accessible throughout.

How does sharing storage configuration with Mimir change the scope?

Grafana Labs gives consistent storage configuration across Loki, Mimir and other Grafana telemetry databases as one reason for the Thanos-based clients. If Mimir uses the same object storage, the scope grows: you must review Mimir's storage settings, coordinate change windows with the team that runs it, and test both systems against the shared buckets or credentials. Confirm which teams own each system and whether they share one storage account before you estimate the work.

What could go wrong, and how do we check the result?

The most common risks are a misspelled or misplaced configuration key that stops a component from starting, credentials that work for one component but not another, and a component still running the old client after the rollout. Verify each Loki component after the change, confirm that queries return historical logs and new writes land in storage, and check that the retention compactor still runs as expected. Keep the previous configuration ready for rollback until the change is verified in production.

Should we do this before or after moving to Loki 4.0?

Confirm the sequencing against the Loki upgrade guide, because the supplied facts say Loki 4.0 uses the new clients by default and deprecates the legacy ones. Doing the storage change on 3.x first lets you isolate it from the larger version upgrade, which makes failures easier to diagnose. Plan for both changes to be tested separately before combining them in one maintenance window.

How DeployOpen scopes and delivers a Loki storage migration

DeployOpen treats the move to the Thanos object storage clients as a configuration change that touches live data paths, so the work starts with an inventory of your current storage settings and ends with evidence that reads and writes behave the same. Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work begins.

How we scope

  • Inventory the current storage blocks for each Loki component, including S3, GCS, Azure or filesystem settings in use today.
  • Confirm the target Loki version, the planned use of use_thanos_objstore, and whether Mimir or other Grafana databases will share storage settings.
  • Agree in writing which environments, tenants and retention rules are in scope, and which are excluded from the change.

How we build

  • Convert the storage configuration to the new format in a non-production copy and record each key that changed.
  • Test writes, reads, compactor runs and retention deletes against the converted configuration before any production change.
  • Document the rollout order across ingesters, queriers, compactors and other components so the cutover is repeatable.

How we hand over

  • Deliver the converted configuration files, a before and after comparison, and the test results for each storage backend.
  • Provide a rollback procedure that restores the legacy client settings and names the checks that decide whether to roll back.
  • Walk your platform and security teams through the runbook so they can review access to the bucket and credentials.

How we support

  • Offer ongoing support, upgrades and continuous testing as a retainer after the migration is complete.
  • Confirm with your team how the Loki 4.0 default change will be handled in your upgrade plan, using the Loki documentation as the reference.
  • Schedule a follow-up review of storage metrics and errors after the first retention cycle to confirm the new clients behave as expected.

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.