<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Set up Beyla on Grafana Labs</title><link>https://grafana.com/docs/beyla/v3.7.x/setup/</link><description>Recent content in Set up Beyla on Grafana Labs</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/beyla/v3.7.x/setup/index.xml" rel="self" type="application/rss+xml"/><item><title>Deploy Beyla in Kubernetes with Helm for Grafana Cloud</title><link>https://grafana.com/docs/beyla/v3.7.x/setup/kubernetes-helm-appolly/</link><pubDate>Fri, 03 Apr 2026 19:43:06 +0000</pubDate><guid>https://grafana.com/docs/beyla/v3.7.x/setup/kubernetes-helm-appolly/</guid><content><![CDATA[&lt;h1 id=&#34;deploy-beyla-in-kubernetes-with-helm-for-grafana-cloud-knowledge-graph-and-application-observability&#34;&gt;Deploy Beyla in Kubernetes with Helm for Grafana Cloud Knowledge Graph and Application Observability&lt;/h1&gt;
&lt;p&gt;This documentation section explains the best practices for deploying Beyla using the Helm chart, but specifically for
&lt;a href=&#34;/docs/grafana-cloud/knowledge-graph/&#34;&gt;Grafana Cloud Knowledge Graph&lt;/a&gt; and &lt;a href=&#34;/docs/grafana-cloud/monitor-applications/application-observability/&#34;&gt;Application Observability&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Knowledge Graph and Application Observability in Grafana Cloud rely on OpenTelemetry span and service graph metrics,
which are typically produced from traces. Beyla can directly generate span and service graph metrics, without having to generate traces,
which means that we can configure head sampling for OpenTelemetry traces, or disable trace
generation completely, and still generate correct Request-Error-Duration(RED) metrics.&lt;/p&gt;
&lt;p&gt;If you are familiar with the Grafana Cloud Application Observability configuration for the Tempo span metric generator, this component
is not needed, nor needs to be configured/enabled for Beyla span and service graph metrics generation.&lt;/p&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;For more details about the diverse Helm configuration options, check out the
&lt;a href=&#34;https://github.com/grafana/beyla/blob/main/charts/beyla/README.md&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Beyla Helm chart options&lt;/a&gt;
document.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;Contents:&lt;/p&gt;
&lt;!-- TOC --&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;#deploy-beyla-from-helm&#34;&gt;Deploy Beyla with Helm for Grafana Cloud&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#configure-beyla&#34;&gt;Configure Beyla&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#configure-beyla-metadata&#34;&gt;Configure Beyla metadata&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#provide-secrets-to-the-helm-configuration&#34;&gt;Provide secrets to the Helm configuration&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;!-- TOC --&gt;
&lt;h2 id=&#34;deploy-beyla-with-helm-for-grafana-cloud&#34;&gt;Deploy Beyla with Helm for Grafana Cloud&lt;/h2&gt;
&lt;p&gt;First, you need to add the Grafana helm repository to Helm:&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;sh&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-sh&#34;&gt;helm repo add grafana https://grafana.github.io/helm-charts&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;If you have previously added the Grafana Helm repository, run the update command to refresh the helm repository 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;sh&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-sh&#34;&gt;helm repo update&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The following command deploys a Beyla DaemonSet with a default configuration for Grafana Cloud in the &lt;code&gt;beyla&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;sh&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-sh&#34;&gt;helm upgrade --install --atomic --timeout 300s beyla grafana/beyla --namespace &amp;#34;beyla&amp;#34; --create-namespace --values - &amp;lt;&amp;lt;EOF
config:
  data:
    discovery:
      instrument:
        - k8s_namespace: &amp;#34;*&amp;#34;
    otel_metrics_export:
      endpoint: &amp;lt;Your Grafana Cloud tenant Mimir endpoint&amp;gt; e.g. &amp;#34;https://otlp-gateway-ops-eu-south-0.grafana-ops.net/otlp/v1/metrics&amp;#34;
      features:
        - application_span
        - application_service_graph
        - application_host
    otel_traces_export:
      endpoint: &amp;lt;Your Grafana Cloud tenant Tempo endpoint&amp;gt; e.g. &amp;#34;https://otlp-gateway-ops-eu-south-0.grafana-ops.net/otlp/v1/traces&amp;#34;
env:
  OTEL_EXPORTER_OTLP_METRICS_HEADERS: &amp;#34;Authorization=Basic &amp;lt;Your Grafana Cloud Mimir auth token&amp;gt;&amp;#34;
  OTEL_EXPORTER_OTLP_TRACES_HEADERS: &amp;#34;Authorization=Basic &amp;lt;Your Grafana Cloud Tempo auth token&amp;gt;&amp;#34;
EOF&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The Beyla configuration above:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;exports metrics and traces in a format that can be consumed by Grafana Cloud Knowledge Graph and Application Observability.&lt;/li&gt;
&lt;li&gt;exports host information metrics &lt;code&gt;application_host&lt;/code&gt; which are needed for the host based pricing model of the Grafana Cloud products.&lt;/li&gt;
&lt;li&gt;tries to instrument all the applications in your cluster.&lt;/li&gt;
&lt;li&gt;only provides application-level metrics (span and service graph) and excludes &lt;a href=&#34;../../network/&#34;&gt;network-level metrics&lt;/a&gt; by default&lt;/li&gt;
&lt;li&gt;configures Beyla to decorate the metrics with Kubernetes metadata labels, for example &lt;code&gt;k8s.namespace.name&lt;/code&gt; or &lt;code&gt;k8s.pod.name&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;configure-beyla&#34;&gt;Configure Beyla&lt;/h2&gt;
&lt;p&gt;You might want to override the default configuration of Beyla. For example, to export the metrics using the OpenTelemetry
semantic conventions instead of span metrics, or to restrict the number of services to instrument.&lt;/p&gt;
&lt;p&gt;You can override the default &lt;a href=&#34;../../configure/&#34;&gt;Beyla configuration options&lt;/a&gt; with your own values.&lt;/p&gt;
&lt;p&gt;For example, create a &lt;code&gt;helm-beyla.yml&lt;/code&gt; file with a custom configuration:&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;config:
  data:
    # Contents of the actual Beyla configuration file,
    # specifying only two Kubernetes namespaces to be instrumented.
    discovery:
      instrument:
        - k8s_namespace: demo
        - k8s_namespace: blog
    metrics:
      features:
        - application_span
        - application_service_graph
        - application_host
    otel_metrics_export:
      endpoint: &amp;lt;Your Grafana Cloud tenant Mimir endpoint&amp;gt; e.g. &amp;#34;https://otlp-gateway-ops-eu-south-0.grafana-ops.net/otlp/v1/metrics&amp;#34;
    otel_traces_export:
      endpoint: &amp;lt;Your Grafana Cloud tenant Tempo endpoint&amp;gt; e.g. &amp;#34;https://otlp-gateway-ops-eu-south-0.grafana-ops.net/otlp/v1/traces&amp;#34;
    routes:
      unmatched: heuristic
env:
  OTEL_EXPORTER_OTLP_METRICS_HEADERS: &amp;#34;Authorization=Basic &amp;lt;Your Grafana Cloud Mimir auth token&amp;gt;&amp;#34;
  OTEL_EXPORTER_OTLP_TRACES_HEADERS: &amp;#34;Authorization=Basic &amp;lt;Your Grafana Cloud Tempo auth token&amp;gt;&amp;#34;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The &lt;code&gt;config.data&lt;/code&gt; section contains a Beyla configuration file, documented in the
&lt;a href=&#34;../../configure/options/&#34;&gt;Beyla configuration options documentation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Then pass the overridden configuration to the &lt;code&gt;helm&lt;/code&gt; command with the &lt;code&gt;-f&lt;/code&gt; flag. For example:&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;sh&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-sh&#34;&gt;helm install beyla grafana/beyla -f helm-beyla.yml&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;or, if the Beyla chart was previously deployed:&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;sh&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-sh&#34;&gt;helm upgrade beyla grafana/beyla -f helm-beyla.yml&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;configure-beyla-metadata&#34;&gt;Configure Beyla metadata&lt;/h2&gt;
&lt;p&gt;If Beyla exports the data using the Prometheus exporter, you can expose its metrics
by creating a Kubernetes Service and configuring a ServiceMonitor, allowing your Prometheus scraper to discover it.
To enable this feature, edit your &lt;code&gt;helm-beyla.yml&lt;/code&gt; file to include the following configuration:&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;service:
  enabled: true

serviceMonitor:
  enabled: true&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;Configure your Prometheus scraper with &lt;a href=&#34;../../configure/export-data/#prometheus-exporter-component&#34;&gt;&lt;code&gt;honor_labels: true&lt;/code&gt;&lt;/a&gt; to preserve the per-process instance identifiers set by Beyla.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;Analogously, the Helm chart allows overriding names, labels, and annotations for
multiple resources involved in the deployment of Beyla, such as service
accounts, cluster roles, security contexts, etc. The
&lt;a href=&#34;https://github.com/grafana/beyla/blob/main/charts/beyla/README.md&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Beyla Helm chart documentation&lt;/a&gt;
describes the diverse configuration options.&lt;/p&gt;
&lt;h2 id=&#34;provide-secrets-to-the-helm-configuration&#34;&gt;Provide secrets to the Helm configuration&lt;/h2&gt;
&lt;p&gt;If you are submitting directly the metrics and traces to Grafana Cloud via the
OpenTelemetry Endpoint, you need to provide the credentials via the
&lt;code&gt;OTEL_EXPORTER_OTLP_HEADERS&lt;/code&gt; environment variable.&lt;/p&gt;
&lt;p&gt;The recommended way is to store such value in a Kubernetes Secret and then
specify the environment variable referring to it from the Helm configuration.&lt;/p&gt;
&lt;p&gt;For example, deploy the following secret:&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;apiVersion: v1
kind: Secret
metadata:
  name: grafana-secret
