If you don't have one already, create a New Relic account. It's free, forever. Before you install New Relic for Go, ensure your system meets these requirements.
Golang versions
New Relic supports Golang 1.19 or higher.
Operating environments
The agent supports Linux, macOS, and Windows. You can also use the Go agent in a Google App Engine (GAE) flexible environment.
Integrations
The following integration packages extend the base newrelic package to support other frameworks and libraries. If frameworks and databases don't have an integration package, you can still instrument them using the newrelic package primitives. For more information about instrumenting your database using these primitives, see the Go agent's datastore segments documentation on GitHub.
The following integration packages must be imported along with the newrelic package, as shown in the nrgin example on GitHub.
Project | Integration package | Purpose |
---|---|---|
Instrument outbound calls made using Go AWS SDK | ||
Instrument outbound calls made using Go AWS SDK v2 | ||
Instrument inbound requests through version 3 of the Echo framework | ||
Instrument inbound requests through version 4 of the Echo framework | ||
Instrument inbound requests through the Gin framework | ||
Instrument inbound requests through the Gorilla framework | ||
Instrument inbound requests through the HttpRouter framework | ||
Instrument AWS Lambda applications | ||
Send agent log messages to Logrus | ||
Capture and send logs in context data from logs written in zerolog | ||
Capture and send logs in context data from logs written in logrus | ||
Capture and send logs in context data from logs written in the standard library log package | ||
Send agent log messages to Logxi | ||
Send agent log messages to Zap | ||
Wrap pkg/errors errors to improve stack traces and error class information | ||
Add B3 headers to outgoing requests | ||
Use a supported database driver or built-in instrumentation | Instrument database calls with SQL | |
Use a supported database driver or builtin instrumentation | Instrument database calls with SQLx | |
Instrument database calls to MySQL | ||
Instrument database calls to Postgres using the | ||
Instrument database calls to Postgres using the | ||
Instrument database calls to Postgres using the | ||
Instrument database calls to Snowflake | ||
Instrument calls to Redis Version 7 | ||
Instrument calls to Redis Version 8 | ||
Instrument database calls to SQLite | ||
Instrument MongoDB calls | ||
Instrument gRPC servers and clients | ||
Instrument servers, clients, publishers, and subscribers through the Micro framework | ||
Instrument publishers and subscribers using the NATS client | ||
Instrument publishers and subscribers using the NATS streaming client | ||
Instrument inbound requests using graphql-go/graphql | ||
Instrument inbound requests using |
Database and instance-level performance
New Relic collects instance details for a variety of databases and database drivers. The ability to view specific instances and the types of database information in depends on your agent version.
The New Relic Go agent version 1.4 or higher supports instance details for all database drivers.
Connect the agent to other features
The Go agent integrates with other features to give you observability across your entire stack:
Product | Capability |
---|---|
If you have version 3.31.0 or higher of Go agent, you can collect AI data from certain AI libraries and frameworks:
| |
When you install the infrastructure and APM agents on the same host, they automatically detect one another. You can then view a list of hosts in the APM UI, and filter your hosts by APM app in our infrastructure UI. For more information, see APM data in infrastructure monitoring. | |
The Go agent sends default events and attributes to New Relic for NRQL queries. You can also record custom events for advanced analysis. | |
Synthetic transaction traces connect requests from synthetic monitors to the underlying APM transaction. | |
The Go agent has an API for returning the browser agent's JavaScript. After using this API method on each request, you can view browser data in the APM Summary page and quickly switch between the APM and browser data for a particular app. |