<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Migrate to Grafana Agent Flow on Grafana Labs</title><link>https://grafana.com/docs/agent/v0.43/flow/tasks/migrate/</link><description>Recent content in Migrate to Grafana Agent Flow on Grafana Labs</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/agent/v0.43/flow/tasks/migrate/index.xml" rel="self" type="application/rss+xml"/><item><title>Migrate from Grafana Agent Operator to Grafana Agent Flow</title><link>https://grafana.com/docs/agent/v0.43/flow/tasks/migrate/from-operator/</link><pubDate>Wed, 11 Sep 2024 17:43:35 +0000</pubDate><guid>https://grafana.com/docs/agent/v0.43/flow/tasks/migrate/from-operator/</guid><content><![CDATA[&lt;h1 id=&#34;migrate-from-grafana-agent-operator-to-grafana-agent-flow&#34;&gt;Migrate from Grafana Agent Operator to Grafana Agent Flow&lt;/h1&gt;
&lt;p&gt;With the release of Grafana Agent Flow, Grafana Agent Operator is no longer the recommended way to deploy Grafana Agent in Kubernetes.
Some of the Operator functionality has moved into Grafana Agent Flow itself, and the Helm Chart has replaced the remaining functionality.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The Monitor types (&lt;code&gt;PodMonitor&lt;/code&gt;, &lt;code&gt;ServiceMonitor&lt;/code&gt;, &lt;code&gt;Probe&lt;/code&gt;, and &lt;code&gt;PodLogs&lt;/code&gt;) are all supported natively by Grafana Agent Flow.
You are no longer required to use the Operator to consume those CRDs for dynamic monitoring in your cluster.&lt;/li&gt;
&lt;li&gt;The parts of the Operator that deploy the Grafana Agent itself (&lt;code&gt;GrafanaAgent&lt;/code&gt;, &lt;code&gt;MetricsInstance&lt;/code&gt;, and &lt;code&gt;LogsInstance&lt;/code&gt; CRDs) are deprecated.
Operator users should use the Grafana Agent [Helm Chart][] to deploy Grafana Agent directly to your clusters.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This guide provides some steps to get started with Grafana Agent Flow for users coming from Grafana Agent Operator.&lt;/p&gt;
&lt;h2 id=&#34;deploy-grafana-agent-flow-with-helm&#34;&gt;Deploy Grafana Agent Flow with Helm&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create a &lt;code&gt;values.yaml&lt;/code&gt; file, which contains options for deploying your Grafana Agent.
You can start with the &lt;a href=&#34;https://github.com/grafana/agent/blob/main/operations/helm/charts/grafana-agent/values.yaml&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;default values&lt;/a&gt; and customize as you see fit, or start with this snippet, which should be a good starting point for what the Operator does.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;agent:
  mode: &amp;#39;flow&amp;#39;
  configMap:
    create: true
  clustering:
    enabled: true
controller:
  type: &amp;#39;statefulset&amp;#39;
  replicas: 2
crds:
  create: false&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This configuration deploys Grafana Agent Flow as a &lt;code&gt;StatefulSet&lt;/code&gt; using the built-in 
    &lt;a href=&#34;/docs/agent/v0.43/flow/concepts/clustering/&#34;&gt;clustering&lt;/a&gt; functionality to allow distributing scrapes across all Grafana Agent Pods.&lt;/p&gt;
&lt;p&gt;This is one of many deployment possible modes. For example, you may want to use a &lt;code&gt;DaemonSet&lt;/code&gt; to collect host-level logs or metrics.
See the Grafana Agent Flow 
    &lt;a href=&#34;/docs/agent/v0.43/flow/get-started/deploy-agent/&#34;&gt;deployment guide&lt;/a&gt; for more details about different topologies.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create a Grafana Agent configuration file, &lt;code&gt;agent.river&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;In the next step, you add to this configuration as you convert &lt;code&gt;MetricsInstances&lt;/code&gt;. You can add any additional configuration to this file as you need.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Install the Grafana Helm repository:&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;helm repo add grafana https://grafana.github.io/helm-charts
helm repo update&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create a Helm release. You can name the release anything you like. The following command installs a release called &lt;code&gt;grafana-agent-metrics&lt;/code&gt; in the &lt;code&gt;monitoring&lt;/code&gt; namespace.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;shell&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-shell&#34;&gt;helm upgrade grafana-agent-metrics grafana/grafana-agent -i -n monitoring -f values.yaml --set-file agent.configMap.content=agent.river&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This command uses the &lt;code&gt;--set-file&lt;/code&gt; flag to pass the configuration file as a Helm value so that you can continue to edit it as a regular River file.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;convert-metricsintances-to-grafana-agent-flow-components&#34;&gt;Convert &lt;code&gt;MetricsIntances&lt;/code&gt; to Grafana Agent Flow components&lt;/h2&gt;
&lt;p&gt;A &lt;code&gt;MetricsInstance&lt;/code&gt; resource primarily defines:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The remote endpoints Grafana Agent Flow should send metrics to.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;PodMonitor&lt;/code&gt;, &lt;code&gt;ServiceMonitor&lt;/code&gt;, and &lt;code&gt;Probe&lt;/code&gt; resources this Grafana Agent should discover.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can use these functions in Grafana Agent Flow with the &lt;code&gt;prometheus.remote_write&lt;/code&gt;, &lt;code&gt;prometheus.operator.podmonitors&lt;/code&gt;, &lt;code&gt;prometheus.operator.servicemonitors&lt;/code&gt;, and &lt;code&gt;prometheus.operator.probes&lt;/code&gt; components respectively.&lt;/p&gt;
&lt;p&gt;The following River sample is equivalent to the &lt;code&gt;MetricsInstance&lt;/code&gt; from the 
    &lt;a href=&#34;/docs/agent/v0.43/operator/deploy-agent-operator-resources/#deploy-a-metricsinstance-resource&#34;&gt;operator guide&lt;/a&gt;.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Alloy&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-alloy&#34;&gt;
// read the credentials secret for remote_write authorization
remote.kubernetes.secret &amp;#34;credentials&amp;#34; {
  namespace = &amp;#34;monitoring&amp;#34;
  name = &amp;#34;primary-credentials-metrics&amp;#34;
}