type: Opaque
stringData:
  otlp-headers: &amp;#34;Authorization=Basic ....&amp;#34;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Then refer to it from the &lt;code&gt;helm-config.yml&lt;/code&gt; file via the &lt;code&gt;envValueFrom&lt;/code&gt; section:&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;env:
  OTEL_EXPORTER_OTLP_ENDPOINT: &amp;#34;&amp;lt;...your Grafana Cloud OTLP endpoint URL...&amp;gt;&amp;#34;
envValueFrom:
  OTEL_EXPORTER_OTLP_HEADERS:
    secretKeyRef:
      key: otlp-headers
      name: grafana-secret&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="deploy-beyla-in-kubernetes-with-helm-for-grafana-cloud-knowledge-graph-and-application-observability">Deploy Beyla in Kubernetes with Helm for Grafana Cloud Knowledge Graph and Application Observability&lt;/h1>
&lt;p>This documentation section explains the best practices for deploying Beyla using the Helm chart, but specifically for
&lt;a href="/docs/grafana-cloud/knowledge-graph/">Grafana Cloud Knowledge Graph&lt;/a> and &lt;a href="/docs/grafana-cloud/monitor-applications/application-observability/">Application Observability&lt;/a>.&lt;/p></description></item><item><title>Deploy Beyla with the Kubernetes Monitoring Helm Chart</title><link>https://grafana.com/docs/beyla/v3.7.x/setup/kubernetes-helm-k8s-monitoring/</link><pubDate>Fri, 03 Apr 2026 19:43:06 +0000</pubDate><guid>https://grafana.com/docs/beyla/v3.7.x/setup/kubernetes-helm-k8s-monitoring/</guid><content><![CDATA[&lt;h1 id=&#34;deploy-beyla-with-the-kubernetes-monitoring-helm-chart&#34;&gt;Deploy Beyla with the Kubernetes Monitoring Helm Chart&lt;/h1&gt;
&lt;p&gt;This documentation section explains the best practices for deploying Beyla using the &lt;a href=&#34;https://github.com/grafana/k8s-monitoring-helm/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Kubernetes Monitoring Helm chart&lt;/a&gt;, but specifically for
&lt;a href=&#34;/docs/grafana-cloud/knowledge-graph/&#34;&gt;Grafana Cloud Knowledge Graph&lt;/a&gt; and &lt;a href=&#34;/docs/grafana-cloud/monitor-applications/application-observability/&#34;&gt;Application Observability&lt;/a&gt;. For documentation on how to deploy Beyla using the Beyla standalone
Helm chart, refer to the &lt;a href=&#34;./kubernetes-helm-appolly.md&#34;&gt;Deploy Beyla in Kubernetes with Helm for Grafana Cloud Application Observability&lt;/a&gt;
documentation section.&lt;/p&gt;
&lt;p&gt;Contents:&lt;/p&gt;
&lt;!-- TOC --&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;#deploy-beyla&#34;&gt;Deploy Beyla&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#configure-beyla&#34;&gt;Configure Beyla&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;!-- TOC --&gt;
&lt;h2 id=&#34;deploy-beyla&#34;&gt;Deploy Beyla&lt;/h2&gt;
&lt;p&gt;The easiest way to get started with deploying Beyla with the Kubernetes Monitoring Helm chart is to visit your
cloud Kubernetes Monitoring configuration page. For example:&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;https://&amp;lt;my grafana slug&amp;gt;.grafana.net/a/grafana-k8s-app/configuration?from=now-1h&amp;amp;to=now&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;In the &lt;code&gt;Containerized application monitoring&lt;/code&gt; section, enable &lt;code&gt;Auto Instrumentation -&amp;gt; Metrics of inbound and outbound calls&lt;/code&gt;.
If you also want to generate OpenTelemetry traces from Beyla directly, you can choose to also enable &lt;code&gt;Forward traces to application receivers&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;After choosing your other desired options, the Grafana Cloud Kubernetes Monitoring UI generates a Helm deployment script for you, which
contains all the necessary settings for you to get started. The Beyla instrumentation section can be found under the section &lt;code&gt;autoInstrumentation:&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;For example:&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;sh&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-sh&#34;&gt;helm repo add grafana https://grafana.github.io/helm-charts &amp;amp;&amp;amp;
  helm repo update &amp;amp;&amp;amp;
  helm upgrade --install --atomic --timeout 300s grafana-k8s-monitoring grafana/k8s-monitoring \
    --namespace &amp;#34;default&amp;#34; --create-namespace --values - &amp;lt;&amp;lt;&amp;#39;EOF&amp;#39;
cluster:
  name: my-cluster
destinations:
...
autoInstrumentation:
  enabled: true
  beyla:
    deliverTracesToApplicationObservability: false
...
EOF&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The Beyla configuration above:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;exports metrics in a format that can be consumed by Grafana Cloud Knowledge Graph and Application Observability.&lt;/li&gt;
&lt;li&gt;does not export Beyla traces.&lt;/li&gt;
&lt;li&gt;tries to instrument all the applications in your cluster.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;configure-beyla&#34;&gt;Configure Beyla&lt;/h2&gt;
&lt;p&gt;You might want to override the default configuration of Beyla. For example, to choose a subset of your cluster
namespaces to instrument or to override the Beyla image used to a newer version.&lt;/p&gt;
&lt;p&gt;You can override the default &lt;a href=&#34;../../configure/&#34;&gt;Beyla configuration options&lt;/a&gt; with your own values.&lt;/p&gt;
&lt;p&gt;For example, we can modify the &lt;code&gt;autoinstrumentation:&lt;/code&gt; configuration section generated by the Kubernetes Monitoring Helm chart
to pick and choose what to instrument:&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;sh&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-sh&#34;&gt;helm repo add grafana https://grafana.github.io/helm-charts &amp;amp;&amp;amp;
  helm repo update &amp;amp;&amp;amp;
  helm upgrade --install --atomic --timeout 300s grafana-k8s-monitoring grafana/k8s-monitoring \
    --namespace &amp;#34;default&amp;#34; --create-namespace --values - &amp;lt;&amp;lt;&amp;#39;EOF&amp;#39;
cluster:
  name: my-cluster
destinations:
...
autoInstrumentation:
  enabled: true
  beyla:
    deliverTracesToApplicationObservability: true
    image: 
      tag: main
    pullPolicy: always
    config:
      data:
        discovery:
          services:
            - k8s_namespace: alpha
            - k8s_namespace: bravo
            - k8s_namespace: delta    
...
EOF&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The &lt;code&gt;autoInstrumentation.beyla.config.data&lt;/code&gt; section contains a Beyla configuration file, documented in the
&lt;a href=&#34;../../configure/options/&#34;&gt;Beyla configuration options documentation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In the example above the configuration is modified to:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Enable Beyla traces generation.&lt;/li&gt;
&lt;li&gt;We only instrument three namespaces in the cluster: &lt;code&gt;alpha&lt;/code&gt;, &lt;code&gt;bravo&lt;/code&gt; and &lt;code&gt;delta&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;We have chosen to pull the latest &lt;code&gt;main&lt;/code&gt; Beyla image.&lt;/li&gt;
&lt;/ol&gt;
]]></content><description>&lt;h1 id="deploy-beyla-with-the-kubernetes-monitoring-helm-chart">Deploy Beyla with the Kubernetes Monitoring Helm Chart&lt;/h1>
&lt;p>This documentation section explains the best practices for deploying Beyla using the &lt;a href="https://github.com/grafana/k8s-monitoring-helm/" target="_blank" rel="noopener noreferrer">Kubernetes Monitoring Helm chart&lt;/a>, but specifically for
&lt;a href="/docs/grafana-cloud/knowledge-graph/">Grafana Cloud Knowledge Graph&lt;/a> and &lt;a href="/docs/grafana-cloud/monitor-applications/application-observability/">Application Observability&lt;/a>. For documentation on how to deploy Beyla using the Beyla standalone
Helm chart, refer to the &lt;a href="./kubernetes-helm-appolly.md">Deploy Beyla in Kubernetes with Helm for Grafana Cloud Application Observability&lt;/a>
documentation section.&lt;/p></description></item><item><title>Run Beyla as a Docker container</title><link>https://grafana.com/docs/beyla/v3.7.x/setup/docker/</link><pubDate>Fri, 03 Apr 2026 19:43:06 +0000</pubDate><guid>https://grafana.com/docs/beyla/v3.7.x/setup/docker/</guid><content><![CDATA[&lt;h1 id=&#34;run-beyla-as-a-docker-container&#34;&gt;Run Beyla as a Docker container&lt;/h1&gt;
&lt;p&gt;Beyla can run a standalone Docker container that can instrument a process running in another container.&lt;/p&gt;
&lt;p&gt;Find the latest image of Beyla on &lt;a href=&#34;https://hub.docker.com/r/grafana/beyla&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Docker Hub&lt;/a&gt; with the following name:&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;grafana/beyla:latest&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The Beyla container must be configured in following way:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;run as a &lt;strong&gt;privileged&lt;/strong&gt; container, or with the required Linux capabilities. Refer to &lt;a href=&#34;../../security/&#34;&gt;Security, permissions and capabilities&lt;/a&gt; for the list of capabilities required for your use case&lt;/li&gt;
&lt;li&gt;share the PID space with the container that is being instrumented&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;docker-cli-example&#34;&gt;Docker CLI example&lt;/h2&gt;
&lt;p&gt;For this example you need a container running an HTTP/S or GRPC service. If you don&amp;rsquo;t have one, you can use this &lt;a href=&#34;http://macias.info&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;simple blog engine service written in Go&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;sh&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-sh&#34;&gt;docker run -p 18443:8443 --name goblog mariomac/goblog:dev&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The above command runs a simple HTTPS application. The process opens the container&amp;rsquo;s internal port &lt;code&gt;8443&lt;/code&gt;, which is then exposed at the host level as the port &lt;code&gt;18443&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Set environment variables to configure Beyla to print to stdout and listen to a port (container) to inspect the executable:&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;sh&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-sh&#34;&gt;export BEYLA_TRACE_PRINTER=text
export BEYLA_OPEN_PORT=8443&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Beyla needs to be run with the following settings:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;in &lt;code&gt;--privileged&lt;/code&gt; mode, or with the required Linux capabilities. Refer to &lt;a href=&#34;../../security/&#34;&gt;Security, permissions and capabilities&lt;/a&gt; for the list of capabilities required for your use case&lt;/li&gt;
&lt;li&gt;a container PID namespace, with the option &lt;code&gt;--pid=&amp;quot;container:goblog&amp;quot;&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&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;sh&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-sh&#34;&gt;docker run --rm \
  -e BEYLA_OPEN_PORT=8443 \
  -e BEYLA_TRACE_PRINTER=text \
  --pid=&amp;#34;container:goblog&amp;#34; \
  --privileged \
  grafana/beyla:latest&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;After Beyla is running, open &lt;code&gt;https://localhost:18443&lt;/code&gt; in your browser, use the app to generate test data, and verify that Beyla prints trace requests to stdout similar to:&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;sh&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-sh&#34;&gt;time=2023-05-22T14:03:42.402Z level=INFO msg=&amp;#34;creating instrumentation pipeline&amp;#34;
