The New Relic Go Agent allows you to monitor your Go applications with New Relic. It helps you track transactions, outbound requests, database calls, and other parts of your Go application's behavior and provides a running overview of garbage collection, goroutine activity, and memory use.
All pull requests will be reviewed by the New Relic product team. Any questions or issues should be directed to our support site or our community forum.
If you have already been using version 2.X of the agent and are upgrading to version 3.0, see our Migration Guide for details.
For the latest version of the agent, Go 1.7+ is required, due to the use of context.Context
.
(For versions 2.X and earlier of the Go agent, Go 1.3+ is required.)
Linux, OS X, and Windows (Vista, Server 2008 and later) are supported.
The following integration packages extend the base newrelic package to support the following frameworks and libraries. Frameworks and databases which don't have an integration package may still be instrumented using the newrelic package primitives.
Project | Integration Package | |
---|---|---|
gin-gonic/gin | v3/integrations/nrgin | Instrument inbound requests through the Gin framework |
gorilla/mux | v3/integrations/nrgorilla | Instrument inbound requests through the Gorilla framework |
google.golang.org/grpc | v3/integrations/nrgrpc | Instrument gRPC servers and clients |
labstack/echo | v3/integrations/nrecho-v3 | Instrument inbound requests through version 3 of the Echo framework |
labstack/echo | v3/integrations/nrecho-v4 | Instrument inbound requests through version 4 of the Echo framework |
julienschmidt/httprouter | v3/integrations/nrhttprouter | Instrument inbound requests through the HttpRouter framework |
micro/go-micro | v3/integrations/nrmicro | Instrument servers, clients, publishers, and subscribers through the Micro framework |
More information about instrumenting databases without an integration package using newrelic package primitives can be found here.
Project | Integration Package | |
---|---|---|
lib/pq | v3/integrations/nrpq | Instrument PostgreSQL driver |
go-sql-driver/mysql | v3/integrations/nrmysql | Instrument MySQL driver |
elastic/go-elasticsearch | v3/integrations/nrelasticsearch-v7 | Instrument Elasticsearch datastore calls |
database/sql | Use a supported database driver or builtin instrumentation | Instrument database calls with SQL |
jmoiron/sqlx | Use a supported database driver or builtin instrumentation | Instrument database calls with SQLx |
go-redis/redis | v3/integrations/nrredis-v7 | Instrument Redis calls |
mattn/go-sqlite3 | v3/integrations/nrsqlite3 | Instrument SQLite driver |
snowflakedb/gosnowflake | v3/integrations/nrsnowflake | Instrument Snowflake driver |
mongodb/mongo-go-driver | v3/integrations/nrmongo | Instrument MongoDB calls |
Project | Integration Package | |
---|---|---|
sirupsen/logrus | v3/integrations/nrlogrus | Send agent log messages to Logrus |
mgutz/logxi | v3/integrations/nrlogxi | Send agent log messages to Logxi |
uber-go/zap | v3/integrations/nrzap | Send agent log messages to Zap |
Project | Integration Package | |
---|---|---|
aws/aws-sdk-go | v3/integrations/nrawssdk-v1 | Instrument outbound calls made using Go AWS SDK |
aws/aws-sdk-go-v2 | v3/integrations/nrawssdk-v2 | Instrument outbound calls made using Go AWS SDK v2 |
aws/aws-lambda-go | v3/integrations/nrlambda | Instrument AWS Lambda applications |
Project | Integration Package | |
---|---|---|
graph-gophers/graphql-go | v3/integrations/nrgraphgophers | Instrument inbound requests using graph-gophers/graphql-go |
graphql-go/graphql | v3/integrations/nrgraphqlgo | Instrument inbound requests using graphql-go/graphql |
Project | Integration Package | |
---|---|---|
pkg/errors | v3/integrations/nrpkgerrors | Wrap pkg/errors errors to improve stack traces and error class information |
openzipkin/b3-propagation | v3/integrations/nrb3 | Add B3 headers to outgoing requests |
nats-io/nats.go | v3/integrations/nrnats | Instrument publishers and subscribers using the NATS client |
nats-io/stan.go | v3/integrations/nrstan | Instrument publishers and subscribers using the NATS streaming client |
These integration packages must be imported along with the newrelic package, as shown in this nrgin example.
Follow the steps in GETTING_STARTED.md to instrument your application.
v3/examples/server/main.go is an example that will appear as "Example App" in your New Relic applications list. To run it:
env NEW_RELIC_LICENSE_KEY=__YOUR_NEW_RELIC_LICENSE_KEY__LICENSE__ \
go run v3/examples/server/main.go
Some endpoints exposed are http://localhost:8000/ and http://localhost:8000/notice_error
If you are already using another open source solution to gather telemetry data, you may find it easier to use one of our open source exporters to send this data to New Relic:
- OpenTelemetry: github.com/newrelic/opentelemetry-exporter-go
- OpenCensus: github.com/newrelic/newrelic-opencensus-exporter-go
- Prometheus Exporter: github.com/newrelic/nri-prometheus
- Istio Adapter: github.com/newrelic/newrelic-istio-adapter
- Telemetry SDK: github.com/newrelic/newrelic-telemetry-sdk-go
You can find more detailed documentation in the guide and on the New Relic Documentation site.
If you can't find what you're looking for there, reach out to us on our support site or our community forum and we'll be happy to help you.
Find a bug? Contact us via support.newrelic.com, or email support@newrelic.com.