Set up the APM Go Agent
Elastic Cloud Serverless projects are autoscaled environments, fully managed by Elastic and available on Elastic Cloud. Availability This functionality is generally available and ready for production usage. The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats. Availability 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. 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 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.
Serverless Observability
Generally available
Stack
Generally available
APM Agent Go
Generally available
To start reporting your Go application’s performance to Elastic APM, you need to do a few things:
Within a Go module, install the Elastic APM Go agent package using go get:
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:
- Using Built-in instrumentation modules.
- Custom instrumentation and Context propagation with the Go Agent API.
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.