time=2023-05-22T14:03:42.526Z level=INFO msg=&amp;#34;Starting main node&amp;#34;
2023-05-22 14:03:53.5222353 (19.066625ms[942.583µs]) 200 GET / [172.17.0.1]-&amp;gt;[localhost:18443] size:0B
2023-05-22 14:03:53.5222353 (355.792µs[321.75µs]) 200 GET /static/style.css [172.17.0.1]-&amp;gt;[localhost:18443] size:0B
2023-05-22 14:03:53.5222353 (170.958µs[142.916µs]) 200 GET /static/img.png [172.17.0.1]-&amp;gt;[localhost:18443] size:0B
2023-05-22 14:13:47.52221347 (7.243667ms[295.292µs]) 200 GET /entry/201710281345_instructions.md [172.17.0.1]-&amp;gt;[localhost:18443] size:0B
2023-05-22 14:13:47.52221347 (115µs[75.625µs]) 200 GET /static/style.css [172.17.0.1]-&amp;gt;[localhost:18443] size:0B&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Now that Beyla is tracing the target HTTP service, configure it to send metrics and traces to an OpenTelemetry endpoint, or have metrics scraped by Prometheus.&lt;/p&gt;
&lt;p&gt;For information on how to export traces and metrics, refer to the &lt;a href=&#34;../../configure/options/&#34;&gt;configuration options&lt;/a&gt; documentation.&lt;/p&gt;
&lt;h2 id=&#34;docker-compose-example&#34;&gt;Docker Compose example&lt;/h2&gt;
&lt;p&gt;The following Docker compose file replicates the same functionality of the Docker CLI example:&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;version: &amp;#34;3.8&amp;#34;

services:
  # Service to instrument. Change it to any
  # other container that you want to instrument.
  goblog:
    image: mariomac/goblog:dev
    ports:
      # Exposes port 18843, forwarding it to container port 8443
      - &amp;#34;18443:8443&amp;#34;

  autoinstrumenter:
    image: grafana/beyla:latest
    pid: &amp;#34;service:goblog&amp;#34;
    privileged: true
    environment:
      BEYLA_TRACE_PRINTER: text
      BEYLA_OPEN_PORT: 8443&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Run the Docker compose file with the following command and use the app to generate traces:&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;sh&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-sh&#34;&gt;docker compose -f compose-example.yml up&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="run-beyla-as-a-docker-container">Run Beyla as a Docker container&lt;/h1>
