Migrate from Grafana Agent to Grafana Alloy for Loki

Grafana Agent Static, Flow and Operator reached end of life on November 1, 2025, so teams still shipping logs to Loki with them need a planned move to Alloy. This page explains the documented conversion paths, what maps cleanly, and how to run both pipelines without duplicate logs.

On this page

Migrating from Grafana Agent to Alloy for Loki after end of life

If your Loki cluster is still fed by Grafana Agent Static, Grafana Agent Flow or Grafana Agent Operator, those agents passed end of life on November 1, 2025, and the work now is to move every log pipeline to Grafana Alloy. Grafana Labs publishes a migration guide for each of the three agent types, so the conversion path depends on which agent you run. Start by inventorying every agent deployment that writes to Loki, recording its mode, its configuration file or Operator custom resources, and the Loki endpoint it pushes to. That inventory decides the rest of the plan.

Effort is driven by three things: the number of log pipelines, how much custom configuration each pipeline carries, and how many hosts and clusters run agents. A small set of default-style scrape configs on a few servers is a short conversion. Pipelines with multiple stages, custom relabeling, multiline handling, or Operator-managed resources across several Kubernetes clusters need more review, more test runs and more coordinated rollout windows. Ask any partner to base its quote on that inventory, and ask which of your pipelines it expects to convert by hand rather than with tooling.

Before you change production, confirm two things in your own environment: that the Loki version you run accepts the ingestion path Alloy will use, and that your dashboards and alerts do not depend on agent-specific metric names. Plan to run Alloy beside the existing agent for a test period, comparing line counts and labels for the same sources in a non-production Loki tenant. Duplicate logs are the most common failure in this phase, so decide in advance which agent owns each source at each stage, and stop the old agent per host or per workload rather than all at once. Record each cutover step, because auditors and incident responders will ask which collector was shipping a given log on a given date.

What maps cleanly from Grafana Agent to Alloy and what needs rework

This table compares the log collection features a Grafana Agent installation typically uses with their Grafana Alloy counterparts and notes where conversion is straightforward and where it needs rework. Confirm every component mapping against the Loki migrate to Alloy documentation for your Static, Flow or Operator variant before relying on it. Treat the notes as a starting checklist, not as proof of parity.

CapabilityGrafana Agent (source)Grafana Alloy (target)Migration note
File discovery and tailingLog file targets defined in the Static or Flow logs configurationFile discovery and tailing components that read the same host pathsLikely to carry over. Confirm path patterns and file position handling in the migration docs.
Pipeline stagesOrdered pipeline stages for parsing, labeling and dropping linesProcessing stages in the Loki log pipeline, with a different configuration syntaxRework expected. Stage behavior must be checked stage by stage, not assumed equivalent.
Static labels and relabelingLabels set in scrape config and relabel rulesLabel assignment and relabeling expressed in Alloy componentsReview each rule. Label names and values can change cardinality on the Loki side.
Loki write targetsClient block pointing at one or more Loki push endpointsLoki write component with the same endpoint, tenant and authentication settingsUsually a direct translation. Set the tenant header and credentials explicitly and verify them.
Kubernetes discoveryPod and service discovery in Agent configurationKubernetes discovery components in AlloyConfirm selectors and namespaces match the old scope to avoid gaps or duplicate scraping.
Operator custom resourcesAgent Operator resources such as Grafana Agent and log configuration objectsAlloy deployment and configuration managed through the Operator path documented for AlloyLargest rework item. Custom resources do not convert one to one, so plan the new objects from the documentation.
Positions and checkpointsStored read positions for each tailed fileSeparate position storage that starts empty after the switchPlan the cutover so the old and new agents do not both ship the same files.

How each Grafana Agent variant leaves the stack

Grafana Agent Static is the classic mode, usually installed as a system service on virtual machines or physical hosts. Each host typically reads a YAML file that lists log targets, labels, pipeline stages and the Loki endpoint, and configuration management often generates that file. Grafana Labs provides migration documentation for this variant, so the work is mainly translating each host's file into Alloy configuration and redeploying the service.

  • Host service units: Record the service name, service user and file paths that start the agent on each host, because Alloy needs its own service definition.
  • YAML configuration: Inventory every log target, pipeline stage and external label, since each setting must be restated in Alloy's syntax.
  • Read position state: Identify where the agent stores the record of what it has already read, so you know what has shipped and what could ship twice (confirm the file location for your version).
  • Configuration templates: Update the templates in your management tool along with the hosts, or the old settings will return on the next run.
  • Dashboards and alerts: List the metric names and labels the old agent produced, because dashboards and alerts that depend on them will change.