prometheus.remote_write &amp;#34;primary&amp;#34; {
    endpoint {
        url = &amp;#34;https://&amp;lt;PROMETHEUS_URL&amp;gt;/api/v1/push&amp;#34;
        basic_auth {
            username = nonsensitive(remote.kubernetes.secret.credentials.data[&amp;#34;username&amp;#34;])
            password = remote.kubernetes.secret.credentials.data[&amp;#34;password&amp;#34;]
        }
    }
}

prometheus.operator.podmonitors &amp;#34;primary&amp;#34; {
    forward_to = [prometheus.remote_write.primary.receiver]
    // leave out selector to find all podmonitors in the entire cluster
    selector {
        match_labels = {instance = &amp;#34;primary&amp;#34;}
    }
}

prometheus.operator.servicemonitors &amp;#34;primary&amp;#34; {
    forward_to = [prometheus.remote_write.primary.receiver]
    // leave out selector to find all servicemonitors in the entire cluster
    selector {
        match_labels = {instance = &amp;#34;primary&amp;#34;}
    }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Replace the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;PROMETHEUS_URL&amp;gt;&lt;/code&gt;&lt;/em&gt;: The endpoint you want to send metrics to.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This configuration discovers all &lt;code&gt;PodMonitor&lt;/code&gt;, &lt;code&gt;ServiceMonitor&lt;/code&gt;, and &lt;code&gt;Probe&lt;/code&gt; resources in your cluster that match the label selector &lt;code&gt;instance=primary&lt;/code&gt;.
It then scrapes metrics from the targets and forward them to your remote write endpoint.&lt;/p&gt;
&lt;p&gt;You may need to customize this configuration further if you use additional features in your &lt;code&gt;MetricsInstance&lt;/code&gt; resources.
Refer to the documentation for the relevant components for additional information:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/agent/v0.43/flow/reference/components/remote.kubernetes.secret/&#34;&gt;remote.kubernetes.secret&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/agent/v0.43/flow/reference/components/prometheus.remote_write/&#34;&gt;prometheus.remote_write&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/agent/v0.43/flow/reference/components/prometheus.operator.podmonitors/&#34;&gt;prometheus.operator.podmonitors&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/agent/v0.43/flow/reference/components/prometheus.operator.servicemonitors/&#34;&gt;prometheus.operator.servicemonitors&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/agent/v0.43/flow/reference/components/prometheus.operator.probes/&#34;&gt;prometheus.operator.probes&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/agent/v0.43/flow/reference/components/prometheus.scrape/&#34;&gt;prometheus.scrape&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;collecting-logs&#34;&gt;Collecting Logs&lt;/h2&gt;
&lt;p&gt;Our current recommendation is to create an additional DaemonSet deployment of Grafana Agents to scrape logs.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;We have components that can scrape pod logs directly from the Kubernetes API without needing a DaemonSet deployment. These are
still considered experimental, but if you would like to try them, see the documentation for 
    &lt;a href=&#34;/docs/agent/v0.43/flow/reference/components/loki.source.kubernetes/&#34;&gt;loki.source.kubernetes&lt;/a&gt; and

    &lt;a href=&#34;/docs/agent/v0.43/flow/reference/components/loki.source.podlogs/&#34;&gt;loki.source.podlogs&lt;/a&gt;.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;These values are close to what the Operator currently deploys for logs:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;agent:
  mode: &amp;#39;flow&amp;#39;
  configMap:
    create: true
  clustering:
    enabled: false
  controller:
    type: &amp;#39;daemonset&amp;#39;
  mounts:
    # -- Mount /var/log from the host into the container for log collection.
    varlog: true&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This command will install a release named &lt;code&gt;grafana-agent-logs&lt;/code&gt; in the &lt;code&gt;monitoring&lt;/code&gt; namespace:&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;helm upgrade grafana-agent-logs grafana/grafana-agent -i -n monitoring -f values-logs.yaml --set-file agent.configMap.content=agent-logs.river&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This simple configuration will scrape logs for every pod on each node:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Alloy&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-alloy&#34;&gt;// read the credentials secret for remote_write authorization
remote.kubernetes.secret &amp;#34;credentials&amp;#34; {
  namespace = &amp;#34;monitoring&amp;#34;
  name      = &amp;#34;primary-credentials-logs&amp;#34;
}

discovery.kubernetes &amp;#34;pods&amp;#34; {
  role = &amp;#34;pod&amp;#34;
  // limit to pods on this node to reduce the amount you need to filter
  selectors {
    role  = &amp;#34;pod&amp;#34;
    field = &amp;#34;spec.nodeName=&amp;#34; &amp;#43; env(&amp;#34;&amp;lt;HOSTNAME&amp;gt;&amp;#34;)
  }
}

discovery.relabel &amp;#34;pod_logs&amp;#34; {
  targets = discovery.kubernetes.pods.targets
  rule {
    source_labels = [&amp;#34;__meta_kubernetes_namespace&amp;#34;]
    target_label  = &amp;#34;namespace&amp;#34;
  }
  rule {
    source_labels = [&amp;#34;__meta_kubernetes_pod_name&amp;#34;]
    target_label  = &amp;#34;pod&amp;#34;
  }
  rule {
    source_labels = [&amp;#34;__meta_kubernetes_pod_container_name&amp;#34;]
    target_label  = &amp;#34;container&amp;#34;
  }
  rule {
    source_labels = [&amp;#34;__meta_kubernetes_namespace&amp;#34;, &amp;#34;__meta_kubernetes_pod_name&amp;#34;]
    separator     = &amp;#34;/&amp;#34;
    target_label  = &amp;#34;job&amp;#34;
  }
  rule {
    source_labels = [&amp;#34;__meta_kubernetes_pod_uid&amp;#34;, &amp;#34;__meta_kubernetes_pod_container_name&amp;#34;]
    separator     = &amp;#34;/&amp;#34;
    action        = &amp;#34;replace&amp;#34;
    replacement   = &amp;#34;/var/log/pods/*$1/*.log&amp;#34;
    target_label  = &amp;#34;__path__&amp;#34;
  }
  rule {
    action = &amp;#34;replace&amp;#34;
    source_labels = [&amp;#34;__meta_kubernetes_pod_container_id&amp;#34;]
    regex = &amp;#34;^(\\w&amp;#43;):\\/\\/.&amp;#43;$&amp;#34;
    replacement = &amp;#34;$1&amp;#34;
    target_label = &amp;#34;tmp_container_runtime&amp;#34;
  }
}

local.file_match &amp;#34;pod_logs&amp;#34; {
  path_targets = discovery.relabel.pod_logs.output
}

loki.source.file &amp;#34;pod_logs&amp;#34; {
  targets    = local.file_match.pod_logs.targets
  forward_to = [loki.process.pod_logs.receiver]
}

// basic processing to parse the container format. You can add additional processing stages
// to match your application logs.
loki.process &amp;#34;pod_logs&amp;#34; {
  stage.match {
    selector = &amp;#34;{tmp_container_runtime=\&amp;#34;containerd\&amp;#34;}&amp;#34;
    // the cri processing stage extracts the following k/v pairs: log, stream, time, flags
    stage.cri {}
    // Set the extract flags and stream values as labels
    stage.labels {
      values = {
        flags   = &amp;#34;&amp;#34;,
        stream  = &amp;#34;&amp;#34;,
      }
    }
  }

  // if the label tmp_container_runtime from above is docker parse using docker
  stage.match {
    selector = &amp;#34;{tmp_container_runtime=\&amp;#34;docker\&amp;#34;}&amp;#34;
    // the docker processing stage extracts the following k/v pairs: log, stream, time
    stage.docker {}

    // Set the extract stream value as a label
    stage.labels {
      values = {
        stream  = &amp;#34;&amp;#34;,
      }
    }
  }

  // drop the temporary container runtime label as it is no longer needed
  stage.label_drop {
    values = [&amp;#34;tmp_container_runtime&amp;#34;]
  }

  forward_to = [loki.write.loki.receiver]
}

loki.write &amp;#34;loki&amp;#34; {
  endpoint {
    url = &amp;#34;https://&amp;lt;LOKI_URL&amp;gt;/loki/api/v1/push&amp;#34;
    basic_auth {
      username = nonsensitive(remote.kubernetes.secret.credentials.data[&amp;#34;username&amp;#34;])
      password = remote.kubernetes.secret.credentials.data[&amp;#34;password&amp;#34;]
    }
}
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Replace the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;LOKI_URL&amp;gt;&lt;/code&gt;&lt;/em&gt;: The endpoint of your Loki instance.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The logging subsystem is very powerful and has many options for processing logs. For further details, see the 
    &lt;a href=&#34;/docs/agent/v0.43/flow/reference/components/&#34;&gt;component documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;integrations&#34;&gt;Integrations&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;Integration&lt;/code&gt; CRD isn&amp;rsquo;t supported with Grafana Agent Flow.
However, all static mode integrations have an equivalent component in the 
    &lt;a href=&#34;/docs/agent/v0.43/flow/reference/components/&#34;&gt;&lt;code&gt;prometheus.exporter&lt;/code&gt;&lt;/a&gt; namespace.
The [reference documentation][component documentation] should help convert those integrations to their Grafana Agent Flow equivalent.&lt;/p&gt;
]]></content><description>&lt;h1 id="migrate-from-grafana-agent-operator-to-grafana-agent-flow">Migrate from Grafana Agent Operator to Grafana Agent Flow&lt;/h1>
&lt;p>With the release of Grafana Agent Flow, Grafana Agent Operator is no longer the recommended way to deploy Grafana Agent in Kubernetes.
Some of the Operator functionality has moved into Grafana Agent Flow itself, and the Helm Chart has replaced the remaining functionality.&lt;/p></description></item><item><title>Migrate from OpenTelemetry Collector to Grafana Agent Flow</title><link>https://grafana.com/docs/agent/v0.43/flow/tasks/migrate/from-otelcol/</link><pubDate>Wed, 12 Mar 2025 11:45:31 +0100</pubDate><guid>https://grafana.com/docs/agent/v0.43/flow/tasks/migrate/from-otelcol/</guid><content><![CDATA[&lt;h1 id=&#34;migrate-from-opentelemetry-collector-to-grafana-agent-flow&#34;&gt;Migrate from OpenTelemetry Collector to Grafana Agent Flow&lt;/h1&gt;
&lt;p&gt;The built-in Grafana Agent convert command can migrate your &lt;a href=&#34;https://opentelemetry.io/docs/collector/configuration/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;OpenTelemetry Collector&lt;/a&gt; configuration to a Grafana Agent Flow configuration.&lt;/p&gt;
&lt;p&gt;This topic describes how to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Convert an OpenTelemetry Collector configuration to a Grafana Agent Flow configuration.&lt;/li&gt;
&lt;li&gt;Run an OpenTelemetry Collector configuration natively using Grafana Agent Flow.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;components-used-in-this-topic&#34;&gt;Components used in this topic&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/agent/v0.43/flow/reference/components/otelcol.receiver.otlp/&#34;&gt;otelcol.receiver.otlp&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/agent/v0.43/flow/reference/components/otelcol.processor.memory_limiter/&#34;&gt;otelcol.processor.memory_limiter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/agent/v0.43/flow/reference/components/otelcol.exporter.otlp/&#34;&gt;otelcol.exporter.otlp&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;before-you-begin&#34;&gt;Before you begin&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;You must have an existing OpenTelemetry Collector configuration.&lt;/li&gt;
&lt;li&gt;You must have a set of OpenTelemetry Collector applications ready to push telemetry data to Grafana Agent Flow.&lt;/li&gt;
&lt;li&gt;You must be familiar with the concept of 
    &lt;a href=&#34;/docs/agent/v0.43/flow/concepts/components/&#34;&gt;Components&lt;/a&gt; in Grafana Agent Flow.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;convert-an-opentelemetry-collector-configuration&#34;&gt;Convert an OpenTelemetry Collector configuration&lt;/h2&gt;
&lt;p&gt;To fully migrate your configuration from&lt;a href=&#34;https://opentelemetry.io/docs/collector/configuration/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;OpenTelemetry Collector&lt;/a&gt; to Grafana Agent Flow, you must convert your OpenTelemetry Collector configuration into a Grafana Agent Flow configuration.
This conversion will enable you to take full advantage of the many additional features available in Grafana Agent Flow.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In this task, you will use the 
    &lt;a href=&#34;/docs/agent/v0.43/flow/reference/cli/convert/&#34;&gt;convert&lt;/a&gt; CLI command to output a Grafana Agent Flow
configuration from a OpenTelemetry Collector configuration.&lt;/p&gt;&lt;/blockquote&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Open a terminal window and run the following command.&lt;/p&gt;



  

  


&lt;div data-element=&#34;tabs&#34;&gt;
  &lt;div data-element=&#34;tabs-bar&#34;&gt;
    
      &lt;div data-element=&#34;tab&#34; data-key=&#34;0&#34; data-label=&#34;static-binary&#34;&gt;static-binary&lt;/div&gt;
    
      &lt;div data-element=&#34;tab&#34; data-key=&#34;1&#34; data-label=&#34;flow-binary&#34;&gt;flow-binary&lt;/div&gt;
    
  &lt;/div&gt;
  &lt;div data-element=&#34;tab-content&#34;&gt;
    
&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;static-binary&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-static-binary&#34;&gt;AGENT_MODE=flow grafana-agent convert --source-format=otelcol --output=&amp;lt;OUTPUT_CONFIG_PATH&amp;gt; &amp;lt;INPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;flow-binary&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-flow-binary&#34;&gt;grafana-agent-flow convert --source-format=otelcol --output=&amp;lt;OUTPUT_CONFIG_PATH&amp;gt; &amp;lt;INPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Replace the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;INPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/em&gt;: The full path to the OpenTelemetry Collector configuration.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;OUTPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/em&gt;: The full path to output the Grafana Agent Flow configuration.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;
    &lt;a href=&#34;/docs/agent/v0.43/flow/get-started/run/&#34;&gt;Run&lt;/a&gt; Grafana Agent Flow using the new Grafana Agent Flow configuration from &lt;em&gt;&lt;code&gt;&amp;lt;OUTPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/em&gt;:&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;debugging&#34;&gt;Debugging&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;If the &lt;code&gt;convert&lt;/code&gt; command can&amp;rsquo;t convert an OpenTelemetry Collector configuration, diagnostic information is sent to &lt;code&gt;stderr&lt;/code&gt;.&lt;br /&gt;
You can bypass any non-critical issues and output the Grafana Agent Flow configuration using a best-effort conversion by including the &lt;code&gt;--bypass-errors&lt;/code&gt; flag.&lt;/p&gt;


&lt;div class=&#34;admonition admonition-caution&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Caution&lt;/p&gt;&lt;p&gt;If you bypass the errors, the behavior of the converted configuration may not match the original OpenTelemetry Collector configuration.
Make sure you fully test the converted configuration before using it in a production environment.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;




  

  


&lt;div data-element=&#34;tabs&#34;&gt;
  &lt;div data-element=&#34;tabs-bar&#34;&gt;
    
      &lt;div data-element=&#34;tab&#34; data-key=&#34;0&#34; data-label=&#34;static-binary&#34;&gt;static-binary&lt;/div&gt;
    
      &lt;div data-element=&#34;tab&#34; data-key=&#34;1&#34; data-label=&#34;flow-binary&#34;&gt;flow-binary&lt;/div&gt;
    
  &lt;/div&gt;
  &lt;div data-element=&#34;tab-content&#34;&gt;
    
&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;static-binary&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-static-binary&#34;&gt;AGENT_MODE=flow grafana-agent convert --source-format=otelcol --bypass-errors --output=&amp;lt;OUTPUT_CONFIG_PATH&amp;gt; &amp;lt;INPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;flow-binary&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-flow-binary&#34;&gt;grafana-agent-flow convert --source-format=otelcol --bypass-errors --output=&amp;lt;OUTPUT_CONFIG_PATH&amp;gt; &amp;lt;INPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Replace the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;INPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/em&gt;: The full path to the OpenTelemetry Collector configuration.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;OUTPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/em&gt;: The full path to output the Grafana Agent Flow configuration.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You can also output a diagnostic report by including the &lt;code&gt;--report&lt;/code&gt; flag.&lt;/p&gt;



  

  


&lt;div data-element=&#34;tabs&#34;&gt;
  &lt;div data-element=&#34;tabs-bar&#34;&gt;
    
      &lt;div data-element=&#34;tab&#34; data-key=&#34;0&#34; data-label=&#34;static-binary&#34;&gt;static-binary&lt;/div&gt;
    
      &lt;div data-element=&#34;tab&#34; data-key=&#34;1&#34; data-label=&#34;flow-binary&#34;&gt;flow-binary&lt;/div&gt;
    
  &lt;/div&gt;
  &lt;div data-element=&#34;tab-content&#34;&gt;
    
&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;static-binary&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-static-binary&#34;&gt;AGENT_MODE=flow grafana-agent convert --source-format=otelcol --report=&amp;lt;OUTPUT_REPORT_PATH&amp;gt; --output=&amp;lt;OUTPUT_CONFIG_PATH&amp;gt; &amp;lt;INPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;flow-binary&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-flow-binary&#34;&gt;grafana-agent-flow convert --source-format=otelcol --report=&amp;lt;OUTPUT_REPORT_PATH&amp;gt; --output=&amp;lt;OUTPUT_CONFIG_PATH&amp;gt; &amp;lt;INPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Replace the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;INPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/em&gt;: The full path to the OpenTelemetry Collector configuration.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;OUTPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/em&gt;: The full path to output the Grafana Agent Flow configuration.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;OUTPUT_REPORT_PATH&amp;gt;&lt;/code&gt;&lt;/em&gt;: The output path for the report.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Using the &lt;a href=&#34;#example&#34;&gt;example&lt;/a&gt; OpenTelemetry Collector configuration below, the diagnostic report provides the following information:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;plaintext&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-plaintext&#34;&gt;(Info) Converted receiver/otlp into otelcol.receiver.otlp.default
(Info) Converted processor/memory_limiter into otelcol.processor.memory_limiter.default
(Info) Converted exporter/otlp into otelcol.exporter.otlp.default

A configuration file was generated successfully.&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;run-an-opentelemetry-collector-configuration&#34;&gt;Run an OpenTelemetry Collector configuration&lt;/h2&gt;
&lt;p&gt;If you’re not ready to completely switch to a Grafana Agent Flow configuration, you can run Grafana Agent using your existing OpenTelemetry Collector configuration.
The &lt;code&gt;--config.format=otelcol&lt;/code&gt; flag tells Grafana Agent to convert your OpenTelemetry Collector configuration to a Grafana Agent Flow configuration and load it directly without saving the new configuration.
This allows you to try Grafana Agent Flow without modifying your existing OpenTelemetry Collector configuration infrastructure.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In this task, you will use the 
    &lt;a href=&#34;/docs/agent/v0.43/flow/get-started/run/&#34;&gt;run&lt;/a&gt; CLI command to run Grafana Agent Flow
using an OpenTelemetry Collector configuration.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;
    &lt;a href=&#34;/docs/agent/v0.43/flow/get-started/run/&#34;&gt;Run&lt;/a&gt; Grafana Agent Flow and include the command line flag &lt;code&gt;--config.format=otelcol&lt;/code&gt;.
Your configuration file must be a valid OpenTelemetry Collector configuration file rather than a Grafana Agent Flow configuration file.&lt;/p&gt;
&lt;h3 id=&#34;debugging-1&#34;&gt;Debugging&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;You can follow the convert CLI command &lt;a href=&#34;#debugging&#34;&gt;debugging&lt;/a&gt; instructions to generate a diagnostic report.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Refer to the Grafana Agent Flow 
    &lt;a href=&#34;/docs/agent/v0.43/flow/tasks/debug/&#34;&gt;Debugging&lt;/a&gt; for more information about a running Grafana Agent Flow.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If your OpenTelemetry Collector configuration can&amp;rsquo;t be converted and loaded directly into Grafana Agent Flow, diagnostic information is sent to &lt;code&gt;stderr&lt;/code&gt;.
You can bypass any non-critical issues and start the Agent by including the &lt;code&gt;--config.bypass-conversion-errors&lt;/code&gt; flag in addition to &lt;code&gt;--config.format=otelcol&lt;/code&gt;.&lt;/p&gt;


&lt;div class=&#34;admonition admonition-caution&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Caution&lt;/p&gt;&lt;p&gt;If you bypass the errors, the behavior of the converted configuration may not match the original Prometheus configuration.
Do not use this flag in a production environment.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;example&#34;&gt;Example&lt;/h2&gt;
&lt;p&gt;This example demonstrates converting an OpenTelemetry Collector configuration file to a Grafana Agent Flow configuration file.&lt;/p&gt;
&lt;p&gt;The following OpenTelemetry Collector configuration file provides the input for the conversion.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;receivers:
  otlp:
    protocols:
      grpc:
      http:

exporters:
  otlp:
    endpoint: database:4317

processors:
  memory_limiter:
    limit_percentage: 90
    check_interval: 1s


service:
  pipelines:
    metrics:
      receivers: [otlp]
      processors: [memory_limiter]
      exporters: [otlp]
    logs:
      receivers: [otlp]
      processors: [memory_limiter]
      exporters: [otlp]
    traces:
      receivers: [otlp]
      processors: [memory_limiter]
      exporters: [otlp]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The convert command takes the YAML file as input and outputs a 
    &lt;a href=&#34;/docs/agent/v0.43/flow/concepts/config-language/&#34;&gt;River&lt;/a&gt; file.&lt;/p&gt;



  

  


&lt;div data-element=&#34;tabs&#34;&gt;
  &lt;div data-element=&#34;tabs-bar&#34;&gt;
    
      &lt;div data-element=&#34;tab&#34; data-key=&#34;0&#34; data-label=&#34;static-binary&#34;&gt;static-binary&lt;/div&gt;
    
      &lt;div data-element=&#34;tab&#34; data-key=&#34;1&#34; data-label=&#34;flow-binary&#34;&gt;flow-binary&lt;/div&gt;
    
  &lt;/div&gt;
  &lt;div data-element=&#34;tab-content&#34;&gt;
    
&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;static-binary&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-static-binary&#34;&gt;AGENT_MODE=flow grafana-agent convert --source-format=otelcol --output=&amp;lt;OUTPUT_CONFIG_PATH&amp;gt; &amp;lt;INPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;flow-binary&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-flow-binary&#34;&gt;grafana-agent-flow convert --source-format=otelcol --output=&amp;lt;OUTPUT_CONFIG_PATH&amp;gt; &amp;lt;INPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Replace the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;INPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/em&gt;: The full path to the OpenTelemetry Collector configuration.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;OUTPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/em&gt;: The full path to output the Grafana Agent Flow configuration.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The new Grafana Agent Flow configuration file looks like this:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Alloy&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-alloy&#34;&gt;otelcol.receiver.otlp &amp;#34;default&amp;#34; {
	grpc { }

	http { }

	output {
		metrics = [otelcol.processor.memory_limiter.default.input]
		logs    = [otelcol.processor.memory_limiter.default.input]
		traces  = [otelcol.processor.memory_limiter.default.input]
	}
}

otelcol.processor.memory_limiter &amp;#34;default&amp;#34; {
	check_interval   = &amp;#34;1s&amp;#34;
	limit_percentage = 90

	output {
		metrics = [otelcol.exporter.otlp.default.input]
		logs    = [otelcol.exporter.otlp.default.input]
		traces  = [otelcol.exporter.otlp.default.input]
	}
}

otelcol.exporter.otlp &amp;#34;default&amp;#34; {
	client {
		endpoint = &amp;#34;database:4317&amp;#34;
	}
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;limitations&#34;&gt;Limitations&lt;/h2&gt;
&lt;p&gt;Configuration conversion is done on a best-effort basis. Grafana Agent will issue warnings or errors where the conversion can&amp;rsquo;t be performed.&lt;/p&gt;
&lt;p&gt;After the configuration is converted, review the Grafana Agent Flow configuration file created and verify that it&amp;rsquo;s correct before starting to use it in a production environment.&lt;/p&gt;
&lt;p&gt;The following list is specific to the convert command and not Grafana Agent Flow:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Components are supported which directly embed upstream OpenTelemetry Collector features. You can get a general idea of which exist in
Grafana Agent Flow for conversion by reviewing the &lt;code&gt;otelcol.*&lt;/code&gt; components in the 
    &lt;a href=&#34;/docs/agent/v0.43/flow/reference/components/&#34;&gt;Component Reference&lt;/a&gt;.
Any additional unsupported features are returned as errors during conversion.&lt;/li&gt;
&lt;li&gt;Check if you are using any extra command line arguments with OpenTelemetry Collector that aren&amp;rsquo;t present in your configuration file.&lt;/li&gt;
&lt;li&gt;Metamonitoring metrics exposed by Grafana Agent Flow usually match OpenTelemetry Collector metamonitoring metrics but will use a different name.
Make sure that you use the new metric names, for example, in your alerts and dashboards queries.&lt;/li&gt;
&lt;li&gt;The logs produced by Grafana Agent Flow differ from those produced by OpenTelemetry Collector.&lt;/li&gt;
&lt;li&gt;Grafana Agent exposes the Grafana Agent Flow 
    &lt;a href=&#34;/docs/agent/v0.43/flow/tasks/debug/#grafana-agent-flow-ui&#34;&gt;UI&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="migrate-from-opentelemetry-collector-to-grafana-agent-flow">Migrate from OpenTelemetry Collector to Grafana Agent Flow&lt;/h1>
&lt;p>The built-in Grafana Agent convert command can migrate your &lt;a href="https://opentelemetry.io/docs/collector/configuration/" target="_blank" rel="noopener noreferrer">OpenTelemetry Collector&lt;/a> configuration to a Grafana Agent Flow configuration.&lt;/p></description></item><item><title>Migrate from Prometheus to Grafana Agent Flow</title><link>https://grafana.com/docs/agent/v0.43/flow/tasks/migrate/from-prometheus/</link><pubDate>Wed, 12 Mar 2025 11:45:31 +0100</pubDate><guid>https://grafana.com/docs/agent/v0.43/flow/tasks/migrate/from-prometheus/</guid><content><![CDATA[&lt;h1 id=&#34;migrate-from-prometheus-to-grafana-agent-flow&#34;&gt;Migrate from Prometheus to Grafana Agent Flow&lt;/h1&gt;
&lt;p&gt;The built-in Grafana Agent convert command can migrate your &lt;a href=&#34;https://prometheus.io/docs/prometheus/latest/configuration/configuration/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Prometheus&lt;/a&gt; configuration to a Grafana Agent Flow configuration.&lt;/p&gt;
&lt;p&gt;This topic describes how to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Convert a Prometheus configuration to a Grafana Agent Flow configuration.&lt;/li&gt;
&lt;li&gt;Run a Prometheus configuration natively using Grafana Agent Flow.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;components-used-in-this-topic&#34;&gt;Components used in this topic&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/agent/v0.43/flow/reference/components/prometheus.scrape/&#34;&gt;prometheus.scrape&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/agent/v0.43/flow/reference/components/prometheus.remote_write/&#34;&gt;prometheus.remote_write&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;before-you-begin&#34;&gt;Before you begin&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;You must have an existing Prometheus configuration.&lt;/li&gt;
&lt;li&gt;You must have a set of Prometheus applications ready to push telemetry data to Grafana Agent Flow.&lt;/li&gt;
&lt;li&gt;You must be familiar with the concept of 
    &lt;a href=&#34;/docs/agent/v0.43/flow/concepts/components/&#34;&gt;Components&lt;/a&gt; in Grafana Agent Flow.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;convert-a-prometheus-configuration&#34;&gt;Convert a Prometheus configuration&lt;/h2&gt;
&lt;p&gt;To fully migrate your configuration from&lt;a href=&#34;https://prometheus.io/docs/prometheus/latest/configuration/configuration/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Prometheus&lt;/a&gt; to Grafana Agent Flow, you must convert your Prometheus configuration into a Grafana Agent Flow configuration.
This conversion will enable you to take full advantage of the many additional features available in Grafana Agent Flow.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In this task, you will use the 
    &lt;a href=&#34;/docs/agent/v0.43/flow/reference/cli/convert/&#34;&gt;convert&lt;/a&gt; CLI command to output a Grafana Agent Flow
configuration from a Prometheus configuration.&lt;/p&gt;&lt;/blockquote&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Open a terminal window and run the following command.&lt;/p&gt;



  

  


&lt;div data-element=&#34;tabs&#34;&gt;
  &lt;div data-element=&#34;tabs-bar&#34;&gt;
    
      &lt;div data-element=&#34;tab&#34; data-key=&#34;0&#34; data-label=&#34;static-binary&#34;&gt;static-binary&lt;/div&gt;
    
      &lt;div data-element=&#34;tab&#34; data-key=&#34;1&#34; data-label=&#34;flow-binary&#34;&gt;flow-binary&lt;/div&gt;
    
  &lt;/div&gt;
  &lt;div data-element=&#34;tab-content&#34;&gt;
    
&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;static-binary&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-static-binary&#34;&gt;AGENT_MODE=flow grafana-agent convert --source-format=prometheus --output=&amp;lt;OUTPUT_CONFIG_PATH&amp;gt; &amp;lt;INPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;flow-binary&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-flow-binary&#34;&gt;grafana-agent-flow convert --source-format=prometheus --output=&amp;lt;OUTPUT_CONFIG_PATH&amp;gt; &amp;lt;INPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Replace the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;INPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/em&gt;: The full path to the Prometheus configuration.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;OUTPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/em&gt;: The full path to output the Grafana Agent Flow configuration.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;
    &lt;a href=&#34;/docs/agent/v0.43/flow/reference/cli/run/&#34;&gt;Run&lt;/a&gt; Grafana Agent Flow using the new Grafana Agent Flow configuration from &lt;em&gt;&lt;code&gt;&amp;lt;OUTPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/em&gt;:&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;debugging&#34;&gt;Debugging&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;If the &lt;code&gt;convert&lt;/code&gt; command can&amp;rsquo;t convert a Prometheus configuration, diagnostic information is sent to &lt;code&gt;stderr&lt;/code&gt;.&lt;br /&gt;
You can bypass any non-critical issues and output the Grafana Agent Flow configuration using a best-effort conversion by including the &lt;code&gt;--bypass-errors&lt;/code&gt; flag.&lt;/p&gt;


&lt;div class=&#34;admonition admonition-caution&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Caution&lt;/p&gt;&lt;p&gt;If you bypass the errors, the behavior of the converted configuration may not match the original Prometheus configuration.
Make sure you fully test the converted configuration before using it in a production environment.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;




  

  


&lt;div data-element=&#34;tabs&#34;&gt;
  &lt;div data-element=&#34;tabs-bar&#34;&gt;
    
      &lt;div data-element=&#34;tab&#34; data-key=&#34;0&#34; data-label=&#34;static-binary&#34;&gt;static-binary&lt;/div&gt;
    
      &lt;div data-element=&#34;tab&#34; data-key=&#34;1&#34; data-label=&#34;flow-binary&#34;&gt;flow-binary&lt;/div&gt;
    
  &lt;/div&gt;
  &lt;div data-element=&#34;tab-content&#34;&gt;
    
&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;static-binary&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-static-binary&#34;&gt;AGENT_MODE=flow grafana-agent convert --source-format=prometheus --bypass-errors --output=&amp;lt;OUTPUT_CONFIG_PATH&amp;gt; &amp;lt;INPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;flow-binary&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-flow-binary&#34;&gt;grafana-agent-flow convert --source-format=prometheus --bypass-errors --output=&amp;lt;OUTPUT_CONFIG_PATH&amp;gt; &amp;lt;INPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Replace the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;INPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/em&gt;: The full path to the Prometheus configuration.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;OUTPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/em&gt;: The full path to output the Grafana Agent Flow configuration.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You can also output a diagnostic report by including the &lt;code&gt;--report&lt;/code&gt; flag.&lt;/p&gt;



  

  


&lt;div data-element=&#34;tabs&#34;&gt;
  &lt;div data-element=&#34;tabs-bar&#34;&gt;
    
      &lt;div data-element=&#34;tab&#34; data-key=&#34;0&#34; data-label=&#34;static-binary&#34;&gt;static-binary&lt;/div&gt;
    
      &lt;div data-element=&#34;tab&#34; data-key=&#34;1&#34; data-label=&#34;flow-binary&#34;&gt;flow-binary&lt;/div&gt;
    
  &lt;/div&gt;
  &lt;div data-element=&#34;tab-content&#34;&gt;
    
&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;static-binary&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-static-binary&#34;&gt;AGENT_MODE=flow grafana-agent convert --source-format=prometheus --report=&amp;lt;OUTPUT_REPORT_PATH&amp;gt; --output=&amp;lt;OUTPUT_CONFIG_PATH&amp;gt; &amp;lt;INPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;flow-binary&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-flow-binary&#34;&gt;grafana-agent-flow convert --source-format=prometheus --report=&amp;lt;OUTPUT_REPORT_PATH&amp;gt; --output=&amp;lt;OUTPUT_CONFIG_PATH&amp;gt; &amp;lt;INPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Replace the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;INPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/em&gt;: The full path to the Prometheus configuration.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;OUTPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/em&gt;: The full path to output the Grafana Agent Flow configuration.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;OUTPUT_REPORT_PATH&amp;gt;&lt;/code&gt;&lt;/em&gt;: The output path for the report.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Using the &lt;a href=&#34;#example&#34;&gt;example&lt;/a&gt; Prometheus configuration below, the diagnostic report provides the following information:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;plaintext&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-plaintext&#34;&gt;(Info) Converted scrape_configs job_name &amp;#34;prometheus&amp;#34; into...
  A prometheus.scrape.prometheus component
(Info) Converted 1 remote_write[s] &amp;#34;grafana-cloud&amp;#34; into...
  A prometheus.remote_write.default component&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;run-a-prometheus-configuration&#34;&gt;Run a Prometheus configuration&lt;/h2&gt;
&lt;p&gt;If you’re not ready to completely switch to a Grafana Agent Flow configuration, you can run Grafana Agent using your existing Prometheus configuration.
The &lt;code&gt;--config.format=prometheus&lt;/code&gt; flag tells Grafana Agent to convert your Prometheus configuration to a Grafana Agent Flow configuration and load it directly without saving the new configuration.
This allows you to try Grafana Agent Flow without modifying your existing Prometheus configuration infrastructure.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In this task, you will use the 
    &lt;a href=&#34;/docs/agent/v0.43/flow/reference/cli/run/&#34;&gt;run&lt;/a&gt; CLI command to run Grafana Agent Flow
using a Prometheus configuration.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;
    &lt;a href=&#34;/docs/agent/v0.43/flow/reference/cli/run/&#34;&gt;Run&lt;/a&gt; Grafana Agent Flow and include the command line flag &lt;code&gt;--config.format=prometheus&lt;/code&gt;.
Your configuration file must be a valid Prometheus configuration file rather than a Grafana Agent Flow configuration file.&lt;/p&gt;
&lt;h3 id=&#34;debugging-1&#34;&gt;Debugging&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;You can follow the convert CLI command &lt;a href=&#34;#debugging&#34;&gt;debugging&lt;/a&gt; instructions to generate a diagnostic report.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Refer to the Grafana Agent Flow 
    &lt;a href=&#34;/docs/agent/v0.43/flow/tasks/debug/&#34;&gt;Debugging&lt;/a&gt; for more information about a running Grafana Agent Flow.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If your Prometheus configuration can&amp;rsquo;t be converted and loaded directly into Grafana Agent Flow, diagnostic information is sent to &lt;code&gt;stderr&lt;/code&gt;.
You can bypass any non-critical issues and start the Agent by including the &lt;code&gt;--config.bypass-conversion-errors&lt;/code&gt; flag in addition to &lt;code&gt;--config.format=prometheus&lt;/code&gt;.&lt;/p&gt;


&lt;div class=&#34;admonition admonition-caution&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Caution&lt;/p&gt;&lt;p&gt;If you bypass the errors, the behavior of the converted configuration may not match the original Prometheus configuration.
Do not use this flag in a production environment.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;example&#34;&gt;Example&lt;/h2&gt;
&lt;p&gt;This example demonstrates converting a Prometheus configuration file to a Grafana Agent Flow configuration file.&lt;/p&gt;
&lt;p&gt;The following Prometheus configuration file provides the input for the conversion.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;global:
  scrape_timeout:    45s

scrape_configs:
  - job_name: &amp;#34;prometheus&amp;#34;
    static_configs:
      - targets: [&amp;#34;localhost:12345&amp;#34;]

remote_write:
  - name: &amp;#34;grafana-cloud&amp;#34;
    url: &amp;#34;https://prometheus-us-central1.grafana.net/api/prom/push&amp;#34;
    basic_auth:
      username: &amp;lt;USERNAME&amp;gt;
      password: &amp;lt;PASSWORD&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The convert command takes the YAML file as input and outputs a 
    &lt;a href=&#34;/docs/agent/v0.43/flow/concepts/config-language/&#34;&gt;River&lt;/a&gt; file.&lt;/p&gt;



  

  


&lt;div data-element=&#34;tabs&#34;&gt;
  &lt;div data-element=&#34;tabs-bar&#34;&gt;
    
      &lt;div data-element=&#34;tab&#34; data-key=&#34;0&#34; data-label=&#34;static-binary&#34;&gt;static-binary&lt;/div&gt;
    
      &lt;div data-element=&#34;tab&#34; data-key=&#34;1&#34; data-label=&#34;flow-binary&#34;&gt;flow-binary&lt;/div&gt;
    
  &lt;/div&gt;
  &lt;div data-element=&#34;tab-content&#34;&gt;
    
&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;static-binary&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-static-binary&#34;&gt;AGENT_MODE=flow grafana-agent convert --source-format=prometheus --output=&amp;lt;OUTPUT_CONFIG_PATH&amp;gt; &amp;lt;INPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;flow-binary&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-flow-binary&#34;&gt;grafana-agent-flow convert --source-format=prometheus --output=&amp;lt;OUTPUT_CONFIG_PATH&amp;gt; &amp;lt;INPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Replace the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;INPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/em&gt;: The full path to the Prometheus configuration.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;OUTPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/em&gt;: The full path to output the Grafana Agent Flow configuration.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The new Grafana Agent Flow configuration file looks like this:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Alloy&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-alloy&#34;&gt;prometheus.scrape &amp;#34;prometheus&amp;#34; {
  targets = [{
    __address__ = &amp;#34;localhost:12345&amp;#34;,
  }]
  forward_to     = [prometheus.remote_write.default.receiver]
  job_name       = &amp;#34;prometheus&amp;#34;
  scrape_timeout = &amp;#34;45s&amp;#34;
}

prometheus.remote_write &amp;#34;default&amp;#34; {
  endpoint {
    name = &amp;#34;grafana-cloud&amp;#34;
    url  = &amp;#34;https://prometheus-us-central1.grafana.net/api/prom/push&amp;#34;

    basic_auth {
      username = &amp;#34;USERNAME&amp;#34;
      password = &amp;#34;PASSWORD&amp;#34;
    }

    queue_config {
      capacity             = 2500
      max_shards           = 200
      max_samples_per_send = 500
    }

    metadata_config {
      max_samples_per_send = 500
    }
  }
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;limitations&#34;&gt;Limitations&lt;/h2&gt;
&lt;p&gt;Configuration conversion is done on a best-effort basis. Grafana Agent will issue warnings or errors where the conversion can&amp;rsquo;t be performed.&lt;/p&gt;
&lt;p&gt;After the configuration is converted, review the Grafana Agent Flow configuration file created and verify that it&amp;rsquo;s correct before starting to use it in a production environment.&lt;/p&gt;
&lt;p&gt;The following list is specific to the convert command and not Grafana Agent Flow:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The following configurations aren&amp;rsquo;t available for conversion to Grafana Agent Flow: &lt;code&gt;rule_files&lt;/code&gt;, &lt;code&gt;alerting&lt;/code&gt;, &lt;code&gt;remote_read&lt;/code&gt;, &lt;code&gt;storage&lt;/code&gt;, and &lt;code&gt;tracing&lt;/code&gt;.
Any additional unsupported features are returned as errors during conversion.&lt;/li&gt;
&lt;li&gt;Check if you are using any extra command line arguments with Prometheus that aren&amp;rsquo;t present in your configuration file. For example, &lt;code&gt;--web.listen-address&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Metamonitoring metrics exposed by Grafana Agent Flow usually match Prometheus metamonitoring metrics but will use a different name.
Make sure that you use the new metric names, for example, in your alerts and dashboards queries.&lt;/li&gt;
&lt;li&gt;The logs produced by Grafana Agent Flow differ from those produced by Prometheus.&lt;/li&gt;
&lt;li&gt;Grafana Agent exposes the Grafana Agent Flow 
    &lt;a href=&#34;/docs/agent/v0.43/flow/tasks/debug/#grafana-agent-flow-ui&#34;&gt;UI&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="migrate-from-prometheus-to-grafana-agent-flow">Migrate from Prometheus to Grafana Agent Flow&lt;/h1>
&lt;p>The built-in Grafana Agent convert command can migrate your &lt;a href="https://prometheus.io/docs/prometheus/latest/configuration/configuration/" target="_blank" rel="noopener noreferrer">Prometheus&lt;/a> configuration to a Grafana Agent Flow configuration.&lt;/p>
&lt;p>This topic describes how to:&lt;/p></description></item><item><title>Migrate from Promtail to Grafana Agent Flow</title><link>https://grafana.com/docs/agent/v0.43/flow/tasks/migrate/from-promtail/</link><pubDate>Wed, 12 Mar 2025 11:45:31 +0100</pubDate><guid>https://grafana.com/docs/agent/v0.43/flow/tasks/migrate/from-promtail/</guid><content><![CDATA[&lt;h1 id=&#34;migrate-from-promtail-to-grafana-agent-flow&#34;&gt;Migrate from Promtail to Grafana Agent Flow&lt;/h1&gt;
&lt;p&gt;The built-in Grafana Agent convert command can migrate your 
    &lt;a href=&#34;https://www.grafana.com/docs/loki/v0.43/clients/promtail/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Promtail&lt;/a&gt; configuration to a Grafana Agent Flow configuration.&lt;/p&gt;
&lt;p&gt;This topic describes how to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Convert a Promtail configuration to a Grafana Agent Flow configuration.&lt;/li&gt;
&lt;li&gt;Run a Promtail configuration natively using Grafana Agent Flow.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;components-used-in-this-topic&#34;&gt;Components used in this topic&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/agent/v0.43/flow/reference/components/local.file_match/&#34;&gt;local.file_match&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/agent/v0.43/flow/reference/components/loki.source.file/&#34;&gt;loki.source.file&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/agent/v0.43/flow/reference/components/loki.write/&#34;&gt;loki.write&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;before-you-begin&#34;&gt;Before you begin&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;You must have an existing Promtail configuration.&lt;/li&gt;
&lt;li&gt;You must be familiar with the concept of 
    &lt;a href=&#34;/docs/agent/v0.43/flow/concepts/components/&#34;&gt;Components&lt;/a&gt; in Grafana Agent Flow.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;convert-a-promtail-configuration&#34;&gt;Convert a Promtail configuration&lt;/h2&gt;
&lt;p&gt;To fully migrate from
    &lt;a href=&#34;https://www.grafana.com/docs/loki/v0.43/clients/promtail/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Promtail&lt;/a&gt; to Grafana Agent Flow, you must convert your Promtail configuration into a Grafana Agent Flow configuration.
This conversion will enable you to take full advantage of the many additional features available in Grafana Agent Flow.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In this task, you will use the 
    &lt;a href=&#34;/docs/agent/v0.43/flow/reference/cli/convert/&#34;&gt;convert&lt;/a&gt; CLI command to output a Grafana Agent Flow
configuration from a Promtail configuration.&lt;/p&gt;&lt;/blockquote&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Open a terminal window and run the following command.&lt;/p&gt;



  

  


&lt;div data-element=&#34;tabs&#34;&gt;
  &lt;div data-element=&#34;tabs-bar&#34;&gt;
    
      &lt;div data-element=&#34;tab&#34; data-key=&#34;0&#34; data-label=&#34;static-binary&#34;&gt;static-binary&lt;/div&gt;
    
      &lt;div data-element=&#34;tab&#34; data-key=&#34;1&#34; data-label=&#34;flow-binary&#34;&gt;flow-binary&lt;/div&gt;
    
  &lt;/div&gt;
  &lt;div data-element=&#34;tab-content&#34;&gt;
    
&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;static-binary&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-static-binary&#34;&gt;AGENT_MODE=flow grafana-agent convert --source-format=promtail --output=&amp;lt;OUTPUT_CONFIG_PATH&amp;gt; &amp;lt;INPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;flow-binary&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-flow-binary&#34;&gt;grafana-agent-flow convert --source-format=promtail --output=&amp;lt;OUTPUT_CONFIG_PATH&amp;gt; &amp;lt;INPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Replace the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;INPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/em&gt;: The full path to the Promtail configuration.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;OUTPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/em&gt;: The full path to output the Grafana Agent Flow configuration.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;
    &lt;a href=&#34;/docs/agent/v0.43/flow/get-started/run/&#34;&gt;Run&lt;/a&gt; Grafana Agent Flow using the new configuration from &lt;em&gt;&lt;code&gt;&amp;lt;OUTPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/em&gt;:&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;debugging&#34;&gt;Debugging&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;If the convert command can&amp;rsquo;t convert a Promtail configuration, diagnostic information is sent to &lt;code&gt;stderr&lt;/code&gt;.
You can bypass any non-critical issues and output the Grafana Agent Flow configuration using a best-effort conversion by including the &lt;code&gt;--bypass-errors&lt;/code&gt; flag.&lt;/p&gt;


&lt;div class=&#34;admonition admonition-caution&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Caution&lt;/p&gt;&lt;p&gt;If you bypass the errors, the behavior of the converted configuration may not match the original Promtail configuration.
Make sure you fully test the converted configuration before using it in a production environment.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;




  

  


&lt;div data-element=&#34;tabs&#34;&gt;
  &lt;div data-element=&#34;tabs-bar&#34;&gt;
    
      &lt;div data-element=&#34;tab&#34; data-key=&#34;0&#34; data-label=&#34;static-binary&#34;&gt;static-binary&lt;/div&gt;
    
      &lt;div data-element=&#34;tab&#34; data-key=&#34;1&#34; data-label=&#34;flow-binary&#34;&gt;flow-binary&lt;/div&gt;
    
  &lt;/div&gt;
  &lt;div data-element=&#34;tab-content&#34;&gt;
    
&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;static-binary&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-static-binary&#34;&gt;AGENT_MODE=flow grafana-agent convert --source-format=promtail --bypass-errors --output=&amp;lt;OUTPUT_CONFIG_PATH&amp;gt; &amp;lt;INPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;flow-binary&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-flow-binary&#34;&gt;grafana-agent-flow convert --source-format=promtail --bypass-errors --output=&amp;lt;OUTPUT_CONFIG_PATH&amp;gt; &amp;lt;INPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Replace the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;INPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/em&gt;: The full path to the Promtail configuration.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;OUTPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/em&gt;: The full path to output the Grafana Agent Flow configuration.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You can also output a diagnostic report by including the &lt;code&gt;--report&lt;/code&gt; flag.&lt;/p&gt;



  

  


&lt;div data-element=&#34;tabs&#34;&gt;
  &lt;div data-element=&#34;tabs-bar&#34;&gt;
    
      &lt;div data-element=&#34;tab&#34; data-key=&#34;0&#34; data-label=&#34;static-binary&#34;&gt;static-binary&lt;/div&gt;
    
      &lt;div data-element=&#34;tab&#34; data-key=&#34;1&#34; data-label=&#34;flow-binary&#34;&gt;flow-binary&lt;/div&gt;
    
  &lt;/div&gt;
  &lt;div data-element=&#34;tab-content&#34;&gt;
    
&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;static-binary&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-static-binary&#34;&gt;AGENT_MODE=flow grafana-agent convert --source-format=promtail --report=&amp;lt;OUTPUT_REPORT_PATH&amp;gt; --output=&amp;lt;OUTPUT_CONFIG_PATH&amp;gt; &amp;lt;INPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;flow-binary&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-flow-binary&#34;&gt;grafana-agent-flow convert --source-format=promtail --report=&amp;lt;OUTPUT_REPORT_PATH&amp;gt; --output=&amp;lt;OUTPUT_CONFIG_PATH&amp;gt; &amp;lt;INPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Replace the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;INPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/em&gt;: The full path to the Promtail configuration.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;OUTPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/em&gt;: The full path to output the Grafana Agent Flow configuration.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;OUTPUT_REPORT_PATH&amp;gt;&lt;/code&gt;&lt;/em&gt;: The output path for the report.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you use the &lt;a href=&#34;#example&#34;&gt;example&lt;/a&gt; Promtail configuration below, the diagnostic report provides the following information:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;plaintext&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-plaintext&#34;&gt;(Warning) If you have a tracing set up for Promtail, it cannot be migrated to Grafana Agent Flow automatically. Refer to the documentation on how to configure tracing in Grafana Agent Flow.
(Warning) The metrics from Grafana Agent Flow are different from the metrics emitted by Promtail. If you rely on Promtail&amp;#39;s metrics, you must change your configuration, for example, your alerts and dashboards.&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;run-a-promtail-configuration&#34;&gt;Run a Promtail configuration&lt;/h2&gt;
&lt;p&gt;If you’re not ready to completely switch to a Grafana Agent Flow configuration, you can run Grafana Agent using your existing Promtail configuration.
The &lt;code&gt;--config.format=promtail&lt;/code&gt; flag tells Grafana Agent to convert your Promtail configuration to Grafana Agent Flow and load it directly without saving the new configuration.
This allows you to try Grafana Agent Flow without modifying your existing Promtail configuration infrastructure.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In this task, you will use the 
    &lt;a href=&#34;/docs/agent/v0.43/flow/get-started/run/&#34;&gt;run&lt;/a&gt; CLI command to run Grafana Agent Flow using a Promtail configuration.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;
    &lt;a href=&#34;/docs/agent/v0.43/flow/get-started/run/&#34;&gt;Run&lt;/a&gt; Grafana Agent Flow and include the command line flag &lt;code&gt;--config.format=promtail&lt;/code&gt;.
Your configuration file must be a valid Promtail configuration file rather than a Grafana Agent Flow configuration file.&lt;/p&gt;
&lt;h3 id=&#34;debugging-1&#34;&gt;Debugging&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;You can follow the convert CLI command &lt;a href=&#34;#debugging&#34;&gt;debugging&lt;/a&gt; instructions to generate a diagnostic report.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Refer to the Grafana Agent Flow  
    &lt;a href=&#34;/docs/agent/v0.43/flow/tasks/debug/&#34;&gt;Debugging&lt;/a&gt; for more information about running Grafana Agent Flow.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If your Promtail configuration can&amp;rsquo;t be converted and loaded directly into Grafana Agent, diagnostic information is sent to &lt;code&gt;stderr&lt;/code&gt;.
You can bypass any non-critical issues and start Grafana Agent by including the &lt;code&gt;--config.bypass-conversion-errors&lt;/code&gt; flag in addition to &lt;code&gt;--config.format=promtail&lt;/code&gt;.&lt;/p&gt;


&lt;div class=&#34;admonition admonition-caution&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Caution&lt;/p&gt;&lt;p&gt;If you bypass the errors, the behavior of the converted configuration may not match the original Promtail configuration.
Do not use this flag in a production environment.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;example&#34;&gt;Example&lt;/h2&gt;
&lt;p&gt;This example demonstrates converting a Promtail configuration file to a Grafana Agent Flow configuration file.&lt;/p&gt;
&lt;p&gt;The following Promtail configuration file provides the input for the conversion.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;clients:
  - url: http://localhost/loki/api/v1/push
scrape_configs:
  - job_name: example
    static_configs:
      - targets:
          - localhost
        labels:
          __path__: /var/log/*.log&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The convert command takes the YAML file as input and outputs a 
    &lt;a href=&#34;/docs/agent/v0.43/flow/concepts/config-language/&#34;&gt;River&lt;/a&gt; file.&lt;/p&gt;



  

  


&lt;div data-element=&#34;tabs&#34;&gt;
  &lt;div data-element=&#34;tabs-bar&#34;&gt;
    
      &lt;div data-element=&#34;tab&#34; data-key=&#34;0&#34; data-label=&#34;static-binary&#34;&gt;static-binary&lt;/div&gt;
    
      &lt;div data-element=&#34;tab&#34; data-key=&#34;1&#34; data-label=&#34;flow-binary&#34;&gt;flow-binary&lt;/div&gt;
    
  &lt;/div&gt;
  &lt;div data-element=&#34;tab-content&#34;&gt;
    
&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;static-binary&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-static-binary&#34;&gt;AGENT_MODE=flow grafana-agent convert --source-format=promtail --output=&amp;lt;OUTPUT_CONFIG_PATH&amp;gt; &amp;lt;INPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;flow-binary&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-flow-binary&#34;&gt;grafana-agent-flow convert --source-format=promtail --output=&amp;lt;OUTPUT_CONFIG_PATH&amp;gt; &amp;lt;INPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Replace the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;INPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/em&gt;: The full path to the Promtail configuration.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;OUTPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/em&gt;: The full path to output the Grafana Agent Flow configuration.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The new Grafana Agent Flow configuration file looks like this:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Alloy&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-alloy&#34;&gt;local.file_match &amp;#34;example&amp;#34; {
	path_targets = [{
		__address__ = &amp;#34;localhost&amp;#34;,
		__path__    = &amp;#34;/var/log/*.log&amp;#34;,
	}]
}

loki.source.file &amp;#34;example&amp;#34; {
	targets    = local.file_match.example.targets
	forward_to = [loki.write.default.receiver]
}

loki.write &amp;#34;default&amp;#34; {
	endpoint {
		url = &amp;#34;http://localhost/loki/api/v1/push&amp;#34;
	}
	external_labels = {}
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;limitations&#34;&gt;Limitations&lt;/h2&gt;
&lt;p&gt;Configuration conversion is done on a best-effort basis. Grafana Agent will issue warnings or errors where the conversion can&amp;rsquo;t be performed.&lt;/p&gt;
&lt;p&gt;After the configuration is converted, review the Grafana Agent Flow configuration file created and verify that it&amp;rsquo;s correct before starting to use it in a production environment.&lt;/p&gt;
&lt;p&gt;The following list is specific to the convert command and not Grafana Agent Flow:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Check if you are using any extra command line arguments with Promtail that aren&amp;rsquo;t present in your configuration file. For example, &lt;code&gt;-max-line-size&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Check if you are setting any environment variables, whether 
    &lt;a href=&#34;https://www.grafana.com/docs/loki/v0.43/clients/promtail/configuration/#use-environment-variables-in-the-configuration&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;expanded in the configuration file&lt;/a&gt; itself or consumed directly by Promtail, such as &lt;code&gt;JAEGER_AGENT_HOST&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;In Grafana Agent Flow, the positions file is saved at a different location.
Refer to the 
    &lt;a href=&#34;/docs/agent/v0.43/flow/reference/components/loki.source.file/&#34;&gt;loki.source.file&lt;/a&gt; documentation for more details.
Check if you have any existing setup, for example, a Kubernetes Persistent Volume, that you must update to use the new positions file path.&lt;/li&gt;
&lt;li&gt;Metamonitoring metrics exposed by Grafana Agent Flow usually match Promtail metamonitoring metrics but will use a different name.
Make sure that you use the new metric names, for example, in your alerts and dashboards queries.&lt;/li&gt;
&lt;li&gt;The logs produced by Grafana Agent Flow will differ from those produced by Promtail.&lt;/li&gt;
&lt;li&gt;Grafana Agent Flow exposes the Grafana Agent Flow 
    &lt;a href=&#34;/docs/agent/v0.43/flow/tasks/debug/#grafana-agent-flow-ui&#34;&gt;UI&lt;/a&gt;, which differs from Promtail&amp;rsquo;s Web UI.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="migrate-from-promtail-to-grafana-agent-flow">Migrate from Promtail to Grafana Agent Flow&lt;/h1>
&lt;p>The built-in Grafana Agent convert command can migrate your
&lt;a href="https://www.grafana.com/docs/loki/v0.43/clients/promtail/" target="_blank" rel="noopener noreferrer">Promtail&lt;/a> configuration to a Grafana Agent Flow configuration.&lt;/p>
&lt;p>This topic describes how to:&lt;/p></description></item><item><title>Migrate Grafana Agent Static to Grafana Agent Flow</title><link>https://grafana.com/docs/agent/v0.43/flow/tasks/migrate/from-static/</link><pubDate>Wed, 11 Sep 2024 17:43:35 +0000</pubDate><guid>https://grafana.com/docs/agent/v0.43/flow/tasks/migrate/from-static/</guid><content><![CDATA[&lt;h1 id=&#34;migrate-from-grafana-agent-static-to-grafana-agent-flow&#34;&gt;Migrate from Grafana Agent Static to Grafana Agent Flow&lt;/h1&gt;
&lt;p&gt;The built-in Grafana Agent convert command can migrate your 
    &lt;a href=&#34;/docs/agent/v0.43/static/&#34;&gt;Static&lt;/a&gt; configuration to a Grafana Agent Flow configuration.&lt;/p&gt;
&lt;p&gt;This topic describes how to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Convert a Grafana Agent Static configuration to a Grafana Agent Flow configuration.&lt;/li&gt;
&lt;li&gt;Run a Grafana Agent Static configuration natively using Grafana Agent Flow.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;components-used-in-this-topic&#34;&gt;Components used in this topic&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/agent/v0.43/flow/reference/components/prometheus.scrape/&#34;&gt;prometheus.scrape&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/agent/v0.43/flow/reference/components/prometheus.remote_write/&#34;&gt;prometheus.remote_write&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/agent/v0.43/flow/reference/components/local.file_match/&#34;&gt;local.file_match&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/agent/v0.43/flow/reference/components/loki.process/&#34;&gt;loki.process&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/agent/v0.43/flow/reference/components/loki.source.file/&#34;&gt;loki.source.file&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/agent/v0.43/flow/reference/components/loki.write/&#34;&gt;loki.write&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;before-you-begin&#34;&gt;Before you begin&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;You must have an existing Grafana Agent Static configuration.&lt;/li&gt;
&lt;li&gt;You must be familiar with the 
    &lt;a href=&#34;/docs/agent/v0.43/flow/concepts/components/&#34;&gt;Components&lt;/a&gt; concept in Grafana Agent Flow.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;convert-a-grafana-agent-static-configuration&#34;&gt;Convert a Grafana Agent Static configuration&lt;/h2&gt;
&lt;p&gt;To fully migrate Grafana Agent 
    &lt;a href=&#34;/docs/agent/v0.43/static/&#34;&gt;Static&lt;/a&gt; to Grafana Agent Flow, you must convert your Static configuration into a Grafana Agent Flow configuration.
This conversion will enable you to take full advantage of the many additional features available in Grafana Agent Flow.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In this task, you will use the 
    &lt;a href=&#34;/docs/agent/v0.43/flow/reference/cli/convert/&#34;&gt;convert&lt;/a&gt; CLI command to output a Grafana Agent Flow
configuration from a Static configuration.&lt;/p&gt;&lt;/blockquote&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Open a terminal window and run the following command.&lt;/p&gt;



  

  


&lt;div data-element=&#34;tabs&#34;&gt;
  &lt;div data-element=&#34;tabs-bar&#34;&gt;
    
      &lt;div data-element=&#34;tab&#34; data-key=&#34;0&#34; data-label=&#34;static-binary&#34;&gt;static-binary&lt;/div&gt;
    
      &lt;div data-element=&#34;tab&#34; data-key=&#34;1&#34; data-label=&#34;flow-binary&#34;&gt;flow-binary&lt;/div&gt;
    
  &lt;/div&gt;
  &lt;div data-element=&#34;tab-content&#34;&gt;
    
&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;static-binary&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-static-binary&#34;&gt;AGENT_MODE=flow grafana-agent convert --source-format=static --output=&amp;lt;OUTPUT_CONFIG_PATH&amp;gt; &amp;lt;INPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;flow-binary&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-flow-binary&#34;&gt;grafana-agent-flow convert --source-format=static --output=&amp;lt;OUTPUT_CONFIG_PATH&amp;gt; &amp;lt;INPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Replace the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;INPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/em&gt;: The full path to the 
    &lt;a href=&#34;/docs/agent/v0.43/static/&#34;&gt;Static&lt;/a&gt; configuration.&lt;/li&gt;
&lt;li&gt;_&lt;code&gt;&amp;lt;OUTPUT_CONFIG_PATH&amp;gt;_&lt;/code&gt;: The full path to output the Grafana Agent Flow configuration.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;
    &lt;a href=&#34;/docs/agent/v0.43/flow/reference/cli/run/&#34;&gt;Run&lt;/a&gt; Grafana Agent Flow using the new Grafana Agent Flow configuration from &lt;em&gt;&lt;code&gt;&amp;lt;OUTPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/em&gt;:&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;debugging&#34;&gt;Debugging&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;If the convert command can&amp;rsquo;t convert a 
    &lt;a href=&#34;/docs/agent/v0.43/static/&#34;&gt;Static&lt;/a&gt; configuration, diagnostic information is sent to &lt;code&gt;stderr&lt;/code&gt;.
You can use the &lt;code&gt;--bypass-errors&lt;/code&gt; flag to bypass any non-critical issues and output the Grafana Agent Flow configuration using a best-effort conversion.&lt;/p&gt;


&lt;div class=&#34;admonition admonition-caution&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Caution&lt;/p&gt;&lt;p&gt;If you bypass the errors, the behavior of the converted configuration may not match the original Grafana Agent Static configuration.
Make sure you fully test the converted configuration before using it in a production environment.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;




  

  


&lt;div data-element=&#34;tabs&#34;&gt;
  &lt;div data-element=&#34;tabs-bar&#34;&gt;
    
      &lt;div data-element=&#34;tab&#34; data-key=&#34;0&#34; data-label=&#34;static-binary&#34;&gt;static-binary&lt;/div&gt;
    
      &lt;div data-element=&#34;tab&#34; data-key=&#34;1&#34; data-label=&#34;flow-binary&#34;&gt;flow-binary&lt;/div&gt;
    
  &lt;/div&gt;
  &lt;div data-element=&#34;tab-content&#34;&gt;
    
&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;static-binary&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-static-binary&#34;&gt;AGENT_MODE=flow grafana-agent convert --source-format=static --bypass-errors --output=&amp;lt;OUTPUT_CONFIG_PATH&amp;gt; &amp;lt;INPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;flow-binary&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-flow-binary&#34;&gt;grafana-agent-flow convert --source-format=static --bypass-errors --output=&amp;lt;OUTPUT_CONFIG_PATH&amp;gt; &amp;lt;INPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Replace the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;INPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/em&gt;: The full path to the 
    &lt;a href=&#34;/docs/agent/v0.43/static/&#34;&gt;Static&lt;/a&gt; configuration.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;OUTPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/em&gt;: The full path to output the Grafana Agent Flow configuration.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You can use the &lt;code&gt;--report&lt;/code&gt; flag to output a diagnostic report.&lt;/p&gt;



  

  


&lt;div data-element=&#34;tabs&#34;&gt;
  &lt;div data-element=&#34;tabs-bar&#34;&gt;
    
      &lt;div data-element=&#34;tab&#34; data-key=&#34;0&#34; data-label=&#34;static-binary&#34;&gt;static-binary&lt;/div&gt;
    
      &lt;div data-element=&#34;tab&#34; data-key=&#34;1&#34; data-label=&#34;flow-binary&#34;&gt;flow-binary&lt;/div&gt;
    
  &lt;/div&gt;
  &lt;div data-element=&#34;tab-content&#34;&gt;
    
&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;static-binary&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-static-binary&#34;&gt;AGENT_MODE=flow grafana-agent convert --source-format=static --report=&amp;lt;OUTPUT_REPORT_PATH&amp;gt; --output=&amp;lt;OUTPUT_CONFIG_PATH&amp;gt; &amp;lt;INPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;flow-binary&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-flow-binary&#34;&gt;grafana-agent-flow convert --source-format=static --report=&amp;lt;OUTPUT_REPORT_PATH&amp;gt; --output=&amp;lt;OUTPUT_CONFIG_PATH&amp;gt; &amp;lt;INPUT_CONFIG_PATH&amp;gt;
 ```&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Replace the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;INPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/em&gt;: The full path to the 
    &lt;a href=&#34;/docs/agent/v0.43/static/&#34;&gt;Static&lt;/a&gt; configuration.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;OUTPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/em&gt;: The full path to output the Grafana Agent Flow configuration.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;OUTPUT_REPORT_PATH&amp;gt;&lt;/code&gt;&lt;/em&gt;: The output path for the report.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Using the &lt;a href=&#34;#example&#34;&gt;example&lt;/a&gt; Grafana Agent Static configuration below, the diagnostic report provides the following information.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;plaintext&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-plaintext&#34;&gt;(Warning) Please review your agent command line flags and ensure they are set in your Grafana Agent Flow configuration file where necessary.&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;run-a-static-mode-configuration&#34;&gt;Run a Static mode configuration&lt;/h2&gt;
&lt;p&gt;If you’re not ready to completely switch to a Grafana Agent Flow configuration, you can run Grafana Agent using your existing Grafana Agent Static configuration.
The &lt;code&gt;--config.format=static&lt;/code&gt; flag tells Grafana Agent to convert your
    &lt;a href=&#34;/docs/agent/v0.43/static/&#34;&gt;Static&lt;/a&gt; configuration to Grafana Agent Flow and load it directly without saving the new configuration.
This allows you to try Grafana Agent Flow without modifying your existing Grafana Agent Static configuration infrastructure.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In this task, you will use the 
    &lt;a href=&#34;/docs/agent/v0.43/flow/reference/cli/run/&#34;&gt;run&lt;/a&gt; CLI command to run Grafana Agent Flow using a Static configuration.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;
    &lt;a href=&#34;/docs/agent/v0.43/flow/reference/cli/run/&#34;&gt;Run&lt;/a&gt; Grafana Agent Flow and include the command line flag &lt;code&gt;--config.format=static&lt;/code&gt;.
Your configuration file must be a valid
    &lt;a href=&#34;/docs/agent/v0.43/static/&#34;&gt;Static&lt;/a&gt; configuration file.&lt;/p&gt;
&lt;h3 id=&#34;debugging-1&#34;&gt;Debugging&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;You can follow the convert CLI command &lt;a href=&#34;#debugging&#34;&gt;debugging&lt;/a&gt; instructions to generate a diagnostic report.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Refer to the Grafana Agent Flow 
    &lt;a href=&#34;/docs/agent/v0.43/flow/tasks/debug/&#34;&gt;debugging UI&lt;/a&gt; for more information about running Grafana Agent Flow.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If your
    &lt;a href=&#34;/docs/agent/v0.43/static/&#34;&gt;Static&lt;/a&gt; configuration can&amp;rsquo;t be converted and loaded directly into Grafana Agent Flow, diagnostic information is sent to &lt;code&gt;stderr&lt;/code&gt;.
You can use the &lt;code&gt;--config.bypass-conversion-errors&lt;/code&gt; flag with &lt;code&gt;--config.format=static&lt;/code&gt; to bypass any non-critical issues and start Grafana Agent Flow.&lt;/p&gt;


&lt;div class=&#34;admonition admonition-caution&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Caution&lt;/p&gt;&lt;p&gt;If you bypass the errors, the behavior of the converted configuration may not match the original Grafana Agent Static configuration.
Do not use this flag in a production environment.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;example&#34;&gt;Example&lt;/h2&gt;
&lt;p&gt;This example demonstrates converting a
    &lt;a href=&#34;/docs/agent/v0.43/static/&#34;&gt;Static&lt;/a&gt; configuration file to a Grafana Agent Flow configuration file.&lt;/p&gt;
&lt;p&gt;The following
    &lt;a href=&#34;/docs/agent/v0.43/static/&#34;&gt;Static&lt;/a&gt; configuration file provides the input for the conversion.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;server:
  log_level: info

metrics:
  global:
    scrape_interval: 15s
    remote_write:
      - url: https://prometheus-us-central1.grafana.net/api/prom/push
        basic_auth:
          username: USERNAME
          password: PASSWORD
  configs:
    - name: test
      host_filter: false
      scrape_configs:
        - job_name: local-agent
          static_configs:
            - targets: [&amp;#39;127.0.0.1:12345&amp;#39;]
              labels:
                cluster: &amp;#39;localhost&amp;#39;

logs:
  global:
    file_watch_config:
      min_poll_frequency: 1s
      max_poll_frequency: 5s
  positions_directory: /var/lib/agent/data-agent
  configs:
    - name: varlogs
      scrape_configs:
        - job_name: varlogs
          static_configs:
            - targets:
              - localhost
              labels:
                job: varlogs
                host: mylocalhost
                __path__: /var/log/*.log
          pipeline_stages:
            - match:
                selector: &amp;#39;{filename=&amp;#34;/var/log/*.log&amp;#34;}&amp;#39;
                stages:
                - drop:
                    expression: &amp;#39;^[^0-9]{4}&amp;#39;
                - regex:
                    expression: &amp;#39;^(?P&amp;lt;timestamp&amp;gt;\d{4}/\d{2}/\d{2} \d{2}:\d{2}:\d{2}) \[(?P&amp;lt;level&amp;gt;[[:alpha:]]&amp;#43;)\] (?:\d&amp;#43;)\#(?:\d&amp;#43;): \*(?:\d&amp;#43;) (?P&amp;lt;message&amp;gt;.&amp;#43;)$&amp;#39;
                - pack:
                    labels:
                      - level
      clients:
        - url: https://USER_ID:API_KEY@logs-prod3.grafana.net/loki/api/v1/push&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The convert command takes the YAML file as input and outputs a 
    &lt;a href=&#34;/docs/agent/v0.43/flow/concepts/config-language/&#34;&gt;River&lt;/a&gt; file.&lt;/p&gt;



  

  


&lt;div data-element=&#34;tabs&#34;&gt;
  &lt;div data-element=&#34;tabs-bar&#34;&gt;
    
      &lt;div data-element=&#34;tab&#34; data-key=&#34;0&#34; data-label=&#34;static-binary&#34;&gt;static-binary&lt;/div&gt;
    
      &lt;div data-element=&#34;tab&#34; data-key=&#34;1&#34; data-label=&#34;flow-binary&#34;&gt;flow-binary&lt;/div&gt;
    
  &lt;/div&gt;
  &lt;div data-element=&#34;tab-content&#34;&gt;
    
&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;static-binary&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-static-binary&#34;&gt;AGENT_MODE=flow grafana-agent convert --source-format=static --output=&amp;lt;OUTPUT_CONFIG_PATH&amp;gt; &amp;lt;INPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;flow-binary&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-flow-binary&#34;&gt;grafana-agent-flow convert --source-format=static --output=&amp;lt;OUTPUT_CONFIG_PATH&amp;gt; &amp;lt;INPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Replace the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;INPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/em&gt;: The full path to the 
    &lt;a href=&#34;/docs/agent/v0.43/static/&#34;&gt;Static&lt;/a&gt; configuration.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;OUTPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/em&gt;: The full path to output the Grafana Agent Flow configuration.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The new Grafana Agent Flow configuration file looks like this:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Alloy&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-alloy&#34;&gt;prometheus.scrape &amp;#34;metrics_test_local_agent&amp;#34; {
	targets = [{
		__address__ = &amp;#34;127.0.0.1:12345&amp;#34;,
		cluster     = &amp;#34;localhost&amp;#34;,
	}]
	forward_to      = [prometheus.remote_write.metrics_test.receiver]
	job_name        = &amp;#34;local-agent&amp;#34;
	scrape_interval = &amp;#34;15s&amp;#34;
}

prometheus.remote_write &amp;#34;metrics_test&amp;#34; {
	endpoint {
		name = &amp;#34;test-3a2a1b&amp;#34;
		url  = &amp;#34;https://prometheus-us-central1.grafana.net/api/prom/push&amp;#34;

		basic_auth {
			username = &amp;#34;&amp;lt;USERNAME&amp;gt;&amp;#34;
			password = &amp;#34;&amp;lt;PASSWORD&amp;gt;&amp;#34;
		}

		queue_config { }

		metadata_config { }
	}
}

local.file_match &amp;#34;logs_varlogs_varlogs&amp;#34; {
	path_targets = [{
		__address__ = &amp;#34;localhost&amp;#34;,
		__path__    = &amp;#34;/var/log/*.log&amp;#34;,
		host        = &amp;#34;mylocalhost&amp;#34;,
		job         = &amp;#34;varlogs&amp;#34;,
	}]
}

loki.process &amp;#34;logs_varlogs_varlogs&amp;#34; {
	forward_to = [loki.write.logs_varlogs.receiver]

	stage.match {
		selector = &amp;#34;{filename=\&amp;#34;/var/log/*.log\&amp;#34;}&amp;#34;

		stage.drop {
			expression = &amp;#34;^[^0-9]{4}&amp;#34;
		}

		stage.regex {
			expression = &amp;#34;^(?P&amp;lt;timestamp&amp;gt;\\d{4}/\\d{2}/\\d{2} \\d{2}:\\d{2}:\\d{2}) \\[(?P&amp;lt;level&amp;gt;[[:alpha:]]&amp;#43;)\\] (?:\\d&amp;#43;)\\#(?:\\d&amp;#43;): \\*(?:\\d&amp;#43;) (?P&amp;lt;message&amp;gt;.&amp;#43;)$&amp;#34;
		}

		stage.pack {
			labels           = [&amp;#34;level&amp;#34;]
			ingest_timestamp = false
		}
	}
}

loki.source.file &amp;#34;logs_varlogs_varlogs&amp;#34; {
	targets    = local.file_match.logs_varlogs_varlogs.targets
	forward_to = [loki.process.logs_varlogs_varlogs.receiver]

	file_watch {
		min_poll_frequency = &amp;#34;1s&amp;#34;
		max_poll_frequency = &amp;#34;5s&amp;#34;
	}
}

loki.write &amp;#34;logs_varlogs&amp;#34; {
	endpoint {
		url = &amp;#34;https://USER_ID:API_KEY@logs-prod3.grafana.net/loki/api/v1/push&amp;#34;
	}
	external_labels = {}
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;integrations-next&#34;&gt;Integrations Next&lt;/h2&gt;
&lt;p&gt;You can convert [integrations next][] configurations by adding the &lt;code&gt;extra-args&lt;/code&gt; flag for 
    &lt;a href=&#34;/docs/agent/v0.43/flow/reference/cli/convert/&#34;&gt;convert&lt;/a&gt; or &lt;code&gt;config.extra-args&lt;/code&gt; for 
    &lt;a href=&#34;/docs/agent/v0.43/flow/reference/cli/run/&#34;&gt;run&lt;/a&gt;.&lt;/p&gt;



  

  


&lt;div data-element=&#34;tabs&#34;&gt;
  &lt;div data-element=&#34;tabs-bar&#34;&gt;
    
      &lt;div data-element=&#34;tab&#34; data-key=&#34;0&#34; data-label=&#34;static-binary&#34;&gt;static-binary&lt;/div&gt;
    
      &lt;div data-element=&#34;tab&#34; data-key=&#34;1&#34; data-label=&#34;flow-binary&#34;&gt;flow-binary&lt;/div&gt;
    
  &lt;/div&gt;
  &lt;div data-element=&#34;tab-content&#34;&gt;
    
&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;static-binary&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-static-binary&#34;&gt;AGENT_MODE=flow grafana-agent convert --source-format=static --extra-args=&amp;#34;-enable-features=integrations-next&amp;#34; --output=&amp;lt;OUTPUT_CONFIG_PATH&amp;gt; &amp;lt;INPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;flow-binary&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-flow-binary&#34;&gt;grafana-agent-flow convert --source-format=static --extra-args=&amp;#34;-enable-features=integrations-next&amp;#34; --output=&amp;lt;OUTPUT_CONFIG_PATH&amp;gt; &amp;lt;INPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Replace the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;INPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/em&gt;: The full path to the 
    &lt;a href=&#34;/docs/agent/v0.43/static/&#34;&gt;Static&lt;/a&gt; configuration.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;OUTPUT_CONFIG_PATH&amp;gt;&lt;/code&gt;&lt;/em&gt;: The full path to output the Grafana Agent Flow configuration.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;environment-vars&#34;&gt;Environment Vars&lt;/h2&gt;
&lt;p&gt;You can use the &lt;code&gt;-config.expand-env&lt;/code&gt; command line flag to interpret environment variables in your Grafana Agent Static configuration.
You can pass these flags to 
    &lt;a href=&#34;/docs/agent/v0.43/flow/reference/cli/convert/&#34;&gt;convert&lt;/a&gt; with &lt;code&gt;--extra-args=&amp;quot;-config.expand-env&amp;quot;&lt;/code&gt; or to 
    &lt;a href=&#34;/docs/agent/v0.43/flow/reference/cli/run/&#34;&gt;run&lt;/a&gt; with &lt;code&gt;--config.extra-args=&amp;quot;-config.expand-env&amp;quot;&lt;/code&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;It&amp;rsquo;s possible to combine &lt;code&gt;integrations-next&lt;/code&gt; with &lt;code&gt;expand-env&lt;/code&gt;.
For 
    &lt;a href=&#34;/docs/agent/v0.43/flow/reference/cli/convert/&#34;&gt;convert&lt;/a&gt;, you can use &lt;code&gt;--extra-args=&amp;quot;-enable-features=integrations-next -config.expand-env&amp;quot;&lt;/code&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;h2 id=&#34;limitations&#34;&gt;Limitations&lt;/h2&gt;
&lt;p&gt;Configuration conversion is done on a best-effort basis. Grafana Agent will issue warnings or errors where the conversion can&amp;rsquo;t be performed.&lt;/p&gt;
&lt;p&gt;After the configuration is converted, review the Grafana Agent Flow configuration file and verify that it&amp;rsquo;s correct before starting to use it in a production environment.&lt;/p&gt;
&lt;p&gt;The following list is specific to the convert command and not Grafana Agent Flow:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The  
    &lt;a href=&#34;/docs/agent/v0.43/static/configuration/agent-management/&#34;&gt;Agent Management&lt;/a&gt; configuration options can&amp;rsquo;t be automatically converted to Grafana Agent Flow.
Any additional unsupported features are returned as errors during conversion.&lt;/li&gt;
&lt;li&gt;There is no gRPC server to configure for Grafana Agent Flow, as any non-default configuration will show as unsupported during the conversion.&lt;/li&gt;
&lt;li&gt;Check if you are using any extra command line arguments with Static that aren&amp;rsquo;t present in your configuration file. For example, &lt;code&gt;-server.http.address&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Check if you are using any environment variables in your 
    &lt;a href=&#34;/docs/agent/v0.43/static/&#34;&gt;Static&lt;/a&gt; configuration.
These will be evaluated during conversion and you may want to replace them with the Grafana Agent Flow Standard library 
    &lt;a href=&#34;/docs/agent/v0.43/flow/reference/stdlib/env/&#34;&gt;env&lt;/a&gt; function after conversion.&lt;/li&gt;
&lt;li&gt;Review additional 
    &lt;a href=&#34;/docs/agent/v0.43/flow/tasks/migrate/from-prometheus/#limitations&#34;&gt;Prometheus Limitations&lt;/a&gt; for limitations specific to your 
    &lt;a href=&#34;/docs/agent/v0.43/static/configuration/metrics-config/&#34;&gt;Metrics&lt;/a&gt; configuration.&lt;/li&gt;
&lt;li&gt;Review additional 
    &lt;a href=&#34;/docs/agent/v0.43/flow/tasks/migrate/from-promtail/#limitations&#34;&gt;Promtail Limitations&lt;/a&gt; for limitations specific to your 
    &lt;a href=&#34;/docs/agent/v0.43/static/configuration/logs-config/&#34;&gt;Logs&lt;/a&gt; configuration.&lt;/li&gt;
&lt;li&gt;The logs produced by Grafana Agent Flow mode will differ from those produced by Static.&lt;/li&gt;
&lt;li&gt;Grafana Agent exposes the Grafana Agent Flow 
    &lt;a href=&#34;/docs/agent/v0.43/flow/tasks/debug/#grafana-agent-flow-ui&#34;&gt;UI&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="migrate-from-grafana-agent-static-to-grafana-agent-flow">Migrate from Grafana Agent Static to Grafana Agent Flow&lt;/h1>
&lt;p>The built-in Grafana Agent convert command can migrate your
&lt;a href="/docs/agent/v0.43/static/">Static&lt;/a> configuration to a Grafana Agent Flow configuration.&lt;/p></description></item></channel></rss>