<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
  <channel>
    <title><![CDATA[Damien Mathieu - Elastic Observability Labs]]></title>
    <description><![CDATA[Trusted security news & research from the team at Elastic.]]></description>
    <copyright><![CDATA[© 2026. Elasticsearch B.V. All Rights Reserved]]></copyright>
    <image>
      <title><![CDATA[Damien Mathieu - Elastic Observability Labs]]></title>
      <url>https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltad972c1c27dbefc6/6a88d9782904ea5e8511d473/observability-labs-thumbnail.png</url>
      <link>https://www.elastic.co/observability-labs/author/damien-mathieu</link>
    </image>
    <link>https://www.elastic.co/observability-labs/author/damien-mathieu</link>
    <atom:link href="https://www.elastic.co/observability-labs/rss/author/damien-mathieu.xml" rel="self" type="application/rss+xml"/>
    <language><![CDATA[en]]></language>
    <lastBuildDate>Sat, 12 Sep 2026 04:44:01 GMT</lastBuildDate>
  <item>
    <title><![CDATA[Auto-instrumentation of Go applications with OpenTelemetry]]></title>
    <description><![CDATA[Instrumenting Go applications with OpenTelemetry provides insights into application performance, dependencies, and errors. We'll show you how to automatically instrument a Go application using Docker, with no changes to your application code.]]></description>
    <content:encoded><![CDATA[<p>In the fast-paced universe of software development, especially in the
cloud-native realm, DevOps and SRE teams are increasingly emerging as essential
partners in application stability and growth.</p>
<p>DevOps engineers continuously optimize software delivery, while SRE teams act
as the stewards of application reliability, scalability, and top-tier
performance. The challenge? These teams require a cutting-edge observability
solution, one that encompasses full-stack insights, empowering them to rapidly
manage, monitor, and rectify potential disruptions before they culminate into
operational challenges.</p>
<p>Observability in our modern distributed software ecosystem goes beyond mere
monitoring — it demands limitless data collection, precision in processing, and
the correlation of this data into actionable insights. However, the road to
achieving this holistic view is paved with obstacles, from navigating version
incompatibilities to wrestling with restrictive proprietary code.</p>
<p>Enter <a href="https://opentelemetry.io/">OpenTelemetry (OTel)</a>, with the following
benefits for those who adopt it:</p>
<ul>
<li>Escape vendor constraints with OTel, freeing yourself from vendor lock-in and
ensuring top-notch observability.</li>
<li>See the harmony of unified logs, metrics, and traces come together to provide
a complete system view.</li>
<li>Improve your application oversight through richer and enhanced
instrumentations.</li>
<li>Embrace the benefits of backward compatibility to protect your prior
instrumentation investments.</li>
<li>Embark on the OpenTelemetry journey with an easy learning curve, simplifying
onboarding and scalability.</li>
<li>Rely on a proven, future-ready standard to boost your confidence in every
investment.</li>
</ul>
<p>In this blog, we will explore how you can use <a href="https://github.com/open-telemetry/opentelemetry-go-instrumentation/">automatic instrumentation in
your Go</a>
application using Docker, without the need to refactor any part of your
application code. We will use an <a href="https://github.com/elastic/observability-examples">application called
Elastiflix</a>, which helps
highlight auto-instrumentation in a simple way.</p>
<h2 id="applicationprerequisitesandconfig">Application, prerequisites, and config</h2>
<p>The application that we use for this blog is called
<a href="https://github.com/elastic/observability-examples">Elastiflix</a>, a
movie-streaming application. It consists of several micro-services written in
.NET, NodeJS, Go, and Python.</p>
<p>Before we instrument our sample application, we will first need to understand
how Elastic can receive the telemetry data.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt5405335485c969f1/6a85c7acd6cf2918a7bb087e/elastic-blog-1-config.png" alt="Elastic configuration options for
OpenTelemetry" /></p>
<p>All of Elastic Observability’s APM capabilities are available with OTel data.
Some of these include:</p>
<ul>
<li>Service maps</li>
<li>Service details (latency, throughput, failed transactions)</li>
<li>Dependencies between services, distributed tracing</li>
<li>Transactions (traces)</li>
<li>Machine learning (ML) correlations</li>
<li>Log correlation</li>
</ul>
<p>In addition to Elastic’s APM and a unified view of the telemetry data, you will
also be able to use Elastic’s powerful machine learning capabilities to reduce
the analysis, and alerting to help reduce MTTR.</p>
<h3 id="prerequisites">Prerequisites</h3>
<ul>
<li>An Elastic Cloud account — <a href="https://cloud.elastic.co/">sign up now</a>.</li>
<li>A clone of the <a href="https://github.com/elastic/observability-examples">Elastiflix demo application</a>, or your own Go application</li>
<li>Basic understanding of Docker — potentially install <a href="https://www.docker.com/products/docker-desktop/">Docker Desktop</a></li>
<li>Basic understanding of Go</li>
</ul>
<h3 id="viewtheexamplesourcecode">View the example source code</h3>
<p>The full source code, including the Dockerfile used in this blog, can be found
on
<a href="https://github.com/elastic/observability-examples/tree/main/Elastiflix/go-favorite">GitHub</a>.</p>
<p>The following steps will show you how to instrument this application and run it
on the command line or in Docker. If you are interested in a more complete OTel
example, take a look at the docker-compose file
<a href="https://github.com/elastic/observability-examples/tree/main#start-the-app">here</a>,
which will bring up the full project.</p>
<h2 id="stepbystepguide">Step-by-step guide</h2>
<h3 id="step0logintoyourelasticcloudaccount">Step 0. Log in to your Elastic Cloud account</h3>
<p>This blog assumes you have an Elastic Cloud account — if not, follow the
<a href="https://cloud.elastic.co/registration?elektra=en-cloud-page">instructions to get started on Elastic
Cloud</a>.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltdb92257a78bf2a8b/6a85c7afabdc296b2912247a/elastic-blog-2-trial.png" alt="free trial" /></p>
<h3 id="step1runthedockerimagewithautoinstrumentation">Step 1. Run the Docker Image with auto-instrumentation</h3>
<p>We are going to use automatic instrumentation with the Go service from the
<a href="https://github.com/elastic/observability-examples/tree/main/Elastiflix/go-favorite">Elastiflix demo
application</a>.</p>
<p>We will be using the following service from Elastiflix:</p>
<pre><code>Elastiflix/go-favorite
</code></pre>
<p>Per the <a href="https://github.com/open-telemetry/opentelemetry-go-instrumentation/blob/main/docs/getting-started.md">OpenTelemetry Automatic Instrumentation for Go
documentation</a>,
you will configure the application to be auto-instrumented using
docker-compose.</p>
<p>As specified in the <a href="https://github.com/open-telemetry/opentelemetry-go-instrumentation/blob/main/docs/getting-started.md">OTEL Go
documentation</a>,
we will use environment variables and pass in the configuration values to
enable it to connect with <a href="https://www.elastic.co/guide/en/observability/current/apm-open-telemetry.html">Elastic Observability’s APM
server</a>.</p>
<p>Because Elastic accepts OTLP natively, we just need to provide the Endpoint and
authentication where the OTEL Exporter needs to send the data, as well as some
other environment variables.</p>
<p><strong>Getting Elastic Cloud variables</strong>
You can copy the endpoints and token from Kibana under the path <code>/app/apm/onboarding?agent=openTelemetry</code>.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt2da72f2943c5e320/6a85c7b29d2b71762ef938f3/elastic-blog-3-apm-agents.png" alt="apm agents" /></p>
<p>You will need to copy the following environment variables:</p>
<pre><code>OTEL_EXPORTER_OTLP_ENDPOINT
OTEL_EXPORTER_OTLP_HEADERS
</code></pre>
<p>Update the <code>docker-compose.yml</code> file at the top of the <code>Elastiflix</code> repository,
adding a <code>go-auto</code> service and updating the <code>favorite-go</code> one:</p>
<pre><code>  favorite-go:
    build: go-favorite/.
    image: docker.elastic.co/demos/workshop/observability/elastiflix-go-favorite:${ELASTIC_VERSION}-${BUILD_NUMBER}
    depends_on:
      - redis
    networks:
      - app-network
    ports:
      - "5001:5000"
    environment:
      - REDIS_HOST=redis
      - TOGGLE_SERVICE_DELAY=${TOGGLE_SERVICE_DELAY:-0}
      - TOGGLE_CANARY_DELAY=${TOGGLE_CANARY_DELAY:-0}
      - TOGGLE_CANARY_FAILURE=${TOGGLE_CANARY_FAILURE:-0}
    volumes:
      - favorite-go:/app
  go-auto:
    image: otel/autoinstrumentation-go
    privileged: true
    pid: "host"
    networks:
      - app-network
    environment:
      OTEL_EXPORTER_OTLP_ENDPOINT: "REPLACE WITH OTEL_EXPORTER_OTLP_ENDPOINT"
      OTEL_EXPORTER_OTLP_HEADERS: "REPLACE WITH OTEL_EXPORTER_OTLP_HEADERS"
      OTEL_GO_AUTO_TARGET_EXE: "/app/main"
      OTEL_SERVICE_NAME: "go-favorite"
      OTEL_PROPAGATORS: "tracecontext,baggage"
    volumes:
      - favorite-go:/app
      - /proc:/host/proc
</code></pre>
<p>And, at the bottom of the file:</p>
<pre><code>volumes:
  favorite-go:
networks:
  app-network:
    driver: bridge
</code></pre>
<p>Finally, in the configuration for the main node app, you will want to tell Elastiflix to call the Go favorites app by replacing the line:</p>
<pre><code>environment:
  - API_ENDPOINT_FAVORITES=favorite-java:5000
</code></pre>
<p>with:</p>
<pre><code>environment:
  - API_ENDPOINT_FAVORITES=favorite-go:5000
</code></pre>
<h3 id="step3exploretracesandlogsinelasticapm">Step 3: Explore traces and logs in Elastic APM</h3>
<p>Once you have this up and running, you can ping the endpoint for your
instrumented service (in our case, this is /favorites), and you should see the
app appear in Elastic APM, as shown below:</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltc01109d384575b47/6a85c7b5d6cf296423bb0886/elastic-blog-4-services.png" alt="services" /></p>
<p>It will begin by tracking throughput and latency critical metrics for SREs to
pay attention to.</p>
<p>Digging in, we can see an overview of all our Transactions.</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt30c92e5b8c16cffb/6a85c7b89829264ca658385c/elastic-blog-5-services2.png" alt="services-2" /></p>
<p>And look at specific transactions:</p>
<p><img src="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/bltb9cdf840d07ea72b/6a85c7bad7b2e746c7fe8446/elastic-blog-6-graph-colored.png" alt="graph colored lines" /></p>
<p>This gives you complete visibility across metrics, and traces!</p>
<h2 id="summary">Summary</h2>
<p>With this Dockerfile, you've transformed your simple Go application into one
that's automatically instrumented with OpenTelemetry. This will aid greatly in
understanding application performance, tracing errors, and gaining insights
into how users interact with your software.</p>
<p>Remember, observability is a crucial aspect of modern application development,
especially in distributed systems. With tools like OpenTelemetry, understanding
complex systems becomes a tad bit easier.</p>
<p>In this blog, we discussed the following:</p>
<ul>
<li>How to auto-instrument Go with OpenTelemetry.</li>
<li>Using standard commands in a Docker file, auto-instrumentation was done
efficiently and without adding code in multiple places enabling
manageability.</li>
<li>Using OpenTelemetry and its support for multiple languages, DevOps and SRE
teams can auto-instrument their applications with ease gaining immediate
insights into the health of the entire application stack and reduce mean time
to resolution (MTTR).</li>
</ul>
<p>Since Elastic can support a mix of methods for ingesting data, whether it be
using auto-instrumentation of open-source OpenTelemetry or manual
instrumentation with its native APM agents, you can plan your migration to OTel
by focusing on a few applications first and then using OpenTelemety across your
applications later on in a manner that best fits your business needs.</p>
<p>Developer resources:</p>
<ul>
<li><p><a href="https://www.elastic.co/observability-labs/blog/getting-started-opentelemetry-instrumentation-sample-app">Elastiflix application</a>, a guide to instrument different languages with OpenTelemetry</p></li>
<li><p>Python: <a href="https://www.elastic.co/observability-labs/blog/auto-instrumentation-python-applications-opentelemetry">Auto-instrumentation</a>, <a href="https://www.elastic.co/observability-labs/blog/manual-instrumentation-python-apps-opentelemetry">Manual-instrumentation</a></p></li>
<li><p>Java: <a href="https://www.elastic.co/observability-labs/blog/auto-instrumentation-java-applications-opentelemetry">Auto-instrumentation</a>, <a href="https://www.elastic.co/observability-labs/blog/manual-instrumentation-java-apps-opentelemetry">Manual-instrumentation</a></p></li>
<li><p>Node.js: <a href="https://www.elastic.co/observability-labs/blog/auto-instrument-nodejs-apps-opentelemetry">Auto-instrumentation</a>, <a href="https://www.elastic.co/observability-labs/blog/manual-instrumentation-nodejs-apps-opentelemetry">Manual-instrumentation</a></p></li>
<li><p>.NET: <a href="https://www.elastic.co/observability-labs/blog/auto-instrumentation-net-applications-opentelemetry">Auto-instrumentation</a>, <a href="https://www.elastic.co/observability-labs/blog/manual-instrumentation-net-apps-opentelemetry">Manual-instrumentation</a></p></li>
<li><p>Go: <a href="https://www.elastic.co/observability-labs/blog/auto-instrumentation-go-applications-opentelemetry">Auto-instrumentation</a> <a href="https://www.elastic.co/observability-labs/blog/manual-instrumentation-apps-opentelemetry">Manual-instrumentation</a></p></li>
<li><p><a href="https://www.elastic.co/observability-labs/blog/best-practices-instrumenting-opentelemetry">Best practices for instrumenting OpenTelemetry</a></p>
<p>General configuration and use case resources:</p></li>
<li><p><a href="https://www.elastic.co/blog/opentelemetry-observability">Independence with OpenTelemetry on Elastic</a></p></li>
<li><p><a href="https://www.elastic.co/blog/implementing-kubernetes-observability-security-opentelemetry">Modern observability and security on Kubernetes with Elastic and OpenTelemetry</a></p></li>
<li><p><a href="https://www.elastic.co/blog/3-models-logging-opentelemetry-elastic">3 models for logging with OpenTelemetry and Elastic</a></p></li>
<li><p><a href="https://www.elastic.co/blog/adding-free-and-open-elastic-apm-as-part-of-your-elastic-observability-deployment">Adding free and open Elastic APM as part of your Elastic Observability deployment</a></p></li>
<li><p><a href="https://www.elastic.co/blog/custom-metrics-app-code-java-agent-plugin">Capturing custom metrics through OpenTelemetry API in code with Elastic</a></p></li>
<li><p><a href="https://www.elastic.co/virtual-events/future-proof-your-observability-platform-with-opentelemetry-and-elastic">Future-proof your observability platform with OpenTelemetry and Elastic</a></p></li>
<li><p><a href="https://www.elastic.co/blog/kubernetes-k8s-observability-elasticsearch-cncf">Elastic Observability: Built for open technologies like Kubernetes, OpenTelemetry, Prometheus, Istio, and more</a></p></li>
</ul>
<p>Don’t have an Elastic Cloud account yet? <a href="https://cloud.elastic.co/registration">Sign up for Elastic Cloud</a> and try out the auto-instrumentation capabilities that I discussed above. I would be interested in getting your feedback about your experience in gaining visibility into your application stack with Elastic.</p>
<p>The release and timing of any features or functionality described in this post remain at Elastic's sole discretion. Any features or functionality not currently available may not be delivered on time or at all._</p>]]></content:encoded>
    <link>https://www.elastic.co/observability-labs/blog/auto-instrumentation-go-applications-opentelemetry</link>
    <guid isPermaLink="false">auto-instrumentation-go-applications-opentelemetry</guid>
    <category><![CDATA[OpenTelemetry]]></category>
    <category><![CDATA[APM]]></category>
    <category><![CDATA[Infrastructure Monitoring]]></category>
    <dc:creator><![CDATA[Damien Mathieu]]></dc:creator>
    <enclosure url="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt82a63d48c4106992/6a85c7bdbc5bb3efbcf81a4f/observability-launch-series-3-go-auto.jpg" length="0" type="image/jpeg"/>
    <pubDate>Wed, 02 Oct 2024 00:00:00 GMT</pubDate>
  </item>
  </channel>
</rss>