Before changing any host, confirm which file paths, service names and label sets your fleet uses, since those values drive the side-by-side test.

Documented conversion paths and tools to use

Start from the official Loki migration guide, then learn the Alloy pieces that replace Agent's log pipeline. Each card covers one part of the toolset you will rely on while moving Agent installations to Alloy.

Official Loki migrate to Alloy guide

This is the starting reference for every Agent variant in scope: Static, Flow and Operator. Grafana Agent Static, Flow and Operator reached end of life on November 1, 2025, and the guide documents a migration path to Grafana Alloy for each. Read the section that matches your installed variant before touching any host or cluster, and record the Loki version your target pipeline must work with. Take every command and converter option from the current documentation, not from memory.

Migrate to Alloy guide

Alloy log receiver components

Alloy log shipping is built from components that discover or receive logs, process them, and forward them to Loki. The components you will map from Agent are the file and Kubernetes discovery sources, the relabeling and processing stages, and the loki.write component that sends to your Loki endpoint. Document which Agent scrape and pipeline stages each Alloy component replaces, and note any stage that has no direct equivalent so it becomes a reviewed design decision.

Alloy configuration syntax

Alloy uses its own River-based configuration language, not the YAML that Agent Static used. Your team will edit component blocks, argument attributes and references between components, so plan time for reviewers to learn the syntax before they approve changes. Keep configuration files in version control, validate them with the Alloy tooling from the current documentation, and treat the converted output as a draft that a person must read end to end.

Checking for a conversion helper

Grafana provides converter commands for moving existing configurations, but support differs by Agent variant and by which source features the converter understands. Before you plan the work, confirm in the current docs whether a conversion command exists for your exact variant, which flags it accepts and which input formats it reads. Save the converter version and output alongside the source file so a reviewer can trace each generated block back to its original setting.

Pipeline features the converter may not carry

Converters handle common configurations well but may skip custom pipeline stages, unusual relabeling, or settings tied to a specific deployment method. Inventory each Agent logs config for features like multiline handling, label drops, or custom timestamp parsing, then check the converted output against that inventory. Anything missing must be rebuilt by hand and tested, and the list of gaps becomes part of your cutover checklist.

Confirm the Loki endpoint and tenant

Alloy's loki.write component must point at the same Loki push endpoint and send the same tenant identifier that Agent used, otherwise logs will land in a different tenant or fail authentication. Check the X-Scope-OrgID header behavior if multi-tenancy is enabled, and confirm the endpoint URL from your Loki deployment rather than copying it from an old Agent file. Write these values down before side-by-side testing starts so the comparison is fair.

Loki multi-tenancy docs

How logs flow during the parallel run

Hosts and Kubernetes nodes keep their existing Grafana Agent collectors while new Alloy collectors are added beside them, and both read the same log sources. Both send through an authenticating gateway that sets the X-Scope-OrgID tenant header, so Loki storage receives one stream per source and Grafana queries it. The control point is the duplicate check: each source has one active shipper at each stage. Stop Agent on a source only after Alloy output has been verified in Grafana for that source.

Agent and Alloy run side by side on the same sources, with one active shipper per source at each stage.

The sequence from inventory to decommission

