<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Beyla quickstart guides on Grafana Labs</title><link>https://grafana.com/docs/beyla/v1.5.x/quickstart/</link><description>Recent content in Beyla quickstart guides on Grafana Labs</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/beyla/v1.5.x/quickstart/index.xml" rel="self" type="application/rss+xml"/><item><title>Quickstart: instrument a C/C++ service with Beyla</title><link>https://grafana.com/docs/beyla/v1.5.x/quickstart/cpp/</link><pubDate>Mon, 16 Mar 2026 19:38:33 +0000</pubDate><guid>https://grafana.com/docs/beyla/v1.5.x/quickstart/cpp/</guid><content><![CDATA[&lt;h1 id=&#34;quickstart-instrument-a-cc-service-with-beyla&#34;&gt;Quickstart: instrument a C/C&#43;&#43; service with Beyla&lt;/h1&gt;
&lt;h2 id=&#34;1-run-an-instrumentable-cc-service&#34;&gt;1. Run an instrumentable C/C&#43;&#43; service&lt;/h2&gt;
&lt;p&gt;Run an instrumentable C/C&#43;&#43; service or download and run a simple example &lt;a href=&#34;https://github.com/grafana/beyla/tree/main/examples/quickstart/cpp&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;C&#43;&#43; HTTP service&lt;/a&gt;.&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;curl -OL https://raw.githubusercontent.com/grafana/beyla/main/examples/quickstart/cpp/httplib.h
curl -OL https://raw.githubusercontent.com/grafana/beyla/main/examples/quickstart/cpp/quickstart.cpp
g&amp;#43;&amp;#43; -std=c&amp;#43;&amp;#43;11 quickstart.cpp -o quickstart &amp;amp;&amp;amp; ./quickstart&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;If necessary, replace the &lt;code&gt;g&#43;&#43;&lt;/code&gt; command by another compiler supporting C&#43;&#43;11.&lt;/p&gt;
&lt;h2 id=&#34;2-download-beyla&#34;&gt;2. Download Beyla&lt;/h2&gt;
&lt;p&gt;Download the latest Beyla executable from the &lt;a href=&#34;https://github.com/grafana/beyla/releases&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Beyla releases page&lt;/a&gt;. Uncompress and copy the Beyla executable to any location in your &lt;code&gt;$PATH&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&#34;3-optional-get-grafana-cloud-credentials&#34;&gt;3. (Optional) get Grafana Cloud credentials&lt;/h2&gt;
&lt;p&gt;Beyla can export metrics and traces to any OpenTelemetry endpoint, as well as exposing metrics as a Prometheus endpoint. However, we recommend using the OpenTelemetry endpoint in Grafana Cloud. You can get a &lt;a href=&#34;/pricing/&#34;&gt;Free Grafana Cloud Account at Grafana&amp;rsquo;s website&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;From the Grafana Cloud Portal, look for the &lt;strong&gt;OpenTelemetry&lt;/strong&gt; box and click &lt;strong&gt;Configure&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/quickstart/otel-cloud-portal-box.png&#34;
  alt=&#34;OpenTelemetry Grafana Cloud portal&#34; width=&#34;1002&#34;
     height=&#34;312&#34;/&gt;&lt;/p&gt;
&lt;p&gt;Under &lt;strong&gt;Password / API token&lt;/strong&gt; click &lt;strong&gt;Generate now&lt;/strong&gt; and follow the instructions to create a default API token.&lt;/p&gt;
&lt;p&gt;The &lt;strong&gt;Environment Variables&lt;/strong&gt; will be populated with a set of standard OpenTelemetry environment variables which will provide the connection endpoint and credentials information for Beyla.&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/quickstart/otlp-connection-headers.png&#34;
  alt=&#34;OTLP connection headers&#34; width=&#34;1592&#34;
     height=&#34;998&#34;/&gt;&lt;/p&gt;
&lt;p&gt;Copy the &lt;strong&gt;Environment Variables&lt;/strong&gt; and keep it for the next step.&lt;/p&gt;
&lt;h2 id=&#34;4-run-beyla-with-minimal-configuration&#34;&gt;4. Run Beyla with minimal configuration&lt;/h2&gt;
&lt;p&gt;To run Beyla, first set the following environment variables:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;OTEL_EXPORTER_OTLP_PROTOCOL&lt;/code&gt;, &lt;code&gt;OTEL_EXPORTER_OTLP_ENDPOINT&lt;/code&gt; and &lt;code&gt;OTEL_EXPORTER_OTLP_HEADERS&lt;/code&gt; variables copied from the previous step.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;BEYLA_OPEN_PORT&lt;/code&gt;: the port the instrumented service is using (for example, &lt;code&gt;80&lt;/code&gt; or &lt;code&gt;443&lt;/code&gt;). If using the example service in the first section of this guide, set this variable to &lt;code&gt;8080&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To facilitate local testing, set the &lt;code&gt;BEYLA_PRINT_TRACES=true&lt;/code&gt; environment variable. This will cause Beyla to print traces to standard output.&lt;/p&gt;
&lt;p&gt;Notice: Beyla requires administrative (sudo) privileges, or at least it needs to be granted the &lt;code&gt;CAP_SYS_ADMIN&lt;/code&gt; capability.&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_OPEN_PORT=8080
export BEYLA_PRINT_TRACES=true
export OTEL_EXPORTER_OTLP_PROTOCOL=&amp;#34;http/protobuf&amp;#34;
export OTEL_EXPORTER_OTLP_ENDPOINT=&amp;#34;https://otlp-gateway-prod-eu-west-0.grafana.net/otlp&amp;#34;
export OTEL_EXPORTER_OTLP_HEADERS=&amp;#34;Authorization=Basic ...your-encoded-credentials...&amp;#34;
sudo -E beyla&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;5-test-the-service&#34;&gt;5. Test the service&lt;/h2&gt;
&lt;p&gt;With Beyla and the service running, make HTTP requests to the instrumented service:&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;curl http://localhost:8080/foo&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Beyla should output traces to the standard output similar to this:&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;2024-01-09 10:31:33.19103133 (3.254486ms[3.254486ms]) 200 GET /foo [127.0.0.1]-&amp;gt;[127.0.0.1:8080]
size:80B svc=[{quickstart  generic lima-ubuntu-lts-5074}] traceparent=[00-46214bd23716280eef43cf798dbe5522-0000000000000000-01]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The above trace shows:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;2024-01-09 10:31:33.19103133&lt;/code&gt;: time of the trace&lt;/li&gt;
&lt;li&gt;&lt;code&gt;(3.254486ms[3.254486ms])&lt;/code&gt;: total response time for the request&lt;/li&gt;
&lt;li&gt;&lt;code&gt;200 GET /foo&lt;/code&gt;: response code, HTTP method, and URL path&lt;/li&gt;
&lt;li&gt;&lt;code&gt;[127.0.0.1]-&amp;gt;[127.0.0.1:8080]&lt;/code&gt; source and destination &lt;code&gt;host:port&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;size:80B&lt;/code&gt;: size of the HTTP request (sum of the headers and the body)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;svc=[{quickstart  generic lima-ubuntu-lts-5074}]&lt;/code&gt;: &lt;code&gt;quickstart&lt;/code&gt; service, using the generic kernel-based instrumenter, with an automatically created service instance name &lt;code&gt;lima-ubuntu-lts-5074&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;traceparent&lt;/code&gt; as received by the parent request, or a new random one if the parent request didn&amp;rsquo;t specify it&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;After a few minutes traces will appear in Grafana Cloud. For example, in the traces explorer:&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/quickstart/trace-generic.png&#34;
  alt=&#34;Beyla traces explorer&#34; width=&#34;1298&#34;
     height=&#34;1134&#34;/&gt;&lt;/p&gt;