&lt;p>Beyla can run a standalone Docker container that can instrument a process running in another container.&lt;/p>
&lt;p>Find the latest image of Beyla on &lt;a href="https://hub.docker.com/r/grafana/beyla" target="_blank" rel="noopener noreferrer">Docker Hub&lt;/a> with the following name:&lt;/p></description></item><item><title>Deploy Beyla in Kubernetes</title><link>https://grafana.com/docs/beyla/v3.7.x/setup/kubernetes/</link><pubDate>Fri, 03 Apr 2026 19:43:06 +0000</pubDate><guid>https://grafana.com/docs/beyla/v3.7.x/setup/kubernetes/</guid><content><![CDATA[&lt;h1 id=&#34;deploy-beyla-in-kubernetes&#34;&gt;Deploy Beyla in Kubernetes&lt;/h1&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;This document explains how to manually deploy Beyla in Kubernetes, setting up all the required entities by yourself.&lt;/p&gt;
&lt;p&gt;You might prefer to follow the &lt;a href=&#34;../kubernetes-helm/&#34;&gt;Deploy Beyla in Kubernetes with Helm&lt;/a&gt; documentation instead.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;Contents:&lt;/p&gt;
&lt;!-- TOC --&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;#deploy-beyla-in-kubernetes&#34;&gt;Deploy Beyla in Kubernetes&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;#configuring-kubernetes-metadata-decoration&#34;&gt;Configuring Kubernetes metadata decoration&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#deploying-beyla&#34;&gt;Deploying Beyla&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;#deploy-beyla-as-a-sidecar-container&#34;&gt;Deploy Beyla as a sidecar container&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#deploy-beyla-as-a-daemonset&#34;&gt;Deploy Beyla as a Daemonset&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#deploy-beyla-unprivileged&#34;&gt;Deploy Beyla unprivileged&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#providing-an-external-configuration-file&#34;&gt;Providing an external configuration file&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#providing-secret-configuration&#34;&gt;Providing secret configuration&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;!-- TOC --&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;configuring-kubernetes-metadata-decoration&#34;&gt;Configuring Kubernetes metadata decoration&lt;/h2&gt;
&lt;p&gt;Beyla can decorate your traces with the following Kubernetes labels:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;k8s.namespace.name&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;k8s.deployment.name&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;k8s.statefulset.name&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;k8s.replicaset.name&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;k8s.daemonset.name&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;k8s.node.name&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;k8s.pod.name&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;k8s.container.name&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;k8s.pod.uid&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;k8s.pod.start_time&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;k8s.cluster.name&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To enable metadata decoration, you need to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Create a ServiceAccount and bind a ClusterRole granting list and watch permissions
for both Pods and ReplicaSets. You can do it by deploying this example file:&lt;/li&gt;
&lt;/ul&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;apiVersion: v1
kind: ServiceAccount
metadata:
  name: beyla
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: beyla
rules:
  - apiGroups: [ &amp;#34;apps&amp;#34; ]
    resources: [ &amp;#34;replicasets&amp;#34; ]
    verbs: [ &amp;#34;list&amp;#34;, &amp;#34;watch&amp;#34; ]
  - apiGroups: [ &amp;#34;&amp;#34; ]
    resources: [ &amp;#34;pods&amp;#34;, &amp;#34;services&amp;#34;, &amp;#34;nodes&amp;#34; ]
    verbs: [ &amp;#34;list&amp;#34;, &amp;#34;watch&amp;#34; ]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: beyla
subjects:
  - kind: ServiceAccount
    name: beyla
    namespace: default
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: beyla&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;(You need to change the &lt;code&gt;namespace: default&lt;/code&gt; value if you are deploying Beyla
in another namespace).&lt;/p&gt;
&lt;ol start=&#34;2&#34;&gt;
&lt;li&gt;
&lt;p&gt;Configure Beyla with the &lt;code&gt;BEYLA_KUBE_METADATA_ENABLE=true&lt;/code&gt; environment variable,
or the &lt;code&gt;attributes.kubernetes.enable: true&lt;/code&gt; YAML configuration.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Don&amp;rsquo;t forget to specify the &lt;code&gt;serviceAccountName: beyla&lt;/code&gt; property in your Beyla
Pod (as shown in the later deployment examples).&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Optionally, select which Kubernetes services to instrument in the &lt;code&gt;discovery -&amp;gt; instrument&lt;/code&gt;
section of the YAML configuration file. For more information, refer to the
&lt;em&gt;Service discovery&lt;/em&gt; section in the &lt;a href=&#34;../../configure/options/&#34;&gt;Configuration document&lt;/a&gt;,
as well as the &lt;a href=&#34;#providing-an-external-configuration-file&#34;&gt;Providing an external configuration file&lt;/a&gt;
section of this page.&lt;/p&gt;
&lt;h2 id=&#34;deploying-beyla&#34;&gt;Deploying Beyla&lt;/h2&gt;
&lt;p&gt;You can deploy Beyla in Kubernetes in two different ways:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;As a sidecar container&lt;/li&gt;
&lt;li&gt;As a DaemonSet&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;deploy-beyla-as-a-sidecar-container&#34;&gt;Deploy Beyla as a sidecar container&lt;/h3&gt;
&lt;p&gt;This is the way you can deploy Beyla if you want to monitor a given service that
might not be deployed in all the hosts, so you only have to deploy one Beyla instance
per each service instance.&lt;/p&gt;
&lt;iframe width=&#34;560&#34; height=&#34;315&#34; src=&#39;https://www.youtube.com/embed/d7clTdz0bA4&#39; title=&#34;YouTube video player&#34; frameborder=&#34;0&#34; allow=&#34;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share&#34; referrerpolicy=&#34;strict-origin-when-cross-origin&#34; allowfullscreen&gt;&lt;/iframe&gt;
&lt;p&gt;Deploying Beyla as a sidecar container has the following configuration
requirements:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The process namespace must be shared between all containers in the Pod (&lt;code&gt;shareProcessNamespace: true&lt;/code&gt;
pod variable)&lt;/li&gt;
&lt;li&gt;The auto-instrument container must run in privileged mode (&lt;code&gt;securityContext.privileged: true&lt;/code&gt; property of the
container configuration), or with the required Linux capabilities. Refer to &lt;a href=&#34;../../security/&#34;&gt;Security, permissions and capabilities&lt;/a&gt; for the list of capabilities required for your use case, or check the &lt;a href=&#34;#deploy-beyla-unprivileged&#34;&gt;Deploy Beyla unprivileged&lt;/a&gt; section below.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The following example instruments the &lt;code&gt;goblog&lt;/code&gt; pod by attaching Beyla
as a container (image available at &lt;code&gt;grafana/beyla:latest&lt;/code&gt;). The
auto-instrumentation tool is configured to forward metrics and traces to Grafana Alloy,
which is accessible behind the &lt;code&gt;grafana-alloy&lt;/code&gt; service in the same 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;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;apiVersion: apps/v1
kind: Deployment
metadata:
  name: goblog
  labels:
    app: goblog
spec:
  replicas: 2
  selector:
    matchLabels:
      app: goblog
  template:
    metadata:
      labels:
        app: goblog
    spec:
      # Required so the sidecar instrument tool can access the service process
      shareProcessNamespace: true
      serviceAccountName: beyla # required if you want kubernetes metadata decoration
      containers:
        # Container for the instrumented service
        - name: goblog
          image: mariomac/goblog:dev
          imagePullPolicy: IfNotPresent
          command: [&amp;#34;/goblog&amp;#34;]
          ports:
            - containerPort: 8443
              name: https
        # Sidecar container with Beyla - the eBPF auto-instrumentation tool
        - name: beyla
          image: grafana/beyla:latest
          securityContext: # Privileges are required to install the eBPF probes
            privileged: true
          env:
            # The internal port of the goblog application container
            - name: BEYLA_OPEN_PORT
              value: &amp;#34;8443&amp;#34;
            - name: OTEL_EXPORTER_OTLP_ENDPOINT
              value: &amp;#34;http://grafana-alloy:4318&amp;#34;
              # required if you want kubernetes metadata decoration
            - name: BEYLA_KUBE_METADATA_ENABLE
              value: &amp;#34;true&amp;#34;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;For more information about the different configuration options, check the
&lt;a href=&#34;../../configure/options/&#34;&gt;Configuration&lt;/a&gt; section of this documentation site.&lt;/p&gt;
&lt;h3 id=&#34;deploy-beyla-as-a-daemonset&#34;&gt;Deploy Beyla as a Daemonset&lt;/h3&gt;
&lt;p&gt;You can also deploy Beyla as a Daemonset. This is the preferred way if:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You want to instrument a Daemonset&lt;/li&gt;
&lt;li&gt;You want to instrument multiple processes from a single Beyla instance, or even
all of the processes in your cluster.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Using the previous example (the &lt;code&gt;goblog&lt;/code&gt; pod), we cannot select the process
to instrument by using its open port, because the port is internal to the Pod.
At the same time multiple instances of the
service would have different open ports. In this case, we will need to instrument by
using the application service executable name (see later example).&lt;/p&gt;
&lt;p&gt;In addition to the privilege requirements of the sidecar scenario,
you will need to configure the auto-instrument pod template with the &lt;code&gt;hostPID: true&lt;/code&gt;
option enabled, so that it can access all the processes running on the same host.&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;---
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: beyla
  labels:
    app: beyla
spec:
  selector:
    matchLabels:
      app: beyla
  template:
    metadata:
      labels:
        app: beyla
    spec:
      hostPID: true # Required to access the processes on the host
      serviceAccountName: beyla # required if you want kubernetes metadata decoration
      containers:
        - name: autoinstrument
          image: grafana/beyla:latest
          securityContext:
            privileged: true
          env:
            # Select the executable by its name instead of BEYLA_OPEN_PORT
            - name: BEYLA_AUTO_TARGET_EXE
              value: &amp;#34;*/goblog&amp;#34;
            - name: OTEL_EXPORTER_OTLP_ENDPOINT
              value: &amp;#34;http://grafana-alloy:4318&amp;#34;
              # required if you want kubernetes metadata decoration
            - name: BEYLA_KUBE_METADATA_ENABLE
              value: &amp;#34;true&amp;#34;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;deploy-beyla-unprivileged&#34;&gt;Deploy Beyla unprivileged&lt;/h3&gt;
&lt;p&gt;In all of the examples so far, &lt;code&gt;privileged:true&lt;/code&gt; or the &lt;code&gt;SYS_ADMIN&lt;/code&gt; Linux capability was used in the Beyla deployment&amp;rsquo;s &lt;code&gt;securityContext&lt;/code&gt; section. While this works in all circumstances, there are ways to deploy Beyla in Kubernetes with reduced privileges if your security configuration requires you to do so. Whether this is possible depends on the Kubernetes version you have and the underlying container runtime used (e.g. &lt;strong&gt;Containerd&lt;/strong&gt;, &lt;strong&gt;CRI-O&lt;/strong&gt; or &lt;strong&gt;Docker&lt;/strong&gt;).&lt;/p&gt;
&lt;p&gt;The following guide is based on tests performed mainly by running &lt;code&gt;containerd&lt;/code&gt; with &lt;code&gt;GKE&lt;/code&gt;, &lt;code&gt;kubeadm&lt;/code&gt;, &lt;code&gt;k3s&lt;/code&gt;, &lt;code&gt;microk8s&lt;/code&gt; and &lt;code&gt;kind&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;To run Beyla unprivileged, you need to replace the &lt;code&gt;privileged:true&lt;/code&gt; setting with a set of Linux &lt;a href=&#34;https://www.man7.org/linux/man-pages/man7/capabilities.7.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;capabilities&lt;/a&gt;. A comprehensive list of capabilities required by Beyla can be found in &lt;a href=&#34;../../security/&#34;&gt;Security, permissions and capabilities&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt; Loading BPF programs requires that Beyla is able to read the Linux performance events, or at least be able to execute the Linux Kernel API &lt;code&gt;perf_event_open()&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;This permission is granted by &lt;code&gt;CAP_PERFMON&lt;/code&gt; or more liberally through &lt;code&gt;CAP_SYS_ADMIN&lt;/code&gt;. Since both &lt;code&gt;CAP_PERFMON&lt;/code&gt; and &lt;code&gt;CAP_SYS_ADMIN&lt;/code&gt; grant Beyla the permission to read performance
events, you should use &lt;code&gt;CAP_PERFMON&lt;/code&gt; because it grants lesser permissions. However, at system level, the access to the performance
events is controlled through the setting &lt;code&gt;kernel.perf_event_paranoid&lt;/code&gt;, which you can read or write by using &lt;code&gt;sysctl&lt;/code&gt; or by modifying the file &lt;code&gt;/proc/sys/kernel/perf_event_paranoid&lt;/code&gt;.
The default setting for &lt;code&gt;kernel.perf_event_paranoid&lt;/code&gt; is typically &lt;code&gt;2&lt;/code&gt;, which is documented under the &lt;code&gt;perf_event_paranoid&lt;/code&gt; section in the &lt;a href=&#34;https://www.kernel.org/doc/Documentation/sysctl/kernel.txt&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;kernel documentation&lt;/a&gt;.
Some Linux distributions define higher levels for &lt;code&gt;kernel.perf_event_paranoid&lt;/code&gt;, for example Debian based distributions &lt;a href=&#34;https://lwn.net/Articles/696216/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;also use&lt;/a&gt; &lt;code&gt;kernel.perf_event_paranoid=3&lt;/code&gt;,
which disallows access to &lt;code&gt;perf_event_open()&lt;/code&gt; without &lt;code&gt;CAP_SYS_ADMIN&lt;/code&gt;. If you are running on a distribution with &lt;code&gt;kernel.perf_event_paranoid&lt;/code&gt; setting higher than &lt;code&gt;2&lt;/code&gt;,
you can either modify your configuration to lower it to &lt;code&gt;2&lt;/code&gt; or use &lt;code&gt;CAP_SYS_ADMIN&lt;/code&gt; instead of &lt;code&gt;CAP_PERFMON&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;An example of a Beyla unprivileged container configuration can be found below, or you can download the &lt;a href=&#34;https://github.com/grafana/beyla/tree/main/examples/k8s/unprivileged.yaml&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;full example deployment&lt;/a&gt; file:&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;...
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: beyla
  namespace: beyla-demo
  labels:
    k8s-app: beyla
spec:
  selector:
    matchLabels:
      k8s-app: beyla
  template:
    metadata:
      labels:
        k8s-app: beyla
    spec:
      serviceAccount: beyla
      hostPID: true           # &amp;lt;-- Important. Required in Daemonset mode so Beyla can discover all monitored processes
      containers:
      - name: beyla
        terminationMessagePolicy: FallbackToLogsOnError
        image: grafana/beyla:latest
        env:
          - name: BEYLA_TRACE_PRINTER
            value: &amp;#34;text&amp;#34;
          - name: BEYLA_KUBE_METADATA_ENABLE
            value: &amp;#34;autodetect&amp;#34;
          - name: KUBE_NAMESPACE
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace
          ...
        securityContext:
          runAsUser: 0
          readOnlyRootFilesystem: true
          capabilities:
            add:
              - BPF                 # &amp;lt;-- Important. Required for most eBPF probes to function correctly.
              - SYS_PTRACE          # &amp;lt;-- Important. Allows Beyla to access the container namespaces and inspect executables.
              - NET_RAW             # &amp;lt;-- Important. Allows Beyla to use socket filters for http requests.
              - CHECKPOINT_RESTORE  # &amp;lt;-- Important. Allows Beyla to open ELF files.
              - DAC_READ_SEARCH     # &amp;lt;-- Important. Allows Beyla to open ELF files.
              - PERFMON             # &amp;lt;-- Important. Allows Beyla to load BPF programs.
              #- SYS_RESOURCE       # &amp;lt;-- pre 5.11 only. Allows Beyla to increase the amount of locked memory.
              #- SYS_ADMIN          # &amp;lt;-- Required for Go application trace context propagation, or if kernel.perf_event_paranoid &amp;gt;= 3 on Debian distributions.
            drop:
              - ALL
        volumeMounts:
        - name: var-run-beyla
          mountPath: /var/run/beyla
        - name: cgroup
          mountPath: /sys/fs/cgroup
      tolerations:
      - effect: NoSchedule
        operator: Exists
      - effect: NoExecute
        operator: Exists
      volumes:
      - name: var-run-beyla
        emptyDir: {}
      - name: cgroup
        hostPath:
          path: /sys/fs/cgroup
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: some-service
  namespace: beyla-demo
  ...
---&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;providing-an-external-configuration-file&#34;&gt;Providing an external configuration file&lt;/h2&gt;
&lt;p&gt;In the previous examples, Beyla was configured via environment variables.
However, you can also configure it via an external YAML file (as documented
in the &lt;a href=&#34;../../configure/options/&#34;&gt;Configuration&lt;/a&gt; section of
this site).&lt;/p&gt;
&lt;p&gt;To provide the configuration as a file, the recommended way is to deploy
a ConfigMap with the intended configuration, then mount it into the Beyla
Pod, and refer to it with the &lt;code&gt;BEYLA_CONFIG_PATH&lt;/code&gt; environment variable.&lt;/p&gt;
&lt;p&gt;Example of ConfigMap with the Beyla YAML documentation:&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;apiVersion: v1
kind: ConfigMap
metadata:
  name: beyla-config
data:
  beyla-config.yml: |
    trace_printer: text
    grafana:
      otlp:
        submit: [&amp;#34;metrics&amp;#34;,&amp;#34;traces&amp;#34;]
    otel_traces_export:
      sampler:
        name: parentbased_traceidratio
        arg: &amp;#34;0.01&amp;#34;
    routes:
      patterns:
        - /factorial/{num}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Example of Beyla DaemonSet configuration, mounting and accessing to the
previous ConfigMap:&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;apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: beyla
spec:
  selector:
    matchLabels:
      instrumentation: beyla
  template:
    metadata:
      labels:
        instrumentation: beyla
    spec:
      serviceAccountName: beyla
      hostPID: true #important!
      containers:
        - name: beyla
          image: grafana/beyla:latest
          imagePullPolicy: IfNotPresent
          securityContext:
            privileged: true
            readOnlyRootFilesystem: true
          # mount the previous ConfigMap as a folder
          volumeMounts:
            - mountPath: /config
              name: beyla-config
            - mountPath: /var/run/beyla
              name: var-run-beyla
          env:
            # tell beyla where to find the configuration file
            - name: BEYLA_CONFIG_PATH
              value: &amp;#34;/config/beyla-config.yml&amp;#34;
      volumes:
        - name: beyla-config
          configMap:
            name: beyla-config
        - name: var-run-beyla
          emptyDir: {}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;providing-secret-configuration&#34;&gt;Providing secret configuration&lt;/h2&gt;
&lt;p&gt;The previous example is valid for regular configuration but should not be
used to pass secret information like passwords or API keys.&lt;/p&gt;
&lt;p&gt;To provide secret information, the recommended way is to deploy a Kubernetes
Secret. For example, this secret contains some fictional Grafana Cloud
credentials:&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;apiVersion: v1
kind: Secret
metadata:
  name: grafana-secret
type: Opaque
stringData:
  grafana-user: &amp;#34;123456&amp;#34;
  grafana-api-key: &amp;#34;xxxxxxxxxxxxxxx&amp;#34;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Then you can access the secret values as environment variables. Following the
previous DaemonSet example, this would be achieved by adding the following
&lt;code&gt;env&lt;/code&gt; section to the Beyla container:&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;env:
  - name: GRAFANA_CLOUD_ZONE
    value: prod-eu-west-0
  - name: GRAFANA_CLOUD_INSTANCE_ID
    valueFrom:
      secretKeyRef:
        key: grafana-user
        name: grafana-secret
  - name: GRAFANA_CLOUD_API_KEY
    valueFrom:
      secretKeyRef:
        key: grafana-api-key
        name: grafana-secret&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="deploy-beyla-in-kubernetes">Deploy Beyla in Kubernetes&lt;/h1>
&lt;div class="admonition admonition-note">&lt;blockquote>&lt;p class="title text-uppercase">Note&lt;/p>&lt;p>This document explains how to manually deploy Beyla in Kubernetes, setting up all the required entities by yourself.&lt;/p>
&lt;p>You might prefer to follow the &lt;a href="../kubernetes-helm/">Deploy Beyla in Kubernetes with Helm&lt;/a> documentation instead.&lt;/p></description></item><item><title>Deploy Beyla in Kubernetes with Helm</title><link>https://grafana.com/docs/beyla/v3.7.x/setup/kubernetes-helm/</link><pubDate>Fri, 03 Apr 2026 19:43:06 +0000</pubDate><guid>https://grafana.com/docs/beyla/v3.7.x/setup/kubernetes-helm/</guid><content><![CDATA[&lt;h1 id=&#34;deploy-beyla-in-kubernetes-with-helm&#34;&gt;Deploy Beyla in Kubernetes with Helm&lt;/h1&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;For more details about the diverse Helm configuration options, check out the
&lt;a href=&#34;https://github.com/grafana/beyla/blob/main/charts/beyla/README.md&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Beyla Helm chart options&lt;/a&gt;
document.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;Contents:&lt;/p&gt;
&lt;!-- TOC --&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;#deploy-beyla-from-helm&#34;&gt;Deploy Beyla with helm&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#configure-beyla&#34;&gt;Configure Beyla&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#configure-beyla-metadata&#34;&gt;Configure Beyla metadata&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#provide-secrets-to-the-helm-configuration&#34;&gt;Provide secrets to the Helm configuration&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;!-- TOC --&gt;
&lt;h2 id=&#34;deploy-beyla-with-helm&#34;&gt;Deploy Beyla with helm&lt;/h2&gt;
&lt;p&gt;First, you need to add the Grafana helm repository to Helm:&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;sh&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-sh&#34;&gt;helm repo add grafana https://grafana.github.io/helm-charts&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The following command deploys a Beyla DaemonSet with a default configuration in the &lt;code&gt;beyla&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;sh&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-sh&#34;&gt;helm install beyla -n beyla --create-namespace  grafana/beyla&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The default Beyla configuration:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;exports the metrics as Prometheus metrics in the Pod HTTP port &lt;code&gt;9090&lt;/code&gt;, &lt;code&gt;/metrics&lt;/code&gt; path.&lt;/li&gt;
&lt;li&gt;tries to instrument all the applications in your cluster.&lt;/li&gt;
&lt;li&gt;only provides application-level metrics and excludes &lt;a href=&#34;../../network/&#34;&gt;network-level metrics&lt;/a&gt; by default&lt;/li&gt;
&lt;li&gt;configures Beyla to decorate the metrics with Kubernetes metadata labels, for example &lt;code&gt;k8s.namespace.name&lt;/code&gt; or &lt;code&gt;k8s.pod.name&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;configure-beyla&#34;&gt;Configure Beyla&lt;/h2&gt;
&lt;p&gt;You might want to override the default configuration of Beyla. For example, to export the metrics and/or spans
as OpenTelemetry instead of Prometheus, or to restrict the number of services to instrument.&lt;/p&gt;
&lt;p&gt;You can override the default &lt;a href=&#34;../../configure/&#34;&gt;Beyla configuration options&lt;/a&gt; with your own values.&lt;/p&gt;
&lt;p&gt;For example, create a &lt;code&gt;helm-beyla.yml&lt;/code&gt; file with a custom configuration:&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;config:
  data:
    # Contents of the actual Beyla configuration file
    discovery:
      instrument:
        - k8s_namespace: demo
        - k8s_namespace: blog
    routes:
      unmatched: heuristic&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The &lt;code&gt;config.data&lt;/code&gt; section contains a Beyla configuration file, documented in the
&lt;a href=&#34;../../configure/options/&#34;&gt;Beyla configuration options documentation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Then pass the overridden configuration to the &lt;code&gt;helm&lt;/code&gt; command with the &lt;code&gt;-f&lt;/code&gt; flag. For example:&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;sh&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-sh&#34;&gt;helm install beyla grafana/beyla -f helm-beyla.yml&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;or, if the Beyla chart was previously deployed:&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;sh&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-sh&#34;&gt;helm upgrade beyla grafana/beyla -f helm-beyla.yml&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;configure-beyla-metadata&#34;&gt;Configure Beyla metadata&lt;/h2&gt;
&lt;p&gt;If Beyla exports the data using the Prometheus exporter, you can expose its metrics
by creating a Kubernetes Service and configuring a ServiceMonitor, allowing your Prometheus scraper to discover it.
To enable this feature, edit your &lt;code&gt;helm-beyla.yml&lt;/code&gt; file to include the following configuration:&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;service:
  enabled: true

serviceMonitor:
  enabled: true&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;Configure your Prometheus scraper with &lt;a href=&#34;../../configure/export-data/#prometheus-exporter-component&#34;&gt;&lt;code&gt;honor_labels: true&lt;/code&gt;&lt;/a&gt; to preserve the per-process instance identifiers set by Beyla.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;Analogously, the Helm chart allows overriding names, labels, and annotations for
multiple resources involved in the deployment of Beyla, such as service
accounts, cluster roles, security contexts, etc. The
&lt;a href=&#34;https://github.com/grafana/beyla/blob/main/charts/beyla/README.md&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Beyla Helm chart documentation&lt;/a&gt;
describes the diverse configuration options.&lt;/p&gt;
&lt;h2 id=&#34;provide-secrets-to-the-helm-configuration&#34;&gt;Provide secrets to the Helm configuration&lt;/h2&gt;
&lt;p&gt;If you are submitting directly the metrics and traces to Grafana Cloud via the
OpenTelemetry Endpoint, you need to provide the credentials via the
&lt;code&gt;OTEL_EXPORTER_OTLP_HEADERS&lt;/code&gt; environment variable.&lt;/p&gt;
&lt;p&gt;The recommended way is to store such value in a Kubernetes Secret and then
specify the environment variable referring to it from the Helm configuration.&lt;/p&gt;
&lt;p&gt;For example, deploy the following secret:&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;apiVersion: v1
kind: Secret
metadata:
  name: grafana-secret
type: Opaque
stringData:
  otlp-headers: &amp;#34;Authorization=Basic ....&amp;#34;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Then refer to it from the &lt;code&gt;helm-config.yml&lt;/code&gt; file via the &lt;code&gt;envValueFrom&lt;/code&gt; section:&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;env:
  OTEL_EXPORTER_OTLP_ENDPOINT: &amp;#34;&amp;lt;...your Grafana Cloud OTLP endpoint URL...&amp;gt;&amp;#34;
envValueFrom:
  OTEL_EXPORTER_OTLP_HEADERS:
    secretKeyRef:
      key: otlp-headers
      name: grafana-secret&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="deploy-beyla-in-kubernetes-with-helm">Deploy Beyla in Kubernetes with Helm&lt;/h1>
&lt;div class="admonition admonition-note">&lt;blockquote>&lt;p class="title text-uppercase">Note&lt;/p>&lt;p>For more details about the diverse Helm configuration options, check out the
&lt;a href="https://github.com/grafana/beyla/blob/main/charts/beyla/README.md" target="_blank" rel="noopener noreferrer">Beyla Helm chart options&lt;/a>
document.&lt;/p></description></item><item><title>Run Beyla in Kubernetes using Grafana Alloy Helm's chart</title><link>https://grafana.com/docs/beyla/v3.7.x/setup/helm-alloy/</link><pubDate>Fri, 03 Apr 2026 19:43:06 +0000</pubDate><guid>https://grafana.com/docs/beyla/v3.7.x/setup/helm-alloy/</guid><content><![CDATA[&lt;h1 id=&#34;run-beyla-in-kubernetes-using-grafana-alloy-helms-chart&#34;&gt;Run Beyla in Kubernetes using Grafana Alloy Helm&amp;rsquo;s chart&lt;/h1&gt;
&lt;p&gt;Grafana Alloy is a vendor-neutral distribution of the OpenTelemetry Collector.
Alloy offers native pipelines for OpenTelemetry, Prometheus, and other telemetry signals.&lt;/p&gt;
&lt;p&gt;Grafana Alloy bundles Beyla allowing you to instrument your applications at the same time
you instrument your infrastructure. It also provides a Helm chart to deploy Alloy in Kubernetes.&lt;/p&gt;
&lt;p&gt;In this tutorial, you learn how to deploy Beyla in Kubernetes using Grafana Alloy Helm&amp;rsquo;s chart.&lt;/p&gt;
&lt;h2 id=&#34;prerequisites&#34;&gt;Prerequisites&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;A Kubernetes cluster, you can use &lt;a href=&#34;https://kind.sigs.k8s.io/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;kind&lt;/a&gt; to create a local cluster&lt;/li&gt;
&lt;li&gt;&lt;code&gt;kubectl&lt;/code&gt; installed and configured for your cluster&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://helm.sh/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Helm&lt;/a&gt; installed&lt;/li&gt;
&lt;li&gt;A Grafana Cloud account or a compatible Prometheus and/or OpenTelemetry backend to receive the data&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;1-prepare-the-alloy-environment-in-kubernetes&#34;&gt;1. Prepare the Alloy environment in Kubernetes&lt;/h3&gt;
&lt;p&gt;You need to install the Helm chart for Grafana Alloy in your Kubernetes cluster.&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;Bash&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-bash&#34;&gt;helm install --namespace alloy alloy grafana/alloy&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This command installs the Grafana Alloy Helm chart in the &lt;code&gt;alloy&lt;/code&gt; namespace.&lt;/p&gt;
&lt;h3 id=&#34;2-deploy-services&#34;&gt;2. Deploy services&lt;/h3&gt;
&lt;p&gt;You can instrument any HTTP or HTTPS service in your Kubernetes cluster.&lt;/p&gt;
&lt;p&gt;Copy the following contents into a file, for example &lt;code&gt;sampleapps.yml&lt;/code&gt;, and deploy it with
the command &lt;code&gt;kubectl apply -f sampleapps.yml&lt;/code&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;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;kind: Deployment
apiVersion: apps/v1
metadata:
  name: docs
spec:
  replicas: 2
  selector:
    matchLabels:
      app: docs
  template:
    metadata:
      labels:
        app: docs
    spec:
      containers:
        - name: docs-server
          image: httpd:latest
          ports:
            - containerPort: 80
              protocol: TCP
              name: http
---
apiVersion: v1
kind: Service
metadata:
  name: docs
spec:
  selector:
    app: docs
  ports:
    - protocol: TCP
      port: 80
---
kind: Deployment
apiVersion: apps/v1
metadata:
  name: website
spec:
  replicas: 2
  selector:
    matchLabels:
      app: website
  template:
    metadata:
      labels:
        app: website
    spec:
      containers:
        - name: website-server
          image: httpd:latest
          ports:
            - containerPort: 80
              protocol: TCP
              name: http
---
apiVersion: v1
kind: Service
metadata:
  name: website
spec:
  selector:
    app: website
  ports:
    - protocol: TCP
      port: 80&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;3-configure-credentials&#34;&gt;3. Configure credentials&lt;/h3&gt;
&lt;p&gt;Alloy can export metrics and traces to any OpenTelemetry endpoint, as well as exposing metrics as a Prometheus endpoint. However, it&amp;rsquo;s recommend using the Prometheus and Tempo remote write endpoints in Grafana Cloud. You can get a &lt;a href=&#34;/pricing/&#34;&gt;free Grafana Cloud Account&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;From the Grafana Cloud Portal, look for the &lt;strong&gt;Prometheus&lt;/strong&gt; box and click &lt;strong&gt;Send Metrics&lt;/strong&gt;. For the &lt;strong&gt;Tempo&lt;/strong&gt; box, click &lt;strong&gt;Send Traces&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Create a &lt;code&gt;secrets.yml&lt;/code&gt; file with your Grafana Cloud credentials for Prometheus and Tempo remote write. Deploy it with the command &lt;code&gt;kubectl apply -f secrets.yml&lt;/code&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;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;apiVersion: v1
kind: Secret
metadata:
  namespace: alloy
  name: grafana-credentials
type: Opaque
stringData:
  prometheus-rw-user: &amp;#34;prom-user&amp;#34;
  prometheus-rw-pwd: &amp;#34;prom-pwd&amp;#34;
  tempo-rw-user: &amp;#34;tempo-user&amp;#34;
  tempo-rw-pwd: &amp;#34;tempo-pwd&amp;#34;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;3-create-a-configmap-with-alloy-configuration&#34;&gt;3. Create a ConfigMap with Alloy configuration&lt;/h3&gt;
&lt;p&gt;Create a &lt;code&gt;ConfigMap&lt;/code&gt; with the Alloy configuration. Copy the following contents into a file, for example &lt;code&gt;config.alloy&lt;/code&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;beyla.ebpf &amp;#34;default&amp;#34; {
	attributes {
		kubernetes {
			enable = &amp;#34;true&amp;#34;
		}
	}

	discovery {
		services {
      kubernetes {
				namespace = &amp;#34;default&amp;#34;
				deployment_name = &amp;#34;.&amp;#34;
      }
		}
	}

	metrics {
		features = [
			&amp;#34;application&amp;#34;,
		]
	}

	output {
		traces = [otelcol.exporter.otlp.grafana_cloud_tempo.input]
	}
}

prometheus.scrape &amp;#34;beyla&amp;#34; {
	targets      = beyla.ebpf.default.targets
	honor_labels = true
	forward_to   = [prometheus.remote_write.rw.receiver]
}

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

		basic_auth {
			username = env(&amp;#34;PROMETHEUS_REMOTE_WRITE_USERNAME&amp;#34;)
			password = env(&amp;#34;PROMETHEUS_REMOTE_WRITE_PASSWORD&amp;#34;)
		}
	}
}

otelcol.exporter.otlp &amp;#34;grafana_cloud_tempo&amp;#34; {
	client {
		endpoint = &amp;#34;tempo-us-central1.grafana.net:443&amp;#34;
		auth     = otelcol.auth.basic.grafana_cloud_tempo.handler
	}
}

otelcol.auth.basic &amp;#34;grafana_cloud_tempo&amp;#34; {
	username = env(&amp;#34;TEMPO_REMOTE_WRITE_USERNAME&amp;#34;)
	password = env(&amp;#34;TEMPO_REMOTE_WRITE_PASSWORD&amp;#34;)
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Deploy the configuration with the command:&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;Bash&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-bash&#34;&gt;kubectl create configmap --namespace alloy alloy-config &amp;#34;--from-file=config.alloy=./config.alloy&amp;#34;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;With this configuration Beyla instruments the services running in the Kubernetes cluster and send traces to Grafana Cloud Tempo and metrics to Prometheus.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;attributes &amp;gt; kubernetes &amp;gt; enable&lt;/code&gt; enables Kubernetes decoration for metrics and traces, which adds the metadata of the Kubernetes entities running the automatically instrumented services.&lt;/p&gt;
&lt;p&gt;The argument &lt;code&gt;discovery &amp;gt; services &amp;gt; kubernetes&lt;/code&gt; specifies the selection of services based on Kubernetes metadata. In this example, Beyla instruments all deployments in namespace &amp;ldquo;default&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;prometheus.scrape&lt;/code&gt; section configures Prometheus scrape to collect metrics from Beyla. The &lt;code&gt;honor_labels = true&lt;/code&gt; setting preserves the per-process instance identifiers set by Beyla. The &lt;code&gt;prometheus.remote_write&lt;/code&gt; section sends the metrics to Grafana Cloud Prometheus.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;output&lt;/code&gt; section configures that Beyla component sends traces to &lt;code&gt;otelcol.exporter.otlp&lt;/code&gt; component. The &lt;code&gt;otelcol.exporter.otlp&lt;/code&gt; section configures the &lt;a href=&#34;/docs/alloy/latest/reference/components/otelcol.exporter.otlp&#34;&gt;OTLP exporter&lt;/a&gt; to send the traces to Grafana Cloud Tempo.&lt;/p&gt;
&lt;p&gt;For further details on the configuration options, refer to the documentation of the &lt;a href=&#34;/docs/alloy/latest/reference/components/beyla.ebpf&#34;&gt;Grafana Alloy Beyla component&lt;/a&gt;&lt;/p&gt;
&lt;h3 id=&#34;4-deploy-alloy-with-helm&#34;&gt;4. Deploy Alloy with Helm&lt;/h3&gt;
&lt;p&gt;Create a &lt;code&gt;values.yaml&lt;/code&gt; with the configuration for the Alloy Helm chart. Copy the following contents into a file, for example &lt;code&gt;values.yaml&lt;/code&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;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;# -- Overrides the chart&amp;#39;s name. Used to change the infix in the resource names.
nameOverride: null

# -- Overrides the chart&amp;#39;s computed fullname. Used to change the full prefix of
# resource names.
fullnameOverride: null

## Global properties for image pulling override the values defined under `image.registry` and `configReloader.image.registry`.
## If you want to override only one image registry, use the specific fields but if you want to override them all, use `global.image.registry`
global:
  image:
    # -- Global image registry to use if it needs to be overridden for some specific use cases (e.g local registries, custom images, ...)
    registry: &amp;#34;&amp;#34;

    # -- Optional set of global image pull secrets.
    pullSecrets: []

  # -- Security context to apply to the Grafana Alloy pod.
  podSecurityContext: {}

crds:
  # -- Whether to install CRDs for monitoring.
  create: true

## Various Alloy settings. For backwards compatibility with the grafana-agent
## chart, this field may also be called &amp;#34;agent&amp;#34;. Naming this field &amp;#34;agent&amp;#34; is
## deprecated and will be removed in a future release.
alloy:
  configMap:
    # -- Create a new ConfigMap for the config file.
    create: false
    # -- Name of existing ConfigMap to use. Used when create is false.
    name: alloy-config
    # -- Key in ConfigMap to get config from.
    key: config.alloy

  clustering:
    # -- Deploy Alloy in a cluster to allow for load distribution.
    enabled: false

  # -- Minimum stability level of components and behavior to enable. Must be
  # one of &amp;#34;experimental&amp;#34;, &amp;#34;public-preview&amp;#34;, or &amp;#34;generally-available&amp;#34;.
  stabilityLevel: &amp;#34;public-preview&amp;#34;

  # -- Path to where Grafana Alloy stores data (for example, the Write-Ahead Log).
  # By default, data is lost between reboots.
  storagePath: /tmp/alloy

  # -- Address to listen for traffic on. 0.0.0.0 exposes the UI to other
  # containers.
  listenAddr: 0.0.0.0

  # -- Port to listen for traffic on.
  listenPort: 12345

  # -- Scheme is needed for readiness probes. If enabling tls in your configs, set to &amp;#34;HTTPS&amp;#34;
  listenScheme: HTTP

  # --  Base path where the UI is exposed.
  uiPathPrefix: /

  # -- Enables sending Grafana Labs anonymous usage stats to help improve Grafana
  # Alloy.
  enableReporting: true

  # -- Extra environment variables to pass to the Alloy container.
  extraEnv:
  - name: PROMETHEUS_REMOTE_WRITE_USERNAME
    valueFrom:
      secretKeyRef:
        name: grafana-credentials
        key: prometheus-rw-user
  - name: PROMETHEUS_REMOTE_WRITE_PASSWORD
    valueFrom:
      secretKeyRef:
        name: grafana-credentials
        key: prometheus-rw-pwd
  - name: TEMPO_REMOTE_WRITE_USERNAME
    valueFrom:
      secretKeyRef:
        name: grafana-credentials
        key: tempo-rw-user
  - name: TEMPO_REMOTE_WRITE_PASSWORD
    valueFrom:
      secretKeyRef:
        name: grafana-credentials
        key: tempo-rw-pwd

  # -- Maps all the keys on a ConfigMap or Secret as environment variables. https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#envfromsource-v1-core
  envFrom: []

  # -- Extra args to pass to `alloy run`: https://grafana.com/docs/alloy/latest/reference/cli/run/
  extraArgs: []

  # -- Extra ports to expose on the Alloy container.
  extraPorts: []
  # - name: &amp;#34;faro&amp;#34;
  #   port: 12347
  #   targetPort: 12347
  #   protocol: &amp;#34;TCP&amp;#34;

  mounts:
    # -- Mount /var/log from the host into the container for log collection.
    varlog: false
    # -- Mount /var/lib/docker/containers from the host into the container for log
    # collection.
    dockercontainers: false

    # -- Extra volume mounts to add into the Grafana Alloy container. Does not
    # affect the watch container.
    extra: []

  # -- Security context to apply to the Grafana Alloy container.
  securityContext:
    privileged: true # important!

  # -- Resource requests and limits to apply to the Grafana Alloy container.
  resources: {}

image:
  # -- Grafana Alloy image registry (defaults to docker.io)
  registry: &amp;#34;docker.io&amp;#34;
  # -- Grafana Alloy image repository.
  repository: grafana/alloy
  # -- (string) Grafana Alloy image tag. When empty, the Chart&amp;#39;s appVersion is
  # used.
  tag: null
  # -- Grafana Alloy image&amp;#39;s SHA256 digest (either in format &amp;#34;sha256:XYZ&amp;#34; or &amp;#34;XYZ&amp;#34;). When set, will override `image.tag`.
  digest: null
  # -- Grafana Alloy image pull policy.
  pullPolicy: IfNotPresent
  # -- Optional set of image pull secrets.
  pullSecrets: []

rbac:
  # -- Whether to create RBAC resources for Alloy.
  create: true

serviceAccount:
  # -- Whether to create a service account for the Grafana Alloy deployment.
  create: true
  # -- Additional labels to add to the created service account.
  additionalLabels: {}
  # -- Annotations to add to the created service account.
  annotations: {}
  # -- The name of the existing service account to use when
  # serviceAccount.create is false.
  name: null

# Options for the extra controller used for config reloading.
configReloader:
  # -- Enables automatically reloading when the Alloy config changes.
  enabled: true
  image:
    # -- Config reloader image registry (defaults to docker.io)
    registry: &amp;#34;ghcr.io&amp;#34;
    # -- Repository to get config reloader image from.
    repository: jimmidyson/configmap-reload
    # -- Tag of image to use for config reloading.
    tag: v0.12.0
    # -- SHA256 digest of image to use for config reloading (either in format &amp;#34;sha256:XYZ&amp;#34; or &amp;#34;XYZ&amp;#34;). When set, will override `configReloader.image.tag`
    digest: &amp;#34;&amp;#34;
  # -- Override the args passed to the container.
  customArgs: []
  # -- Resource requests and limits to apply to the config reloader container.
  resources:
    requests:
      cpu: &amp;#34;1m&amp;#34;
      memory: &amp;#34;5Mi&amp;#34;
  # -- Security context to apply to the Grafana configReloader container.
  securityContext: {}

controller:
  # -- Type of controller to use for deploying Grafana Alloy in the cluster.
  # Must be one of &amp;#39;daemonset&amp;#39;, &amp;#39;deployment&amp;#39;, or &amp;#39;statefulset&amp;#39;.
  type: &amp;#39;daemonset&amp;#39;

  # -- Number of pods to deploy. Ignored when controller.type is &amp;#39;daemonset&amp;#39;.
  replicas: 1

  # -- Annotations to add to controller.
  extraAnnotations: {}

  # -- Whether to deploy pods in parallel. Only used when controller.type is
  # &amp;#39;statefulset&amp;#39;.
  parallelRollout: true

  # -- Configures Pods to use the host network. When set to true, the ports that will be used must be specified.
  hostNetwork: false

  # -- Configures Pods to use the host PID namespace.
  hostPID: true # important!

  # -- Configures the DNS policy for the pod. https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy
  dnsPolicy: ClusterFirst

  # -- Update strategy for updating deployed Pods.
  updateStrategy: {}

  # -- nodeSelector to apply to Grafana Alloy pods.
  nodeSelector: {}

  # -- Tolerations to apply to Grafana Alloy pods.
  tolerations: []

  # -- Topology Spread Constraints to apply to Grafana Alloy pods.
  topologySpreadConstraints: []

  # -- priorityClassName to apply to Grafana Alloy pods.
  priorityClassName: &amp;#39;&amp;#39;

  # -- Extra pod annotations to add.
  podAnnotations: {}

  # -- Extra pod labels to add.
  podLabels: {}

  # -- Whether to enable automatic deletion of stale PVCs due to a scale down operation, when controller.type is &amp;#39;statefulset&amp;#39;.
  enableStatefulSetAutoDeletePVC: false

  autoscaling:
    # -- Creates a HorizontalPodAutoscaler for controller type deployment.
    enabled: false
    # -- The lower limit for the number of replicas to which the autoscaler can scale down.
    minReplicas: 1
    # -- The upper limit for the number of replicas to which the autoscaler can scale up.
    maxReplicas: 5
    # -- Average CPU utilization across all relevant pods, a percentage of the requested value of the resource for the pods. Setting `targetCPUUtilizationPercentage` to 0 will disable CPU scaling.
    targetCPUUtilizationPercentage: 0
    # -- Average Memory utilization across all relevant pods, a percentage of the requested value of the resource for the pods. Setting `targetMemoryUtilizationPercentage` to 0 will disable Memory scaling.
    targetMemoryUtilizationPercentage: 80

    scaleDown:
      # -- List of policies to determine the scale-down behavior.
      policies: []
        # - type: Pods
        #   value: 4
        #   periodSeconds: 60
      # -- Determines which of the provided scaling-down policies to apply if multiple are specified.
      selectPolicy: Max
      # -- The duration that the autoscaling mechanism should look back on to make decisions about scaling down.
      stabilizationWindowSeconds: 300

    scaleUp:
      # -- List of policies to determine the scale-up behavior.
      policies: []
        # - type: Pods
        #   value: 4
        #   periodSeconds: 60
      # -- Determines which of the provided scaling-up policies to apply if multiple are specified.
      selectPolicy: Max
      # -- The duration that the autoscaling mechanism should look back on to make decisions about scaling up.
      stabilizationWindowSeconds: 0

  # -- Affinity configuration for pods.
  affinity: {}

  volumes:
    # -- Extra volumes to add to the Grafana Alloy pod.
    extra: []

  # -- volumeClaimTemplates to add when controller.type is &amp;#39;statefulset&amp;#39;.
  volumeClaimTemplates: []

  ## -- Additional init containers to run.
  ## ref: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/
  ##
  initContainers: []

  # -- Additional containers to run alongside the Alloy container and initContainers.
  extraContainers: []

service:
  # -- Creates a Service for the controller&amp;#39;s pods.
  enabled: true
  # -- Service type
  type: ClusterIP
  # -- NodePort port. Only takes effect when `service.type: NodePort`
  nodePort: 31128
  # -- Cluster IP, can be set to None, empty &amp;#34;&amp;#34; or an IP address
  clusterIP: &amp;#39;&amp;#39;
  # -- Value for internal traffic policy. &amp;#39;Cluster&amp;#39; or &amp;#39;Local&amp;#39;
  internalTrafficPolicy: Cluster
  annotations: {}
    # cloud.google.com/load-balancer-type: Internal

serviceMonitor:
  enabled: false
  # -- Additional labels for the service monitor.
  additionalLabels: {}
  # -- Scrape interval. If not set, the Prometheus default scrape interval is used.
  interval: &amp;#34;&amp;#34;
  # -- MetricRelabelConfigs to apply to samples after scraping, but before ingestion.
  # ref: https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#relabelconfig
  metricRelabelings: []
  # - action: keep
  #   regex: &amp;#39;kube_(daemonset|deployment|pod|namespace|node|statefulset).&amp;#43;&amp;#39;
  #   sourceLabels: [__name__]

  # -- Customize tls parameters for the service monitor
  tlsConfig: {}

  # -- RelabelConfigs to apply to samples before scraping
  # ref: https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#relabelconfig
  relabelings: []
  # - sourceLabels: [__meta_kubernetes_pod_node_name]
  #   separator: ;
  #   regex: ^(.*)$
  #   targetLabel: nodename
  #   replacement: $1
  #   action: replace
ingress:
  # -- Enables ingress for Alloy (Faro port)
  enabled: false
  # For Kubernetes &amp;gt;= 1.18 you should specify the ingress-controller via the field ingressClassName
  # See https://kubernetes.io/blog/2020/04/02/improvements-to-the-ingress-api-in-kubernetes-1.18/#specifying-the-class-of-an-ingress
  # ingressClassName: nginx
  # Values can be templated
  annotations:
    {}
    # kubernetes.io/ingress.class: nginx
    # kubernetes.io/tls-acme: &amp;#34;true&amp;#34;
  labels: {}
  path: /
  faroPort: 12347

  # pathType is only for k8s &amp;gt;= 1.1=
  pathType: Prefix

  hosts:
    - chart-example.local
  ## Extra paths to prepend to every host configuration. This is useful when working with annotation based services.
  extraPaths: []
  # - path: /*
  #   backend:
  #     serviceName: ssl-redirect
  #     servicePort: use-annotation
  ## Or for k8s &amp;gt; 1.19
  # - path: /*
  #   pathType: Prefix
  #   backend:
  #     service:
  #       name: ssl-redirect
  #       port:
  #         name: use-annotation

  tls: []
  #  - secretName: chart-example-tls
  #    hosts:
  #      - chart-example.local&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Deploy the configuration with the command:&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;sh&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-sh&#34;&gt;helm upgrade --namespace alloy alloy grafana/alloy -f values.yaml&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;To run in DaemonSet mode, Beyla requires to have access to all the
processes in the node. Therefore set &lt;code&gt;hostPID: true&lt;/code&gt; the &lt;code&gt;controller&lt;/code&gt; section.&lt;/li&gt;
&lt;li&gt;The Beyla container needs to run with privileges as it requires
to perform privileged actions such as loading BPF programs and creating
BPF maps. Therefore set &lt;code&gt;privileged: true&lt;/code&gt; in &lt;code&gt;securityContext&lt;/code&gt; section. For running Beyla as &lt;code&gt;unprivileged&lt;/code&gt; container, that&amp;rsquo;s without the
&lt;code&gt;privileged: true&lt;/code&gt; option, visit the
&lt;a href=&#34;../kubernetes/#deploy-beyla-unprivileged&#34;&gt;Deploy Beyla unprivileged&lt;/a&gt;
guide.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;extraEnv&lt;/code&gt; section sets the environment variables for the Prometheus and Tempo remote write credentials.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;5-test-the-setup&#34;&gt;5. Test the setup&lt;/h3&gt;
&lt;p&gt;With the &lt;code&gt;kubectl port-forward&lt;/code&gt; commands from the first step still running,
test both web server instances. For example:&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;sh&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-sh&#34;&gt;curl http://localhost:8080
curl http://localhost:8080/foo
curl http://localhost:8081
curl http://localhost:8081/foo&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Navigate to the instance in Grafana Cloud, and from the &lt;strong&gt;Explore&lt;/strong&gt; section in the left panel, select the data source for the traces, named &lt;code&gt;grafanacloud-&amp;lt;your user name&amp;gt;-traces&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;https://grafana.com/media/docs/grafana-cloud/beyla/tutorial/k8s/select-traces.png&#34;
  alt=&#34;Select the traces data source&#34; width=&#34;1896&#34;
     height=&#34;440&#34;/&gt;&lt;/p&gt;
&lt;p&gt;To search for all the traces, select the &lt;strong&gt;Search&lt;/strong&gt; box in the Query bar, leave the form empty, and click &lt;strong&gt;Run query&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;https://grafana.com/media/docs/grafana-cloud/beyla/tutorial/k8s/run-query.png&#34;
  alt=&#34;Searching for all the traces in the system&#34; width=&#34;1766&#34;
     height=&#34;904&#34;/&gt;&lt;/p&gt;
&lt;p&gt;This shows the traces for the &lt;code&gt;docs&lt;/code&gt; instance on port 8081. You might see traces from your own services, but you shouldn&amp;rsquo;t see traces from the &lt;code&gt;website&lt;/code&gt; service, as it Beyla isn&amp;rsquo;t instrumenting it.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;https://grafana.com/media/docs/grafana-cloud/beyla/tutorial/k8s/tut-traces-list.png&#34;
  alt=&#34;Grafana Cloud list of traces&#34; width=&#34;1614&#34;
     height=&#34;316&#34;/&gt;&lt;/p&gt;
&lt;p&gt;In the trace details, the resource attributes of the traces have metadata of the Kubernetes Pod running the instrumented service:&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;https://grafana.com/media/docs/grafana-cloud/beyla/tutorial/k8s/tut-trace-details.png&#34;
  alt=&#34;Details of the trace&#34; width=&#34;1630&#34;
     height=&#34;1470&#34;/&gt;&lt;/p&gt;
]]></content><description>&lt;h1 id="run-beyla-in-kubernetes-using-grafana-alloy-helms-chart">Run Beyla in Kubernetes using Grafana Alloy Helm&amp;rsquo;s chart&lt;/h1>
&lt;p>Grafana Alloy is a vendor-neutral distribution of the OpenTelemetry Collector.
Alloy offers native pipelines for OpenTelemetry, Prometheus, and other telemetry signals.&lt;/p></description></item></channel></rss>