This sequence moves each Grafana Agent log source to Alloy in a controlled order, so every cutover decision rests on side-by-side evidence rather than assumption. Each step produces a record that the next step depends on.

  1. Inventory every Agent installation and pipeline

    List every Grafana Agent Static, Flow and Operator installation that ships logs to Loki, including hosts, containers, Kubernetes namespaces and any Agent Operator custom resources. For each one, record the configuration file or resources, the scrape targets, the pipeline stages, the Loki endpoint, the tenant ID sent in the X-Scope-OrgID header, and the team that owns the log source. Your platform team usually completes this with the owners of each source. The step is done when every installation has one row in a shared inventory and no Agent instance is unaccounted for on the network or in the cluster.

  2. Choose one pilot host or namespace

    Select a single low-risk host or Kubernetes namespace whose logs are useful but not critical, and whose owner agrees to compare results during the test. Confirm that the pilot can run both shippers at once without doubling load on its disk, CPU or network path. Record the reason for the choice, the owner's name and the rollback method. The step is done when the pilot is written into the inventory with an agreed owner and a named rollback path.

  3. Convert and test in Alloy against a low-risk tenant

    Use the conversion path in the Loki migration documentation that matches each installation type to generate a starting Alloy configuration, then review it by hand. Expect to fix items the converter does not carry over, such as pipeline stages or discovery details, and confirm that the tenant header and Loki endpoint are set correctly. Send the pilot logs to a non-production Loki tenant or a low-risk tenant first. The step is done when Alloy delivers logs to Loki without write errors and the reviewer has signed off the converted configuration, with the diff from the original kept in version control.

  4. Run both shippers side by side with ownership rules

    Keep the Agent running on the pilot while Alloy ships the same logs, and write down which shipper owns each log source at each point in time. A single owner per source prevents duplicate lines in Loki. Mark the owner in the inventory, and make the Agent-side pipeline write to a separate stream or tenant only if your team chooses that method for the test. Set a fixed observation window agreed with the owner. The step is done when the ownership table is published, and a check confirms no source is written by both shippers into the same query path.

  5. Compare volumes, labels and query results in Grafana

    Compare the two outputs for the pilot in Grafana: line counts per stream, label sets, structured metadata, timestamps, and the results of the queries that existing dashboards and alerts depend on. Investigate any difference in label names or values, because dashboards and alert rules match on them. Record every difference and whether it is intended or a defect. The step is done when the comparison is saved as a signed-off report that lists each deviation, its cause and its fix, and no unexplained difference remains for the pilot's log sources.

  6. Cut over source by source

    Move the remaining log sources in small groups, starting with the least critical, and switch ownership in the inventory before stopping the Agent for each group. Update dashboards and alert rules that referenced changed labels or metrics in the same change window. Keep the Agent configuration intact so that a group can be returned to it. The step is done when every source in the inventory lists Alloy as its owner, the Agent is stopped for each, and dashboards and alerts for each group have been checked against live data.

  7. Remove Agent and its configuration

    After a final observation period with no regressions, stop and uninstall the remaining Grafana Agent Static, Flow and Operator components, remove their service units, Helm releases or operator resources, and delete the configuration files from hosts and repositories. Revoke any credentials that only the Agent used and update runbooks and onboarding documents. The step is done when a fresh inventory scan finds no running Agent process or resource, and the change record links the final comparison report and the decommission confirmation.

Avoiding duplicate logs while both shippers run

Duplicates appear when two agents read the same source and both push it to Loki. During an overlap, a Grafana Agent Static or Operator deployment and an Alloy deployment may both tail the same files under /var/log, the same container log paths, or the same journal. Each agent keeps its own read position, so each sends its own copy with its own labels, and Loki stores both as separate streams. The fix is an ownership map written down before any cutover: for every log source (host file path, Kubernetes namespace or workload, journal unit), name exactly one shipper that is allowed to send it at each stage. Treat that map as the rollout plan. Move one source group at a time, and retire the old agent's config for that group before the new one starts sending.

Check for double counts directly in Grafana before you trust the cutover. For each migrated source, run a count over a fixed window, such as count_over_time or a line count with a sum by on the labels you expect, and compare the result against a window taken before the change. A sudden doubling on the same job or host label points to an overlap, while a drop points to a source that nothing is shipping. Confirm the exact label set your current agent writes, including job, filename, namespace, pod, and container, and verify that the Alloy pipeline reproduces it. Pick a window long enough to cover a normal traffic cycle and record the numbers, so the comparison is a repeatable check rather than a judgment call.

What drives the cost and duration of the move

This table lists the factors that raise or lower the effort of moving Grafana Agent log pipelines to Grafana Alloy for Loki, with the direction of each effect and what to request in a quote. Read it before scoping, because the inventory of agents, pipelines and dependent dashboards usually decides the schedule more than the conversion tooling does.

