Install New Relic for Go to monitor your Go language apps and microservices.
For more about the features of New Relic for Go, see Welcome to New Relic for Go.
Compatibility and requirements
To use New Relic Go monitoring, you must be using Golang 1.3 or higher on Linux, OS X, or Windows.
Get New Relic for Go
To install New Relic for Go:
- You'll need a New Relic license key. If you already have a New Relic account, you can find your license key in the New Relic user interface. If you don't yet have an account, sign up for New Relic here.
- Install the New Relic Go agent from http://github.com/newrelic/go-agent using your preferred process (for example,
go get github.com/newrelic/go-agent).
- Import the
github.com/newrelic/go-agentpackage in your application.
Initialize the New Relic agent by adding the following in the
mainfunction or in an
config := newrelic.NewConfig("Your_App_Name", "__YOUR_NEW_RELIC_LICENSE_KEY__") app, err := newrelic.NewApplication(config)
Instrument web transactions by wrapping standard HTTP requests in your app code. Here's an example:
http.HandleFunc(newrelic.WrapHandleFunc(app, "/users", usersHandler))
- Compile and deploy your application.
Wait a few minutes for your application to send data to New Relic. Then, check your app's performance in the New Relic APM UI.
For a before-and-after example of instrumenting the HTTP requests in a simple Golang application, see the New Relic Go README on GitHub.
For more help
Additional documentation resources include: