Type to search.

Set up the APM Go Agent

Serverless Observability

Elastic Cloud Serverless projects are autoscaled environments, fully managed by Elastic and available on Elastic Cloud.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

Stack

The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments.

This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

APM Agent Go

The Elastic APM Go agent enables you to trace the execution of operations in your Go applications, sending performance metrics and errors to the Elastic APM Server.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

To start reporting your Go application’s performance to Elastic APM, you need to do a few things:

  1. Install the Agent.
  2. Instrument Go Source Code.
  3. Configure the Agent.

Within a Go module, install the Elastic APM Go agent package using go get:

Shell
go get -u go.elastic.co/apm/v2

You can find a list of the supported frameworks and other technologies in the Supported Technologies section.

Instrumentation is the process of extending your application’s code to report trace data to Elastic APM. Go applications must be instrumented manually at the source code level. There are two ways to instrument your applications:

Where possible, use the built-in modules to report transactions served by web and RPC frameworks in your application.

To simplify development and testing, the agent defaults to sending data to the Elastic APM Server at http://localhost:8200. To send data to an alternative location, you must configure ELASTIC_APM_SERVER_URL. Depending on the configuration of your server, you may also need to set ELASTIC_APM_API_KEY, ELASTIC_APM_SECRET_TOKEN, and ELASTIC_APM_VERIFY_SERVER_CERT. All other variables have usable defaults.

See Configuration to learn about all available options.