&lt;h2 id=&#34;6-configure-routing&#34;&gt;6. Configure routing&lt;/h2&gt;
&lt;p&gt;The exposed span name in Grafana Cloud is a generic &lt;code&gt;GET /**&lt;/code&gt;, where it should say something like &lt;code&gt;GET /foo&lt;/code&gt; (the path of the
test request URL).&lt;/p&gt;
&lt;p&gt;Beyla groups any unknown URL path as &lt;code&gt;/**&lt;/code&gt; to avoid unexpected cardinality explosions.&lt;/p&gt;
&lt;p&gt;Configure routing to tell Beyla about expected routes.&lt;/p&gt;
&lt;p&gt;For this quickstart, let Beyla to heuristically group the routes.&lt;/p&gt;
&lt;p&gt;First, create a &lt;code&gt;config.yml&lt;/code&gt; file with the following content:&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;yml&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-yml&#34;&gt;routes:
  unmatched: heuristic&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Then, run Beyla with the &lt;code&gt;-config&lt;/code&gt; argument (or use the &lt;code&gt;BEYLA_CONFIG_PATH&lt;/code&gt; environment variable instead):&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;sudo -E beyla -config config.yml&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Finally, make HTTP requests:&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;curl http://localhost:8080/foo
curl http://localhost:8080/user/1234
curl http://localhost:8080/user/5678&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Grafana will now heuristically assign a route to each trace. &lt;code&gt;/foo&lt;/code&gt; got its own route while &lt;code&gt;/user/1234&lt;/code&gt; and
&lt;code&gt;/user/5678&lt;/code&gt; were grouped into the &lt;code&gt;/user/*&lt;/code&gt; route.&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/quickstart/grouped-traces.png&#34;
  alt=&#34;Beyla grouped traces&#34; width=&#34;1476&#34;
     height=&#34;346&#34;/&gt;&lt;/p&gt;
&lt;h2 id=&#34;next-steps&#34;&gt;Next steps&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Get more details of the different &lt;a href=&#34;../../configure/&#34;&gt;Beyla configuration options&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Learn how to deploy Beyla as a &lt;a href=&#34;../../setup/docker/&#34;&gt;Docker container&lt;/a&gt; or as a &lt;a href=&#34;../../setup/kubernetes/&#34;&gt;Kubernetes DaemonSet or sidecar&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="quickstart-instrument-a-cc-service-with-beyla">Quickstart: instrument a C/C++ service with Beyla&lt;/h1>
&lt;h2 id="1-run-an-instrumentable-cc-service">1. Run an instrumentable C/C++ service&lt;/h2>
&lt;p>Run an instrumentable C/C++ service or download and run a simple example &lt;a href="https://github.com/grafana/beyla/tree/main/examples/quickstart/cpp" target="_blank" rel="noopener noreferrer">C++ HTTP service&lt;/a>.&lt;/p></description></item><item><title>Quickstart: instrument a Go service with Beyla</title><link>https://grafana.com/docs/beyla/v1.5.x/quickstart/golang/</link><pubDate>Mon, 16 Mar 2026 19:38:33 +0000</pubDate><guid>https://grafana.com/docs/beyla/v1.5.x/quickstart/golang/</guid><content><![CDATA[&lt;h1 id=&#34;quickstart-instrument-a-go-service-with-beyla&#34;&gt;Quickstart: instrument a Go service with Beyla&lt;/h1&gt;
&lt;h2 id=&#34;1-run-an-instrumentable-go-service&#34;&gt;1. Run an instrumentable Go service&lt;/h2&gt;
&lt;p&gt;Run an instrumentable Go service or download and run a simple example &lt;a href=&#34;https://github.com/grafana/beyla/tree/main/examples/quickstart/golang&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Go HTTP service&lt;/a&gt;.&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;curl -OL https://raw.githubusercontent.com/grafana/beyla/main/examples/quickstart/golang/quickstart.go
go run quickstart.go&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;2-download-beyla&#34;&gt;2. Download Beyla&lt;/h2&gt;
&lt;p&gt;Download the latest Beyla executable from the &lt;a href=&#34;https://github.com/grafana/beyla/releases&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Beyla releases page&lt;/a&gt;.
Uncompress and copy the Beyla executable to any location in your &lt;code&gt;$PATH&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;As an alternative (if your host has the Go toolset installed), you can directly download the
Beyla executable with the &lt;code&gt;go install&lt;/code&gt; 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;go install github.com/grafana/beyla/cmd/beyla@latest&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;3-optional-get-grafana-cloud-credentials&#34;&gt;3. (Optional) get Grafana Cloud credentials&lt;/h2&gt;
&lt;p&gt;Beyla can export metrics and traces to any OpenTelemetry endpoint, as well as exposing metrics as a Prometheus endpoint. However, we recommend using the OpenTelemetry endpoint in Grafana Cloud. You can get a &lt;a href=&#34;/pricing/&#34;&gt;Free Grafana Cloud Account at Grafana&amp;rsquo;s website&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;From the Grafana Cloud Portal, look for the &lt;strong&gt;OpenTelemetry&lt;/strong&gt; box and click &lt;strong&gt;Configure&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/quickstart/otel-cloud-portal-box.png&#34;
  alt=&#34;OpenTelemetry Grafana Cloud portal&#34; width=&#34;1002&#34;
     height=&#34;312&#34;/&gt;&lt;/p&gt;
&lt;p&gt;Under &lt;strong&gt;Password / API token&lt;/strong&gt; click &lt;strong&gt;Generate now&lt;/strong&gt; and follow the instructions to create a default API token.&lt;/p&gt;
&lt;p&gt;The &lt;strong&gt;Environment Variables&lt;/strong&gt; will be populated with a set of standard OpenTelemetry environment variables which will provide the connection endpoint and credentials information for Beyla.&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/quickstart/otlp-connection-headers.png&#34;
  alt=&#34;OTLP connection headers&#34; width=&#34;1592&#34;
     height=&#34;998&#34;/&gt;&lt;/p&gt;
&lt;p&gt;Copy the &lt;strong&gt;Environment Variables&lt;/strong&gt; and keep it for the next step.&lt;/p&gt;
&lt;h2 id=&#34;4-run-beyla-with-minimal-configuration&#34;&gt;4. Run Beyla with minimal configuration&lt;/h2&gt;
&lt;p&gt;To run Beyla, first set the following environment variables:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;OTEL_EXPORTER_OTLP_PROTOCOL&lt;/code&gt;, &lt;code&gt;OTEL_EXPORTER_OTLP_ENDPOINT&lt;/code&gt; and &lt;code&gt;OTEL_EXPORTER_OTLP_HEADERS&lt;/code&gt;
variables copied from the previous step.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;BEYLA_OPEN_PORT&lt;/code&gt;: the port the instrumented service is using
(for example, &lt;code&gt;80&lt;/code&gt; or &lt;code&gt;443&lt;/code&gt;). If using the example service in the
first section of this guide, set this variable to &lt;code&gt;8080&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To facilitate local testing, set the &lt;code&gt;BEYLA_PRINT_TRACES=true&lt;/code&gt; environment variable. This will cause Beyla to print traces to standard output.&lt;/p&gt;
&lt;p&gt;Notice: Beyla requires administrative (sudo) privileges, or at least it needs to be granted the &lt;code&gt;CAP_SYS_ADMIN&lt;/code&gt; capability.&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_OPEN_PORT=8080
export BEYLA_PRINT_TRACES=true
export OTEL_EXPORTER_OTLP_PROTOCOL=&amp;#34;http/protobuf&amp;#34;
export OTEL_EXPORTER_OTLP_ENDPOINT=&amp;#34;https://otlp-gateway-prod-eu-west-0.grafana.net/otlp&amp;#34;
export OTEL_EXPORTER_OTLP_HEADERS=&amp;#34;Authorization=Basic ...your-encoded-credentials...&amp;#34;
sudo -E beyla&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;5-test-the-service&#34;&gt;5. Test the service&lt;/h2&gt;
&lt;p&gt;With Beyla and the service running, make HTTP requests to the instrumented service:&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;curl http://localhost:8080/foo&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Beyla should output traces to the standard output similar to this:&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;2024-01-08 14:06:14.182614 (432.191µs[80.421µs]) 200 GET /foo [127.0.0.1]-&amp;gt;[localhost:8080]
size:0B svc=[{quickstart  go lima-ubuntu-lts-8222}] traceparent=[00-0f82735dab5798dfbf7f7a26d5df827b-0000000000000000-01]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The above trace shows:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;2024-01-08 14:06:14.182614&lt;/code&gt;: time of the trace&lt;/li&gt;
&lt;li&gt;&lt;code&gt;(432.191µs[80.421µs])&lt;/code&gt;: total response time for the request, with the actual internal execution
time of the request (not counting the request enqueuing time)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;200 GET /foo&lt;/code&gt;: response code, HTTP method, and URL path&lt;/li&gt;
&lt;li&gt;&lt;code&gt;[127.0.0.1]-&amp;gt;[localhost:8080]&lt;/code&gt; source and destination host:port&lt;/li&gt;
&lt;li&gt;&lt;code&gt;size:0B&lt;/code&gt;: size of the HTTP request body (0 bytes, as it was a &lt;code&gt;GET&lt;/code&gt; request).
For non-go programs, this size would also include the size of the request headers&lt;/li&gt;
&lt;li&gt;&lt;code&gt;svc=[{quickstart  go lima-ubuntu-lts-8222}]&lt;/code&gt;: &lt;code&gt;quickstart&lt;/code&gt; service, written
in Go, with an automatically created service instance name &lt;code&gt;lima-ubuntu-lts-8222&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;traceparent&lt;/code&gt; as received by the parent request, or a new random one if the parent request didn&amp;rsquo;t specify it&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;After a few minutes traces will appear in Grafana Cloud. For example, in the traces explorer:&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/quickstart/trace.png&#34;
  alt=&#34;Beyla traces explorer&#34; width=&#34;1372&#34;
     height=&#34;1246&#34;/&gt;&lt;/p&gt;
&lt;h2 id=&#34;6-configure-routing&#34;&gt;6. Configure routing&lt;/h2&gt;
&lt;p&gt;The exposed span name in Grafana Cloud is a generic &lt;code&gt;GET /**&lt;/code&gt;, where it should say something like &lt;code&gt;GET /foo&lt;/code&gt; (the path of the
test request URL).&lt;/p&gt;
&lt;p&gt;Beyla groups any unknown URL path as &lt;code&gt;/**&lt;/code&gt; to avoid unexpected cardinality explosions.&lt;/p&gt;
&lt;p&gt;Configure routing to tell Beyla about expected routes.&lt;/p&gt;
&lt;p&gt;For this quickstart, let Beyla to heuristically group the routes.&lt;/p&gt;
&lt;p&gt;First, create a &lt;code&gt;config.yml&lt;/code&gt; file with the following content:&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;yml&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-yml&#34;&gt;routes:
  unmatched: heuristic&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Then, run Beyla with the &lt;code&gt;-config&lt;/code&gt; argument (or use the &lt;code&gt;BEYLA_CONFIG_PATH&lt;/code&gt; environment variable instead):&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;sudo -E beyla -config config.yml&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Finally, make HTTP requests:&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;curl http://localhost:8080/foo
curl http://localhost:8080/user/1234
curl http://localhost:8080/user/5678&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Grafana will now heuristically assign a route to each trace. &lt;code&gt;/foo&lt;/code&gt; got its own route while &lt;code&gt;/user/1234&lt;/code&gt; and
&lt;code&gt;/user/5678&lt;/code&gt; were grouped into the &lt;code&gt;/user/*&lt;/code&gt; route.&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/quickstart/grouped-traces.png&#34;
  alt=&#34;Beyla grouped traces&#34; width=&#34;1476&#34;
     height=&#34;346&#34;/&gt;&lt;/p&gt;
&lt;h2 id=&#34;next-steps&#34;&gt;Next steps&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Get more details of the different &lt;a href=&#34;../../configure/&#34;&gt;Beyla configuration options&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Learn how to deploy Beyla as a &lt;a href=&#34;../../setup/docker/&#34;&gt;Docker container&lt;/a&gt; or as a &lt;a href=&#34;../../setup/kubernetes/&#34;&gt;Kubernetes DaemonSet or sidecar&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="quickstart-instrument-a-go-service-with-beyla">Quickstart: instrument a Go service with Beyla&lt;/h1>
&lt;h2 id="1-run-an-instrumentable-go-service">1. Run an instrumentable Go service&lt;/h2>
&lt;p>Run an instrumentable Go service or download and run a simple example &lt;a href="https://github.com/grafana/beyla/tree/main/examples/quickstart/golang" target="_blank" rel="noopener noreferrer">Go HTTP service&lt;/a>.&lt;/p></description></item><item><title>Quickstart: instrument a Java service with Beyla</title><link>https://grafana.com/docs/beyla/v1.5.x/quickstart/java/</link><pubDate>Mon, 16 Mar 2026 19:38:33 +0000</pubDate><guid>https://grafana.com/docs/beyla/v1.5.x/quickstart/java/</guid><content><![CDATA[&lt;h1 id=&#34;quickstart-instrument-a-java-service-with-beyla&#34;&gt;Quickstart: instrument a Java service with Beyla&lt;/h1&gt;
&lt;h2 id=&#34;1-run-an-instrumentable-java-service&#34;&gt;1. Run an instrumentable Java service&lt;/h2&gt;
&lt;p&gt;Run an instrumentable Java service or download and run a simple example &lt;a href=&#34;https://github.com/grafana/beyla/tree/main/examples/quickstart/java&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Java HTTP service&lt;/a&gt;.&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;curl -OL https://raw.githubusercontent.com/grafana/beyla/main/examples/quickstart/java/Quickstart.java
javac Quickstart.java &amp;amp;&amp;amp; java Quickstart&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;2-download-beyla&#34;&gt;2. Download Beyla&lt;/h2&gt;
&lt;p&gt;Download the latest Beyla executable from the &lt;a href=&#34;https://github.com/grafana/beyla/releases&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Beyla releases page&lt;/a&gt;. Uncompress and copy the Beyla executable to any location in your &lt;code&gt;$PATH&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&#34;3-optional-get-grafana-cloud-credentials&#34;&gt;3. (Optional) get Grafana Cloud credentials&lt;/h2&gt;
&lt;p&gt;Beyla can export metrics and traces to any OpenTelemetry endpoint, as well as exposing metrics as a Prometheus endpoint. However, we recommend using the OpenTelemetry endpoint in Grafana Cloud. You can get a &lt;a href=&#34;/pricing/&#34;&gt;Free Grafana Cloud Account at Grafana&amp;rsquo;s website&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;From the Grafana Cloud Portal, look for the &lt;strong&gt;OpenTelemetry&lt;/strong&gt; box and click &lt;strong&gt;Configure&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/quickstart/otel-cloud-portal-box.png&#34;
  alt=&#34;OpenTelemetry Grafana Cloud portal&#34; width=&#34;1002&#34;
     height=&#34;312&#34;/&gt;&lt;/p&gt;
&lt;p&gt;Under &lt;strong&gt;Password / API token&lt;/strong&gt; click &lt;strong&gt;Generate now&lt;/strong&gt; and follow the instructions to create a default API token.&lt;/p&gt;
&lt;p&gt;The &lt;strong&gt;Environment Variables&lt;/strong&gt; will be populated with a set of standard OpenTelemetry environment variables which will provide the connection endpoint and credentials information for Beyla.&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/quickstart/otlp-connection-headers.png&#34;
  alt=&#34;OTLP connection headers&#34; width=&#34;1592&#34;
     height=&#34;998&#34;/&gt;&lt;/p&gt;
&lt;p&gt;Copy the &lt;strong&gt;Environment Variables&lt;/strong&gt; and keep it for the next step.&lt;/p&gt;
&lt;h2 id=&#34;4-run-beyla-with-minimal-configuration&#34;&gt;4. Run Beyla with minimal configuration&lt;/h2&gt;
&lt;p&gt;To run Beyla, first set the following environment variables:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;OTEL_EXPORTER_OTLP_PROTOCOL&lt;/code&gt;, &lt;code&gt;OTEL_EXPORTER_OTLP_ENDPOINT&lt;/code&gt; and &lt;code&gt;OTEL_EXPORTER_OTLP_HEADERS&lt;/code&gt; variables copied from the previous step.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;BEYLA_OPEN_PORT&lt;/code&gt;: the port the instrumented service is using (for example, &lt;code&gt;80&lt;/code&gt; or &lt;code&gt;443&lt;/code&gt;). If using the example service in the first section of this guide, set this variable to &lt;code&gt;8080&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To facilitate local testing, set the &lt;code&gt;BEYLA_PRINT_TRACES=true&lt;/code&gt; environment variable. This causes Beyla to print traces to the standard output.&lt;/p&gt;
&lt;p&gt;Notice: Beyla requires administrative (sudo) privileges, or at least it needs to be granted the &lt;code&gt;CAP_SYS_ADMIN&lt;/code&gt; capability.&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_OPEN_PORT=8080
export BEYLA_PRINT_TRACES=true
export OTEL_EXPORTER_OTLP_PROTOCOL=&amp;#34;http/protobuf&amp;#34;
export OTEL_EXPORTER_OTLP_ENDPOINT=&amp;#34;https://otlp-gateway-prod-eu-west-0.grafana.net/otlp&amp;#34;
export OTEL_EXPORTER_OTLP_HEADERS=&amp;#34;Authorization=Basic ...your-encoded-credentials...&amp;#34;
sudo -E beyla&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;5-test-the-service&#34;&gt;5. Test the service&lt;/h2&gt;
&lt;p&gt;With Beyla and the service running, make HTTP requests to the instrumented service:&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;curl http://localhost:8080/foo&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Beyla should output traces to the standard output similar to this:&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;2024-01-09 10:31:33.19103133 (3.254486ms[3.254486ms]) 200 GET /foo [127.0.0.1]-&amp;gt;[127.0.0.1:8080]
size:80B svc=[{quickstart java lima-ubuntu-lts-5074}] traceparent=[00-46214bd23716280eef43cf798dbe5522-0000000000000000-01]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The above trace shows:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;2024-01-09 10:31:33.19103133&lt;/code&gt;: time of the trace&lt;/li&gt;
&lt;li&gt;&lt;code&gt;(3.254486ms[3.254486ms])&lt;/code&gt;: total response time for the request&lt;/li&gt;
&lt;li&gt;&lt;code&gt;200 GET /foo&lt;/code&gt;: response code, HTTP method, and URL path&lt;/li&gt;
&lt;li&gt;&lt;code&gt;[127.0.0.1]-&amp;gt;[127.0.0.1:8080]&lt;/code&gt; source and destination &lt;code&gt;host:port&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;size:80B&lt;/code&gt;: size of the HTTP request (sum of the headers and the body)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;svc=[{quickstart java lima-ubuntu-lts-5074}]&lt;/code&gt;: &lt;code&gt;quickstart&lt;/code&gt; service, running in a &lt;code&gt;java&lt;/code&gt; VM, with an automatically created service instance name &lt;code&gt;lima-ubuntu-lts-5074&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;traceparent&lt;/code&gt; as received by the parent request, or a new random one if the parent request didn&amp;rsquo;t specify it&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;After a few minutes traces will appear in Grafana Cloud. For example, in the traces explorer:&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/quickstart/trace-generic.png&#34;
  alt=&#34;Beyla traces explorer&#34; width=&#34;1298&#34;
     height=&#34;1134&#34;/&gt;&lt;/p&gt;
&lt;h2 id=&#34;6-configure-routing&#34;&gt;6. Configure routing&lt;/h2&gt;
&lt;p&gt;The exposed span name in Grafana Cloud is a generic &lt;code&gt;GET /**&lt;/code&gt;, where it should say something like &lt;code&gt;GET /foo&lt;/code&gt; (the path of the
test request URL).&lt;/p&gt;
&lt;p&gt;Beyla groups any unknown URL path as &lt;code&gt;/**&lt;/code&gt; to avoid unexpected cardinality explosions.&lt;/p&gt;
&lt;p&gt;Configure routing to tell Beyla about expected routes.&lt;/p&gt;
&lt;p&gt;For this quickstart, let Beyla to heuristically group the routes.&lt;/p&gt;
&lt;p&gt;First, create a &lt;code&gt;config.yml&lt;/code&gt; file with the following content:&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;yml&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-yml&#34;&gt;routes:
  unmatched: heuristic&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Then, run Beyla with the &lt;code&gt;-config&lt;/code&gt; argument:&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;sudo -E beyla -config config.yml&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Finally, make HTTP requests:&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;curl http://localhost:8080/foo
curl http://localhost:8080/user/1234
curl http://localhost:8080/user/5678&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Grafana will now heuristically assign a route to each trace. &lt;code&gt;/foo&lt;/code&gt; got its own route while &lt;code&gt;/user/1234&lt;/code&gt; and
&lt;code&gt;/user/5678&lt;/code&gt; were grouped into the &lt;code&gt;/user/*&lt;/code&gt; route.&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/quickstart/grouped-traces.png&#34;
  alt=&#34;Beyla grouped traces&#34; width=&#34;1476&#34;
     height=&#34;346&#34;/&gt;&lt;/p&gt;
&lt;h2 id=&#34;next-steps&#34;&gt;Next steps&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Get more details of the different &lt;a href=&#34;../../configure/&#34;&gt;Beyla configuration options&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Learn how to deploy Beyla as a &lt;a href=&#34;../../setup/docker/&#34;&gt;Docker container&lt;/a&gt; or as a &lt;a href=&#34;../../setup/kubernetes/&#34;&gt;Kubernetes DaemonSet or sidecar&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="quickstart-instrument-a-java-service-with-beyla">Quickstart: instrument a Java service with Beyla&lt;/h1>
&lt;h2 id="1-run-an-instrumentable-java-service">1. Run an instrumentable Java service&lt;/h2>
&lt;p>Run an instrumentable Java service or download and run a simple example &lt;a href="https://github.com/grafana/beyla/tree/main/examples/quickstart/java" target="_blank" rel="noopener noreferrer">Java HTTP service&lt;/a>.&lt;/p></description></item><item><title>Quickstart: instrument a Node.js service with Beyla</title><link>https://grafana.com/docs/beyla/v1.5.x/quickstart/nodejs/</link><pubDate>Mon, 16 Mar 2026 19:38:33 +0000</pubDate><guid>https://grafana.com/docs/beyla/v1.5.x/quickstart/nodejs/</guid><content><![CDATA[&lt;h1 id=&#34;quickstart-instrument-a-nodejs-service-with-beyla&#34;&gt;Quickstart: instrument a Node.js service with Beyla&lt;/h1&gt;
&lt;h2 id=&#34;1-run-an-instrumentable-nodejs-service&#34;&gt;1. Run an instrumentable Node.js service&lt;/h2&gt;
&lt;p&gt;Run an instrumentable Node.js service or download and run a simple example &lt;a href=&#34;https://github.com/grafana/beyla/tree/main/examples/quickstart/nodejs&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Node.js HTTP service&lt;/a&gt;.&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;curl -OL https://raw.githubusercontent.com/grafana/beyla/main/examples/quickstart/nodejs/package.json
curl -OL https://raw.githubusercontent.com/grafana/beyla/main/examples/quickstart/nodejs/quickstart.js
npm install &amp;amp;&amp;amp; npm start&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;2-download-beyla&#34;&gt;2. Download Beyla&lt;/h2&gt;
&lt;p&gt;Download the latest Beyla executable from the &lt;a href=&#34;https://github.com/grafana/beyla/releases&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Beyla releases page&lt;/a&gt;.
Uncompress and copy the Beyla executable to any location in your &lt;code&gt;$PATH&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&#34;3-optional-get-grafana-cloud-credentials&#34;&gt;3. (Optional) get Grafana Cloud credentials&lt;/h2&gt;
&lt;p&gt;Beyla can export metrics and traces to any OpenTelemetry endpoint, as well as exposing metrics as a Prometheus endpoint. However, we recommend using the OpenTelemetry endpoint in Grafana Cloud. You can get a &lt;a href=&#34;/pricing/&#34;&gt;Free Grafana Cloud Account at Grafana&amp;rsquo;s website&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;From the Grafana Cloud Portal, look for the &lt;strong&gt;OpenTelemetry&lt;/strong&gt; box and click &lt;strong&gt;Configure&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/quickstart/otel-cloud-portal-box.png&#34;
  alt=&#34;OpenTelemetry Grafana Cloud portal&#34; width=&#34;1002&#34;
     height=&#34;312&#34;/&gt;&lt;/p&gt;
&lt;p&gt;Under &lt;strong&gt;Password / API token&lt;/strong&gt; click &lt;strong&gt;Generate now&lt;/strong&gt; and follow the instructions to create a default API token.&lt;/p&gt;
&lt;p&gt;The &lt;strong&gt;Environment Variables&lt;/strong&gt; will be populated with a set of standard OpenTelemetry environment variables which will provide the connection endpoint and credentials information for Beyla.&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/quickstart/otlp-connection-headers.png&#34;
  alt=&#34;OTLP connection headers&#34; width=&#34;1592&#34;
     height=&#34;998&#34;/&gt;&lt;/p&gt;
&lt;p&gt;Copy the &lt;strong&gt;Environment Variables&lt;/strong&gt; and keep it for the next step.&lt;/p&gt;
&lt;h2 id=&#34;4-run-beyla-with-minimal-configuration&#34;&gt;4. Run Beyla with minimal configuration&lt;/h2&gt;
&lt;p&gt;To run Beyla, first set the following environment variables:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;OTEL_EXPORTER_OTLP_PROTOCOL&lt;/code&gt;, &lt;code&gt;OTEL_EXPORTER_OTLP_ENDPOINT&lt;/code&gt; and &lt;code&gt;OTEL_EXPORTER_OTLP_HEADERS&lt;/code&gt;
variables copied from the previous step.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;BEYLA_OPEN_PORT&lt;/code&gt;: the port the instrumented service is using
(for example, &lt;code&gt;80&lt;/code&gt; or &lt;code&gt;443&lt;/code&gt;). If using the example service in the
first section of this guide, set this variable to &lt;code&gt;8080&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To facilitate local testing, set the &lt;code&gt;BEYLA_PRINT_TRACES=true&lt;/code&gt; environment variable. This will cause Beyla to print traces to standard output.&lt;/p&gt;
&lt;p&gt;Also set the &lt;code&gt;BEYLA_SERVICE_NAME=quickstart&lt;/code&gt; to override the reported service
name in the traces and metrics. If it is not set, Beyla would automatically
report the name of the process executable: &lt;code&gt;node&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Notice: Beyla requires administrative (sudo) privileges, or at least it needs to be granted the &lt;code&gt;CAP_SYS_ADMIN&lt;/code&gt; capability.&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_SERVICE_NAME=quickstart
export BEYLA_OPEN_PORT=8080
export BEYLA_PRINT_TRACES=true
export OTEL_EXPORTER_OTLP_PROTOCOL=&amp;#34;http/protobuf&amp;#34;
export OTEL_EXPORTER_OTLP_ENDPOINT=&amp;#34;https://otlp-gateway-prod-eu-west-0.grafana.net/otlp&amp;#34;
export OTEL_EXPORTER_OTLP_HEADERS=&amp;#34;Authorization=Basic ...your-encoded-credentials...&amp;#34;
sudo -E beyla&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;5-test-the-service&#34;&gt;5. Test the service&lt;/h2&gt;
&lt;p&gt;With Beyla and the service running, make HTTP requests to the instrumented service:&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;curl http://localhost:8080/foo&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Beyla should output traces to the standard output similar to this:&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;2024-01-09 10:31:33.19103133 (3.254486ms[3.254486ms]) 200 GET /foo [127.0.0.1]-&amp;gt;[127.0.0.1:8080]
size:80B svc=[{quickstart nodejs lima-ubuntu-lts-5074}] traceparent=[00-46214bd23716280eef43cf798dbe5522-0000000000000000-01]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The above trace shows:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;2024-01-09 10:31:33.19103133&lt;/code&gt;: time of the trace&lt;/li&gt;
&lt;li&gt;&lt;code&gt;(3.254486ms[3.254486ms])&lt;/code&gt;: total response time for the request&lt;/li&gt;
&lt;li&gt;&lt;code&gt;200 GET /foo&lt;/code&gt;: response code, HTTP method, and URL path&lt;/li&gt;
&lt;li&gt;&lt;code&gt;[127.0.0.1]-&amp;gt;[127.0.0.1:8080]&lt;/code&gt; source and destination host:port&lt;/li&gt;
&lt;li&gt;&lt;code&gt;size:80B&lt;/code&gt;: size of the HTTP request (sum of the headers and the body)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;svc=[{quickstart nodejs lima-ubuntu-lts-5074}]&lt;/code&gt;: &lt;code&gt;quickstart&lt;/code&gt; service, running in
Node.js, with an automatically created service instance name
&lt;code&gt;lima-ubuntu-lts-5074&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;traceparent&lt;/code&gt; as received by the parent request, or a new random one if the parent request
didn&amp;rsquo;t specify it&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;After a few minutes traces will appear in Grafana Cloud. For example, in the traces explorer:&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/quickstart/trace-generic.png&#34;
  alt=&#34;Beyla traces explorer&#34; width=&#34;1298&#34;
     height=&#34;1134&#34;/&gt;&lt;/p&gt;
&lt;h2 id=&#34;6-configure-routing&#34;&gt;6. Configure routing&lt;/h2&gt;
&lt;p&gt;The exposed span name in Grafana Cloud is a generic &lt;code&gt;GET /**&lt;/code&gt;, where it should say something like &lt;code&gt;GET /foo&lt;/code&gt; (the path of the
test request URL).&lt;/p&gt;
&lt;p&gt;Beyla groups any unknown URL path as &lt;code&gt;/**&lt;/code&gt; to avoid unexpected cardinality explosions.&lt;/p&gt;
&lt;p&gt;Configure routing to tell Beyla about expected routes.&lt;/p&gt;
&lt;p&gt;For this quickstart, let Beyla to heuristically group the routes.&lt;/p&gt;
&lt;p&gt;First, create a &lt;code&gt;config.yml&lt;/code&gt; file with the following content:&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;yml&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-yml&#34;&gt;routes:
  unmatched: heuristic&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Then, run Beyla with the &lt;code&gt;-config&lt;/code&gt; argument (or use the &lt;code&gt;BEYLA_CONFIG_PATH&lt;/code&gt; environment variable instead):&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;sudo -E beyla -config config.yml&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Finally, make HTTP requests:&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;curl http://localhost:8080/foo
curl http://localhost:8080/user/1234
curl http://localhost:8080/user/5678&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Grafana will now heuristically assign a route to each trace. &lt;code&gt;/foo&lt;/code&gt; got its own route while &lt;code&gt;/user/1234&lt;/code&gt; and
&lt;code&gt;/user/5678&lt;/code&gt; were grouped into the &lt;code&gt;/user/*&lt;/code&gt; route.&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/quickstart/grouped-traces.png&#34;
  alt=&#34;Beyla grouped traces&#34; width=&#34;1476&#34;
     height=&#34;346&#34;/&gt;&lt;/p&gt;
&lt;h2 id=&#34;next-steps&#34;&gt;Next steps&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Get more details of the different &lt;a href=&#34;../../configure/&#34;&gt;Beyla configuration options&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Learn how to deploy Beyla as a &lt;a href=&#34;../../setup/docker/&#34;&gt;Docker container&lt;/a&gt; or as a &lt;a href=&#34;../../setup/kubernetes/&#34;&gt;Kubernetes DaemonSet or sidecar&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="quickstart-instrument-a-nodejs-service-with-beyla">Quickstart: instrument a Node.js service with Beyla&lt;/h1>
&lt;h2 id="1-run-an-instrumentable-nodejs-service">1. Run an instrumentable Node.js service&lt;/h2>
&lt;p>Run an instrumentable Node.js service or download and run a simple example &lt;a href="https://github.com/grafana/beyla/tree/main/examples/quickstart/nodejs" target="_blank" rel="noopener noreferrer">Node.js HTTP service&lt;/a>.&lt;/p></description></item><item><title>Quickstart: instrument a Python service with Beyla</title><link>https://grafana.com/docs/beyla/v1.5.x/quickstart/python/</link><pubDate>Mon, 16 Mar 2026 19:38:33 +0000</pubDate><guid>https://grafana.com/docs/beyla/v1.5.x/quickstart/python/</guid><content><![CDATA[&lt;h1 id=&#34;quickstart-instrument-a-python-service-with-beyla&#34;&gt;Quickstart: instrument a Python service with Beyla&lt;/h1&gt;
&lt;h2 id=&#34;1-run-an-instrumentable-python-service&#34;&gt;1. Run an instrumentable Python service&lt;/h2&gt;
&lt;p&gt;Run an instrumentable Python service or download and run a simple example &lt;a href=&#34;https://github.com/grafana/beyla/tree/main/examples/quickstart/python&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Python HTTP service&lt;/a&gt;.&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;curl -OL https://raw.githubusercontent.com/grafana/beyla/main/examples/quickstart/python/quickstart.py
python3 quickstart.py&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;2-download-beyla&#34;&gt;2. Download Beyla&lt;/h2&gt;
&lt;p&gt;Download the latest Beyla executable from the &lt;a href=&#34;https://github.com/grafana/beyla/releases&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Beyla releases page&lt;/a&gt;.
Uncompress and copy the Beyla executable to any location in your &lt;code&gt;$PATH&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&#34;3-optional-get-grafana-cloud-credentials&#34;&gt;3. (Optional) get Grafana Cloud credentials&lt;/h2&gt;
&lt;p&gt;Beyla can export metrics and traces to any OpenTelemetry endpoint, as well as exposing metrics as a Prometheus endpoint. However, we recommend using the OpenTelemetry endpoint in Grafana Cloud. You can get a &lt;a href=&#34;/pricing/&#34;&gt;Free Grafana Cloud Account at Grafana&amp;rsquo;s website&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;From the Grafana Cloud Portal, look for the &lt;strong&gt;OpenTelemetry&lt;/strong&gt; box and click &lt;strong&gt;Configure&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/quickstart/otel-cloud-portal-box.png&#34;
  alt=&#34;OpenTelemetry Grafana Cloud portal&#34; width=&#34;1002&#34;
     height=&#34;312&#34;/&gt;&lt;/p&gt;
&lt;p&gt;Under &lt;strong&gt;Password / API token&lt;/strong&gt; click &lt;strong&gt;Generate now&lt;/strong&gt; and follow the instructions to create a default API token.&lt;/p&gt;
&lt;p&gt;The &lt;strong&gt;Environment Variables&lt;/strong&gt; will be populated with a set of standard OpenTelemetry environment variables which will provide the connection endpoint and credentials information for Beyla.&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/quickstart/otlp-connection-headers.png&#34;
  alt=&#34;OTLP connection headers&#34; width=&#34;1592&#34;
     height=&#34;998&#34;/&gt;&lt;/p&gt;
&lt;p&gt;Copy the &lt;strong&gt;Environment Variables&lt;/strong&gt; and keep it for the next step.&lt;/p&gt;
&lt;h2 id=&#34;4-run-beyla-with-minimal-configuration&#34;&gt;4. Run Beyla with minimal configuration&lt;/h2&gt;
&lt;p&gt;To run Beyla, first set the following environment variables:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;OTEL_EXPORTER_OTLP_PROTOCOL&lt;/code&gt;, &lt;code&gt;OTEL_EXPORTER_OTLP_ENDPOINT&lt;/code&gt; and &lt;code&gt;OTEL_EXPORTER_OTLP_HEADERS&lt;/code&gt;
variables copied from the previous step.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;BEYLA_OPEN_PORT&lt;/code&gt;: the port the instrumented service is using
(for example, &lt;code&gt;80&lt;/code&gt; or &lt;code&gt;443&lt;/code&gt;). If using the example service in the
first section of this guide, set this variable to &lt;code&gt;8080&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To facilitate local testing, set the &lt;code&gt;BEYLA_PRINT_TRACES=true&lt;/code&gt; environment variable. This will cause Beyla to print traces to standard output.&lt;/p&gt;
&lt;p&gt;Also set the &lt;code&gt;BEYLA_SERVICE_NAME=quickstart&lt;/code&gt; to override the reported service
name in the traces and metrics. If it is not set, Beyla would automatically
report the name of the process executable: &lt;code&gt;python3&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Notice: Beyla requires administrative (sudo) privileges, or at least it needs to be granted the &lt;code&gt;CAP_SYS_ADMIN&lt;/code&gt; capability.&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_SERVICE_NAME=quickstart
export BEYLA_OPEN_PORT=8080
export BEYLA_PRINT_TRACES=true
export OTEL_EXPORTER_OTLP_PROTOCOL=&amp;#34;http/protobuf&amp;#34;
export OTEL_EXPORTER_OTLP_ENDPOINT=&amp;#34;https://otlp-gateway-prod-eu-west-0.grafana.net/otlp&amp;#34;
export OTEL_EXPORTER_OTLP_HEADERS=&amp;#34;Authorization=Basic ...your-encoded-credentials...&amp;#34;
sudo -E beyla&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;5-test-the-service&#34;&gt;5. Test the service&lt;/h2&gt;
&lt;p&gt;With Beyla and the service running, make HTTP requests to the instrumented service:&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;curl http://localhost:8080/foo&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Beyla should output traces to the standard output similar to this:&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;2024-01-09 10:31:33.19103133 (3.254486ms[3.254486ms]) 200 GET /foo [127.0.0.1]-&amp;gt;[127.0.0.1:8080]
size:80B svc=[{quickstart python lima-ubuntu-lts-5074}] traceparent=[00-46214bd23716280eef43cf798dbe5522-0000000000000000-01]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The above trace shows:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;2024-01-09 10:31:33.19103133&lt;/code&gt;: time of the trace&lt;/li&gt;
&lt;li&gt;&lt;code&gt;(3.254486ms[3.254486ms])&lt;/code&gt;: total response time for the request&lt;/li&gt;
&lt;li&gt;&lt;code&gt;200 GET /foo&lt;/code&gt;: response code, HTTP method, and URL path&lt;/li&gt;
&lt;li&gt;&lt;code&gt;[127.0.0.1]-&amp;gt;[127.0.0.1:8080]&lt;/code&gt; source and destination host:port&lt;/li&gt;
&lt;li&gt;&lt;code&gt;size:80B&lt;/code&gt;: size of the HTTP request (sum of the headers and the body)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;svc=[{quickstart python lima-ubuntu-lts-5074}]&lt;/code&gt;: &lt;code&gt;quickstart&lt;/code&gt; service, running in
Python, with an automatically created service instance name
&lt;code&gt;lima-ubuntu-lts-5074&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;traceparent&lt;/code&gt; as received by the parent request, or a new random one if the parent request
didn&amp;rsquo;t specify it&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;After a few minutes traces will appear in Grafana Cloud. For example, in the traces explorer:&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/quickstart/trace-generic.png&#34;
  alt=&#34;Beyla traces explorer&#34; width=&#34;1298&#34;
     height=&#34;1134&#34;/&gt;&lt;/p&gt;
&lt;h2 id=&#34;6-configure-routing&#34;&gt;6. Configure routing&lt;/h2&gt;
&lt;p&gt;The exposed span name in Grafana Cloud is a generic &lt;code&gt;GET /**&lt;/code&gt;, where it should say something like &lt;code&gt;GET /foo&lt;/code&gt; (the path of the
test request URL).&lt;/p&gt;
&lt;p&gt;Beyla groups any unknown URL path as &lt;code&gt;/**&lt;/code&gt; to avoid unexpected cardinality explosions.&lt;/p&gt;
&lt;p&gt;Configure routing to tell Beyla about expected routes.&lt;/p&gt;
&lt;p&gt;For this quickstart, let Beyla to heuristically group the routes.&lt;/p&gt;
&lt;p&gt;First, create a &lt;code&gt;config.yml&lt;/code&gt; file with the following content:&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;yml&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-yml&#34;&gt;routes:
  unmatched: heuristic&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Then, run Beyla with the &lt;code&gt;-config&lt;/code&gt; argument (or use the &lt;code&gt;BEYLA_CONFIG_PATH&lt;/code&gt; environment variable instead):&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;sudo -E beyla -config config.yml&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Finally, make HTTP requests:&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;curl http://localhost:8080/foo
curl http://localhost:8080/user/1234
curl http://localhost:8080/user/5678&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Grafana will now heuristically assign a route to each trace. &lt;code&gt;/foo&lt;/code&gt; got its own route while &lt;code&gt;/user/1234&lt;/code&gt; and
&lt;code&gt;/user/5678&lt;/code&gt; were grouped into the &lt;code&gt;/user/*&lt;/code&gt; route.&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/quickstart/grouped-traces.png&#34;
  alt=&#34;Beyla grouped traces&#34; width=&#34;1476&#34;
     height=&#34;346&#34;/&gt;&lt;/p&gt;
&lt;h2 id=&#34;next-steps&#34;&gt;Next steps&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Get more details of the different &lt;a href=&#34;../../configure/&#34;&gt;Beyla configuration options&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Learn how to deploy Beyla as a &lt;a href=&#34;../../setup/docker/&#34;&gt;Docker container&lt;/a&gt; or as a &lt;a href=&#34;../../setup/kubernetes/&#34;&gt;Kubernetes DaemonSet or sidecar&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="quickstart-instrument-a-python-service-with-beyla">Quickstart: instrument a Python service with Beyla&lt;/h1>
&lt;h2 id="1-run-an-instrumentable-python-service">1. Run an instrumentable Python service&lt;/h2>
&lt;p>Run an instrumentable Python service or download and run a simple example &lt;a href="https://github.com/grafana/beyla/tree/main/examples/quickstart/python" target="_blank" rel="noopener noreferrer">Python HTTP service&lt;/a>.&lt;/p></description></item><item><title>Quickstart: instrument a Ruby service with Beyla</title><link>https://grafana.com/docs/beyla/v1.5.x/quickstart/ruby/</link><pubDate>Mon, 16 Mar 2026 19:38:33 +0000</pubDate><guid>https://grafana.com/docs/beyla/v1.5.x/quickstart/ruby/</guid><content><![CDATA[&lt;h1 id=&#34;quickstart-instrument-a-ruby-service-with-beyla&#34;&gt;Quickstart: instrument a Ruby service with Beyla&lt;/h1&gt;
&lt;h2 id=&#34;1-run-an-instrumentable-ruby-service&#34;&gt;1. Run an instrumentable Ruby service&lt;/h2&gt;
&lt;p&gt;Run an instrumentable Ruby service or download and run a simple example &lt;a href=&#34;https://github.com/grafana/beyla/tree/main/examples/quickstart/ruby&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Ruby HTTP service&lt;/a&gt;.&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;curl -OL https://raw.githubusercontent.com/grafana/beyla/main/examples/quickstart/ruby/quickstart.rb
ruby quickstart.rb&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;2-download-beyla&#34;&gt;2. Download Beyla&lt;/h2&gt;
&lt;p&gt;Download the latest Beyla executable from the &lt;a href=&#34;https://github.com/grafana/beyla/releases&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Beyla releases page&lt;/a&gt;.
Uncompress and copy the Beyla executable to any location in your &lt;code&gt;$PATH&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&#34;3-optional-get-grafana-cloud-credentials&#34;&gt;3. (Optional) get Grafana Cloud credentials&lt;/h2&gt;
&lt;p&gt;Beyla can export metrics and traces to any OpenTelemetry endpoint, as well as exposing metrics as a Prometheus endpoint. However, we recommend using the OpenTelemetry endpoint in Grafana Cloud. You can get a &lt;a href=&#34;/pricing/&#34;&gt;Free Grafana Cloud Account at Grafana&amp;rsquo;s website&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;From the Grafana Cloud Portal, look for the &lt;strong&gt;OpenTelemetry&lt;/strong&gt; box and click &lt;strong&gt;Configure&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/quickstart/otel-cloud-portal-box.png&#34;
  alt=&#34;OpenTelemetry Grafana Cloud portal&#34; width=&#34;1002&#34;
     height=&#34;312&#34;/&gt;&lt;/p&gt;
&lt;p&gt;Under &lt;strong&gt;Password / API token&lt;/strong&gt; click &lt;strong&gt;Generate now&lt;/strong&gt; and follow the instructions to create a default API token.&lt;/p&gt;
&lt;p&gt;The &lt;strong&gt;Environment Variables&lt;/strong&gt; will be populated with a set of standard OpenTelemetry environment variables which will provide the connection endpoint and credentials information for Beyla.&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/quickstart/otlp-connection-headers.png&#34;
  alt=&#34;OTLP connection headers&#34; width=&#34;1592&#34;
     height=&#34;998&#34;/&gt;&lt;/p&gt;
&lt;p&gt;Copy the &lt;strong&gt;Environment Variables&lt;/strong&gt; and keep it for the next step.&lt;/p&gt;
&lt;h2 id=&#34;4-run-beyla-with-minimal-configuration&#34;&gt;4. Run Beyla with minimal configuration&lt;/h2&gt;
&lt;p&gt;To run Beyla, first set the following environment variables:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;OTEL_EXPORTER_OTLP_PROTOCOL&lt;/code&gt;, &lt;code&gt;OTEL_EXPORTER_OTLP_ENDPOINT&lt;/code&gt; and &lt;code&gt;OTEL_EXPORTER_OTLP_HEADERS&lt;/code&gt;
variables copied from the previous step.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;BEYLA_OPEN_PORT&lt;/code&gt;: the port the instrumented service is using
(for example, &lt;code&gt;80&lt;/code&gt; or &lt;code&gt;443&lt;/code&gt;). If using the example service in the
first section of this guide, set this variable to &lt;code&gt;8080&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To facilitate local testing, set the &lt;code&gt;BEYLA_PRINT_TRACES=true&lt;/code&gt; environment variable. This will cause Beyla to print traces to standard output.&lt;/p&gt;
&lt;p&gt;Also set the &lt;code&gt;BEYLA_SERVICE_NAME=quickstart&lt;/code&gt; to override the reported service
name in the traces and metrics. If it is not set, Beyla would automatically
report the name of the process executable: &lt;code&gt;ruby&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Notice: Beyla requires administrative (sudo) privileges, or at least it needs to be granted the &lt;code&gt;CAP_SYS_ADMIN&lt;/code&gt; capability.&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_SERVICE_NAME=quickstart
export BEYLA_OPEN_PORT=8080
export BEYLA_PRINT_TRACES=true
export OTEL_EXPORTER_OTLP_PROTOCOL=&amp;#34;http/protobuf&amp;#34;
export OTEL_EXPORTER_OTLP_ENDPOINT=&amp;#34;https://otlp-gateway-prod-eu-west-0.grafana.net/otlp&amp;#34;
export OTEL_EXPORTER_OTLP_HEADERS=&amp;#34;Authorization=Basic ...your-encoded-credentials...&amp;#34;
sudo -E beyla&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;5-test-the-service&#34;&gt;5. Test the service&lt;/h2&gt;
&lt;p&gt;With Beyla and the service running, make HTTP requests to the instrumented service:&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;curl http://localhost:8080/foo&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Beyla should output traces to the standard output similar to this:&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;2024-01-09 10:31:33.19103133 (3.254486ms[3.254486ms]) 200 GET /foo [127.0.0.1]-&amp;gt;[127.0.0.1:8080]
size:80B svc=[{quickstart ruby lima-ubuntu-lts-5074}] traceparent=[00-46214bd23716280eef43cf798dbe5522-0000000000000000-01]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The above trace shows:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;2024-01-09 10:31:33.19103133&lt;/code&gt;: time of the trace&lt;/li&gt;
&lt;li&gt;&lt;code&gt;(3.254486ms[3.254486ms])&lt;/code&gt;: total response time for the request&lt;/li&gt;
&lt;li&gt;&lt;code&gt;200 GET /foo&lt;/code&gt;: response code, HTTP method, and URL path&lt;/li&gt;
&lt;li&gt;&lt;code&gt;[127.0.0.1]-&amp;gt;[127.0.0.1:8080]&lt;/code&gt; source and destination host:port&lt;/li&gt;
&lt;li&gt;&lt;code&gt;size:80B&lt;/code&gt;: size of the HTTP request (sum of the headers and the body)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;svc=[{quickstart ruby lima-ubuntu-lts-5074}]&lt;/code&gt;: &lt;code&gt;quickstart&lt;/code&gt; service, running in
Ruby, with an automatically created service instance name
&lt;code&gt;lima-ubuntu-lts-5074&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;traceparent&lt;/code&gt; as received by the parent request, or a new random one if the parent request
didn&amp;rsquo;t specify it&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;After a few minutes traces will appear in Grafana Cloud. For example, in the traces explorer:&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/quickstart/trace-generic.png&#34;
  alt=&#34;Beyla traces explorer&#34; width=&#34;1298&#34;
     height=&#34;1134&#34;/&gt;&lt;/p&gt;
&lt;h2 id=&#34;6-configure-routing&#34;&gt;6. Configure routing&lt;/h2&gt;
&lt;p&gt;The exposed span name in Grafana Cloud is a generic &lt;code&gt;GET /**&lt;/code&gt;, where it should say something like &lt;code&gt;GET /foo&lt;/code&gt; (the path of the
test request URL).&lt;/p&gt;
&lt;p&gt;Beyla groups any unknown URL path as &lt;code&gt;/**&lt;/code&gt; to avoid unexpected cardinality explosions.&lt;/p&gt;
&lt;p&gt;Configure routing to tell Beyla about expected routes.&lt;/p&gt;
&lt;p&gt;For this quickstart, let Beyla to heuristically group the routes.&lt;/p&gt;
&lt;p&gt;First, create a &lt;code&gt;config.yml&lt;/code&gt; file with the following content:&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;yml&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-yml&#34;&gt;routes:
  unmatched: heuristic&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Then, run Beyla with the &lt;code&gt;-config&lt;/code&gt; argument (or use the &lt;code&gt;BEYLA_CONFIG_PATH&lt;/code&gt; environment variable instead):&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;sudo -E beyla -config config.yml&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Finally, make HTTP requests:&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;curl http://localhost:8080/foo
curl http://localhost:8080/user/1234
curl http://localhost:8080/user/5678&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Grafana will now heuristically assign a route to each trace. &lt;code&gt;/foo&lt;/code&gt; got its own route while &lt;code&gt;/user/1234&lt;/code&gt; and
&lt;code&gt;/user/5678&lt;/code&gt; were grouped into the &lt;code&gt;/user/*&lt;/code&gt; route.&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/quickstart/grouped-traces.png&#34;
  alt=&#34;Beyla grouped traces&#34; width=&#34;1476&#34;
     height=&#34;346&#34;/&gt;&lt;/p&gt;
&lt;h2 id=&#34;next-steps&#34;&gt;Next steps&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Get more details of the different &lt;a href=&#34;../../configure/&#34;&gt;Beyla configuration options&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Learn how to deploy Beyla as a &lt;a href=&#34;../../setup/docker/&#34;&gt;Docker container&lt;/a&gt; or as a &lt;a href=&#34;../../setup/kubernetes/&#34;&gt;Kubernetes DaemonSet or sidecar&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="quickstart-instrument-a-ruby-service-with-beyla">Quickstart: instrument a Ruby service with Beyla&lt;/h1>
&lt;h2 id="1-run-an-instrumentable-ruby-service">1. Run an instrumentable Ruby service&lt;/h2>
&lt;p>Run an instrumentable Ruby service or download and run a simple example &lt;a href="https://github.com/grafana/beyla/tree/main/examples/quickstart/ruby" target="_blank" rel="noopener noreferrer">Ruby HTTP service&lt;/a>.&lt;/p></description></item><item><title>Quickstart: instrument a Rust service with Beyla</title><link>https://grafana.com/docs/beyla/v1.5.x/quickstart/rust/</link><pubDate>Mon, 16 Mar 2026 19:38:33 +0000</pubDate><guid>https://grafana.com/docs/beyla/v1.5.x/quickstart/rust/</guid><content><![CDATA[&lt;h1 id=&#34;quickstart-instrument-a-rust-service-with-beyla&#34;&gt;Quickstart: instrument a Rust service with Beyla&lt;/h1&gt;
&lt;h2 id=&#34;1-run-an-instrumentable-rust-service&#34;&gt;1. Run an instrumentable Rust service&lt;/h2&gt;
&lt;p&gt;Run an instrumentable Rust service or download and run a simple example &lt;a href=&#34;https://github.com/grafana/beyla/tree/main/examples/quickstart/rust&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Rust HTTP service&lt;/a&gt;.&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;curl -OL https://raw.githubusercontent.com/grafana/beyla/main/examples/quickstart/rust/quickstart.rs
rustc quickstart.rs &amp;amp;&amp;amp; ./quickstart&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;2-download-beyla&#34;&gt;2. Download Beyla&lt;/h2&gt;
&lt;p&gt;Download the latest Beyla executable from the &lt;a href=&#34;https://github.com/grafana/beyla/releases&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Beyla releases page&lt;/a&gt;. Uncompress and copy the Beyla executable to any location in your &lt;code&gt;$PATH&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&#34;3-optional-get-grafana-cloud-credentials&#34;&gt;3. (Optional) get Grafana Cloud credentials&lt;/h2&gt;
&lt;p&gt;Beyla can export metrics and traces to any OpenTelemetry endpoint, as well as exposing metrics as a Prometheus endpoint. However, we recommend using the OpenTelemetry endpoint in Grafana Cloud. You can get a &lt;a href=&#34;/pricing/&#34;&gt;Free Grafana Cloud Account at Grafana&amp;rsquo;s website&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;From the Grafana Cloud Portal, look for the &lt;strong&gt;OpenTelemetry&lt;/strong&gt; box and click &lt;strong&gt;Configure&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/quickstart/otel-cloud-portal-box.png&#34;
  alt=&#34;OpenTelemetry Grafana Cloud portal&#34; width=&#34;1002&#34;
     height=&#34;312&#34;/&gt;&lt;/p&gt;
&lt;p&gt;Under &lt;strong&gt;Password / API token&lt;/strong&gt; click &lt;strong&gt;Generate now&lt;/strong&gt; and follow the instructions to create a default API token.&lt;/p&gt;
&lt;p&gt;The &lt;strong&gt;Environment Variables&lt;/strong&gt; will be populated with a set of standard OpenTelemetry environment variables which will provide the connection endpoint and credentials information for Beyla.&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/quickstart/otlp-connection-headers.png&#34;
  alt=&#34;OTLP connection headers&#34; width=&#34;1592&#34;
     height=&#34;998&#34;/&gt;&lt;/p&gt;
&lt;p&gt;Copy the &lt;strong&gt;Environment Variables&lt;/strong&gt; and keep it for the next step.&lt;/p&gt;
&lt;h2 id=&#34;4-run-beyla-with-minimal-configuration&#34;&gt;4. Run Beyla with minimal configuration&lt;/h2&gt;
&lt;p&gt;To run Beyla, first set the following environment variables:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;OTEL_EXPORTER_OTLP_PROTOCOL&lt;/code&gt;, &lt;code&gt;OTEL_EXPORTER_OTLP_ENDPOINT&lt;/code&gt; and &lt;code&gt;OTEL_EXPORTER_OTLP_HEADERS&lt;/code&gt; variables copied from the previous step.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;BEYLA_OPEN_PORT&lt;/code&gt;: the port the instrumented service is using (for example, &lt;code&gt;80&lt;/code&gt; or &lt;code&gt;443&lt;/code&gt;). If using the example service in the first section of this guide, set this variable to &lt;code&gt;8080&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To facilitate local testing, set the &lt;code&gt;BEYLA_PRINT_TRACES=true&lt;/code&gt; environment variable. This causes Beyla to print traces to the standard output.&lt;/p&gt;
&lt;p&gt;Notice: Beyla requires administrative (sudo) privileges, or at least it needs to be granted the &lt;code&gt;CAP_SYS_ADMIN&lt;/code&gt; capability.&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_OPEN_PORT=8080
export BEYLA_PRINT_TRACES=true
export OTEL_EXPORTER_OTLP_PROTOCOL=&amp;#34;http/protobuf&amp;#34;
export OTEL_EXPORTER_OTLP_ENDPOINT=&amp;#34;https://otlp-gateway-prod-eu-west-0.grafana.net/otlp&amp;#34;
export OTEL_EXPORTER_OTLP_HEADERS=&amp;#34;Authorization=Basic ...your-encoded-credentials...&amp;#34;
sudo -E beyla&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;5-test-the-service&#34;&gt;5. Test the service&lt;/h2&gt;
&lt;p&gt;With Beyla and the service running, make HTTP requests to the instrumented service:&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;curl http://localhost:8080/foo&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Beyla should output traces to the standard output similar to this:&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;2024-01-09 10:31:33.19103133 (3.254486ms[3.254486ms]) 200 GET /foo [127.0.0.1]-&amp;gt;[127.0.0.1:8080]
size:80B svc=[{quickstart  rust lima-ubuntu-lts-5074}] traceparent=[00-46214bd23716280eef43cf798dbe5522-0000000000000000-01]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The above trace shows:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;2024-01-09 10:31:33.19103133&lt;/code&gt;: time of the trace&lt;/li&gt;
&lt;li&gt;&lt;code&gt;(3.254486ms[3.254486ms])&lt;/code&gt;: total response time for the request&lt;/li&gt;
&lt;li&gt;&lt;code&gt;200 GET /foo&lt;/code&gt;: response code, HTTP method, and URL path&lt;/li&gt;
&lt;li&gt;&lt;code&gt;[127.0.0.1]-&amp;gt;[127.0.0.1:8080]&lt;/code&gt; source and destination &lt;code&gt;host:port&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;size:80B&lt;/code&gt;: size of the HTTP request (sum of the headers and the body)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;svc=[{quickstart rust lima-ubuntu-lts-5074}]&lt;/code&gt;: &lt;code&gt;quickstart&lt;/code&gt; service, written in &lt;code&gt;rust&lt;/code&gt;, with an automatically created service instance name &lt;code&gt;lima-ubuntu-lts-5074&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;traceparent&lt;/code&gt; as received by the parent request, or a new random one if the parent request didn&amp;rsquo;t specify it&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;After a few minutes traces will appear in Grafana Cloud. For example, in the traces explorer:&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/quickstart/trace-generic.png&#34;
  alt=&#34;Beyla traces explorer&#34; width=&#34;1298&#34;
     height=&#34;1134&#34;/&gt;&lt;/p&gt;
&lt;h2 id=&#34;6-configure-routing&#34;&gt;6. Configure routing&lt;/h2&gt;
&lt;p&gt;The exposed span name in Grafana Cloud is a generic &lt;code&gt;GET /**&lt;/code&gt;, where it should say something like &lt;code&gt;GET /foo&lt;/code&gt; (the path of the
test request URL).&lt;/p&gt;
&lt;p&gt;Beyla groups any unknown URL path as &lt;code&gt;/**&lt;/code&gt; to avoid unexpected cardinality explosions.&lt;/p&gt;
&lt;p&gt;Configure routing to tell Beyla about expected routes.&lt;/p&gt;
&lt;p&gt;For this quickstart, let Beyla to heuristically group the routes.&lt;/p&gt;
&lt;p&gt;First, create a &lt;code&gt;config.yml&lt;/code&gt; file with the following content:&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;yml&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-yml&#34;&gt;routes:
  unmatched: heuristic&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Then, run Beyla with the &lt;code&gt;-config&lt;/code&gt; argument (or use the &lt;code&gt;BEYLA_CONFIG_PATH&lt;/code&gt; environment variable instead):&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;sudo -E beyla -config config.yml&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Finally, make HTTP requests:&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;curl http://localhost:8080/foo
curl http://localhost:8080/user/1234
curl http://localhost:8080/user/5678&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Grafana will now heuristically assign a route to each trace. &lt;code&gt;/foo&lt;/code&gt; got its own route while &lt;code&gt;/user/1234&lt;/code&gt; and
&lt;code&gt;/user/5678&lt;/code&gt; were grouped into the &lt;code&gt;/user/*&lt;/code&gt; route.&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/quickstart/grouped-traces.png&#34;
  alt=&#34;Beyla grouped traces&#34; width=&#34;1476&#34;
     height=&#34;346&#34;/&gt;&lt;/p&gt;
&lt;h2 id=&#34;next-steps&#34;&gt;Next steps&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Get more details of the different &lt;a href=&#34;../../configure/&#34;&gt;Beyla configuration options&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Learn how to deploy Beyla as a &lt;a href=&#34;../../setup/docker/&#34;&gt;Docker container&lt;/a&gt; or as a &lt;a href=&#34;../../setup/kubernetes/&#34;&gt;Kubernetes DaemonSet or sidecar&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="quickstart-instrument-a-rust-service-with-beyla">Quickstart: instrument a Rust service with Beyla&lt;/h1>
&lt;h2 id="1-run-an-instrumentable-rust-service">1. Run an instrumentable Rust service&lt;/h2>
&lt;p>Run an instrumentable Rust service or download and run a simple example &lt;a href="https://github.com/grafana/beyla/tree/main/examples/quickstart/rust" target="_blank" rel="noopener noreferrer">Rust HTTP service&lt;/a>.&lt;/p></description></item></channel></rss>