DriverEffect on effortWhat to ask for in a quote
Number of Agent installations and variantsMore installations and more variants (Static, Flow, Operator) increase effort roughly with each distinct configurationPer-variant inventory and a count of unique configurations, not just hosts
Pipelines and custom stagesEach custom pipeline stage that the converter cannot map adds manual rewrite and test timeA list of pipeline stages reviewed for conversion gaps and the rewrite approach for each
Kubernetes versus host deploymentsKubernetes adds Helm or Operator changes and rollout sequencing; hosts add package and service management per serverSeparate estimates for each platform, with the rollout method assumed
Number of tenants and label schemesMore tenants and inconsistent labels increase mapping work and per-tenant verificationTenant list, label mapping rules and how tenant headers are set in the new pipeline
Dashboards and alert rules tied to Agent metricsDependent dashboards and alerts that reference Agent-specific metrics need review and updatesCount of affected dashboards and alert rules and who signs off on changes
Change windowsNarrow windows force smaller batches and more coordination, which lengthens the scheduleAvailable windows, freeze periods and the approval path for each
Test environmentsWithout a non-production Loki and host set, side-by-side testing moves into production and adds risk controlsConfirm whether a staging environment exists, its size and whether it can receive live log volume
Duplicate log handlingRunning old and new agents together needs a cutover plan to avoid double ingestion, which adds verification stepsWritten cutover steps, a duplicate check method and the rollback plan

What usually goes wrong and how to prevent it

Most failed Agent-to-Alloy migrations fail at the cutover seam, not in the Alloy configuration itself. The six risks below cover data, labels, leftover installs, pipeline logic, Kubernetes resources and recovery, and each has a check the team can run before traffic moves.

Logs duplicated or lost at cutover

Running Agent and Alloy against the same files, or stopping one before the other has started, either doubles log lines or leaves a gap. Both are hard to see later because Loki accepts the data without complaint. Before cutover, run both agents on one test host, query a known unique log line in Loki, and confirm it appears once. Record the read position on each host so Alloy resumes where Agent stopped.

Migrate to Alloy docs

Labels or tenant IDs changed

Dashboards, alert rules and LogQL queries select streams by label name and value, and tenant routing depends on the X-Scope-OrgID header. If the converted Alloy configuration renames a label, drops a static label or sends logs to a different tenant, existing panels return empty results without an error. Compare the label set of a sample stream from Agent and Alloy, and confirm the tenant header value for each pipeline against your multi-tenancy settings.

Loki multi-tenancy docs

Unmanaged Agent installations left running

After the migration, a forgotten Agent service, container or package can keep shipping logs to Loki, which produces duplicates that persist after the Alloy rollout is marked complete. The Agent end-of-life date of November 1, 2025 means these installs may no longer receive updates. Build an inventory from configuration management, container registries and Kubernetes workloads before cutover, then confirm each host shows only one shipper in its service list after the change.

Pipeline stages dropped or mangled

Agent pipelines often parse JSON, extract fields, drop noisy lines or rewrite timestamps. Converted configurations may not carry every stage across, and the converter reports what it could not translate. Keep a list of every stage in the source file and mark each one as converted, rewritten or removed. Then feed the same sample log file through both pipelines and diff the output stream by stream.

Operator resources not replaced in Kubernetes

Agent Operator uses custom resources such as its own log and pipeline definitions. Removing the Operator without creating the matching Alloy resources stops collection silently, and leaving the old custom resources in place can keep the old Agent creating pods. Export every existing custom resource, map each one to its Alloy equivalent, and check in a non-production cluster that new pods appear on every node and no old pods remain.

No rollback path

A cutover without a tested way back turns a small pipeline fault into an outage in log collection during the incident that needs those logs most. Keep the Agent configuration and package in place until Alloy has run in production for an agreed period, and write the rollback as numbered steps with owners. Rehearse the rollback on one host, including how the read position is restored, before the first production change.

Questions teams ask before moving Grafana Agent to Alloy

How much does moving Grafana Agent to Alloy for Loki cost?

No supplied fact gives a price for this migration, so the cost depends on the work in your environment rather than on a published rate. Grafana Agent Static, Grafana Agent Flow and Grafana Agent Operator reached end of life on November 1, 2025, so the work is a one-time conversion plus testing. The main cost drivers are the number of hosts, Kubernetes clusters and pipelines, how many custom relabeling and parsing stages exist, and how many dashboards and alerts depend on existing metric names. If you use a partner, ask for a quote built from a written scope that lists each pipeline, environment and deliverable, and confirm whether ongoing support or retesting is a separate line item.

How long does a Grafana Agent to Alloy migration take?

