Our Go agent auto-instruments your code so you can start monitoring your Go language apps and microservices. You can use our launcher, or follow the instructions in this document to complete a basic Go agent installation.
To use Go or any other agent, as well as the rest of our observability platform, join the New Relic family! Sign up to create your free account in only a few seconds. Then ingest up to 100GB of data for free each month. Forever.
The Go agent requires Golang 1.7 or higher on Linux, macOS, or Windows. For more information, see Go agent compatibility and requirements.
In order to install the Go agent, you need a New Relic license key. Then, to install the agent:
From https://github.com/newrelic/go-agent, use your preferred process; for example:go get github.com/newrelic/go-agent
github.com/newrelic/go-agent/v3/newrelicpackage in your application.
Initialize the Go agent by adding the following in the
mainfunction or in an
app, err := newrelic.NewApplication( newrelic.ConfigAppName("Your Application Name"), newrelic.ConfigLicense("__YOUR_NEW_RELIC_LICENSE_KEY__"), )
Instrument web transactions by wrapping standard HTTP requests in your app code. For example:http.HandleFunc(newrelic.WrapHandleFunc(app, "/users", usersHandler))
Instrument other transactions you want to monitor.
Optional: Instrument segments for an extra level of timing detail.
Compile and deploy your application.
To take full advantage of New Relic's latest features, enhancements, and important security patches, keep your app's Go agent up to date.
If you need more help, check out these support and learning resources:
- Browse the Explorers Hub to get help from the community and join in discussions.
- Find answers on our sites and learn how to use our support portal.
- Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS.
- Review New Relic's data security and licenses documentation.