Duration depends mainly on the number of agent configurations, the environments they run in and how much validation you require before cutover. Start by inventorying every Static, Flow and Operator deployment that ships logs to Loki, then count the pipelines inside each. A small set of hosts with simple file scraping is usually quick to convert, while many Kubernetes clusters with custom processing take longer because each one needs side-by-side testing. Confirm the timeline in writing with your partner or internal owners, and ask which phases (inventory, conversion, parallel run, cutover and decommissioning) are included in the estimate.

What does the migration need from our internal team?

Your team needs people who know the current agent configurations, the log sources they read and the Loki tenants and labels they write to. Plan for access to the hosts and clusters, the ability to change agent and Alloy deployment manifests, and someone who owns Loki queries and dashboards so they can confirm results match. Security or platform staff also need to approve credentials and network paths used by Alloy. Ask your partner to list these roles in the scope so you can assign named people before work starts.

Can our own team complete this migration without a partner?

Yes, a team with Linux or Kubernetes operations experience and Loki access can convert and test configurations using Grafana's migration documentation. The Loki documentation includes a guide for migrating to Alloy, which is the natural starting point. The points that usually need extra attention are pipeline stages that do not convert cleanly, read positions, duplicate detection and proof that dashboards still return the same results. Decide whether your team has the capacity to run a parallel period and to own the result afterward, and bring in a partner for the parts you cannot cover.

What happens to logs while both agents are running?

During the overlap, the old agent and Alloy can both read the same files or journal, which produces duplicate log lines in Loki unless you prevent it. Avoid duplicates by assigning each source to one shipper at a time, sending the new pipeline to a separate tenant or label value during testing, or stopping the old agent on a host before Alloy starts on it. Check that read positions are not lost during the switch, so a restart does not replay or skip history. Compare line counts for a sample window in Grafana before retiring the old agent.

Should we move Promtail users in the same change?

Plan them in the same program but as a separate change, since Promtail reached end of life on March 2, 2026 and has its own conversion path. Grafana directs Promtail users to Grafana Alloy, so the target is the same, but the configurations, positions files and dashboard metrics differ. Combining both into one cutover increases the number of variables when something goes wrong. Build an inventory that marks each host as Grafana Agent or Promtail, then sequence the work so each group has its own test window and rollback plan.

Does this migration change our Loki storage or retention settings?

The agent migration itself changes how logs are shipped, not how Loki stores or retains them, so storage and retention settings should stay as they are. Loki keeps logs indefinitely unless retention is enabled, so confirm your current retention configuration before cutover and make sure the new pipeline uses the same tenant IDs and labels. If labels change during conversion, older and newer streams will not match in queries, so document the label mapping and check it against your dashboards and alert rules before retiring the old agent.

How DeployOpen works on this

DeployOpen scopes the move from Grafana Agent to Grafana Alloy as a fixed-scope engagement, with the inventory, conversion and cutover steps agreed in writing before work starts. The work runs inside your own infrastructure, and the finished pipelines are documented so your team can operate them after handover.

How we scope

  • Inventory every Grafana Agent Static, Flow and Operator install that ships logs to Loki, by host, cluster and config file.
  • Record which log sources, labels, tenants and destination endpoints each agent sends to, so nothing is missed at cutover.
  • Agree in writing which Alloy conversion paths apply, which configurations need manual rewrites, and which hosts move first.

How we build

  • Convert agent configurations with the documented migration paths, then review the output by hand for labels, pipeline stages and file positions.
  • Run Alloy pipelines side by side with the existing agents against a test Loki tenant to compare line counts and labels.
  • Plan the cutover so each source is switched from the old agent to Alloy once, with a stop point that prevents duplicate log ingestion.

How we hand over

  • Deliver the converted Alloy configurations, a host and cluster inventory, and a record of every manual change made during conversion.
  • Document the side-by-side test results, the cutover order and the rollback steps for each source group.
  • Walk your platform and operations engineers through the running pipelines and the checks they should run after future changes.

How we support

  • Ongoing support, upgrades and continuous testing of the Alloy pipelines are available as a retainer after the migration closes.
  • Confirm with your team which post-cutover checks and dashboard changes belong in the written scope before work starts.
  • Ask for a written quote that lists scope, deliverables and timelines, since DeployOpen does not publish a price list.

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.