{"id":15160906,"url":"https://github.com/framer/go-agent","last_synced_at":"2025-09-30T13:32:05.065Z","repository":{"id":192585931,"uuid":"676919762","full_name":"framer/go-agent","owner":"framer","description":"New Relic Go Agent","archived":false,"fork":true,"pushed_at":"2024-10-21T19:25:12.000Z","size":4788,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-22T02:29:39.003Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"newrelic/go-agent","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/framer.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-08-10T10:09:32.000Z","updated_at":"2024-10-21T15:31:31.000Z","dependencies_parsed_at":"2023-09-05T04:09:42.045Z","dependency_job_id":null,"html_url":"https://github.com/framer/go-agent","commit_stats":null,"previous_names":["framer/go-agent"],"tags_count":100,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/framer%2Fgo-agent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/framer%2Fgo-agent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/framer%2Fgo-agent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/framer%2Fgo-agent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/framer","download_url":"https://codeload.github.com/framer/go-agent/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234744628,"owners_count":18879955,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-26T23:42:06.028Z","updated_at":"2025-09-30T13:31:59.507Z","avatar_url":"https://github.com/framer.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Community Plus header](https://github.com/newrelic/opensource-website/raw/main/src/images/categories/Community_Plus.png)](https://opensource.newrelic.com/oss-category/#community-plus)\n\n# New Relic Go Agent [![GoDoc](https://godoc.org/github.com/newrelic/go-agent?status.svg)](https://godoc.org/github.com/newrelic/go-agent/v3/newrelic/) [![Go Report Card](https://goreportcard.com/badge/github.com/newrelic/go-agent)](https://goreportcard.com/report/github.com/newrelic/go-agent) [![codecov](https://codecov.io/github/newrelic/go-agent/branch/master/graph/badge.svg?token=UEWy0clWYW)](https://codecov.io/github/newrelic/go-agent)\n\nThe New Relic Go Agent allows you to monitor your Go applications with New\nRelic. It helps you track transactions, outbound requests, database calls, and\nother parts of your Go application's behavior and provides a running overview of\ngarbage collection, goroutine activity, and memory use.\n\nGo is a compiled language, and doesn’t use a virtual machine. This means that setting up New Relic for your Golang app requires you to use our Go agent API and manually add New Relic methods to your source code. Our API provides exceptional flexibility and control over what gets instrumented.\n\n## Installation\n\n### Compatibility and Requirements\n\nFor the latest version of the agent, Go 1.18+ is required.\n\nLinux, OS X, and Windows (Vista, Server 2008 and later) are supported.\n\n### Installing and using the Go agent\n\nTo install the agent, follow the instructions in our [GETTING_STARTED](https://github.com/newrelic/go-agent/blob/master/GETTING_STARTED.md)\ndocument or our [GUIDE](https://github.com/newrelic/go-agent/blob/master/GUIDE.md).\n\nWe recommend instrumenting your Go code to get the maximum benefits from the\nNew Relic Go agent. But we make it easy to get great data in couple of ways:\n\n* Even without adding instrumentation, just importing the agent and creating an\napplication will provide useful runtime information about your number of goroutines,\ngarbage collection statistics, and memory and CPU usage.\n* You can use our many [INTEGRATION packages](https://github.com/newrelic/go-agent/tree/master/v3/integrations)\nfor out-of-the box support for many popular Go web frameworks and libraries. We\ncontinue to add integration packages based on your feedback. You can weigh in on\npotential integrations by opening an `Issue` here in our New Relic Go agent GitHub project.\n\n### Upgrading\n\nIf you have already been using version 2.X of the agent and are upgrading to\nversion 3.0, see our [MIGRATION guide](MIGRATION.md) for details.\n\n## Getting Started\n\n[v3/examples/server/main.go](v3/examples/server/main.go) is an example that\nwill appear as \"Example App\" in your New Relic applications list.  To run it:\n\n```\nenv NEW_RELIC_LICENSE_KEY=__YOUR_NEW_RELIC_LICENSE_KEY__LICENSE__ \\\n    go run v3/examples/server/main.go\n```\n\nSome endpoints exposed are [http://localhost:8000/](http://localhost:8000/)\nand [http://localhost:8000/notice_error](http://localhost:8000/notice_error)\n\n## Usage\n\n### Integration Packages\n\nThe following [integration packages](https://godoc.org/github.com/newrelic/go-agent/v3/integrations)\nextend the base [newrelic](https://godoc.org/github.com/newrelic/go-agent/v3/newrelic/) package\nto support the following frameworks and libraries.\nFrameworks and databases which don't have an integration package may still be\ninstrumented using the [newrelic](https://godoc.org/github.com/newrelic/go-agent/v3/newrelic/)\npackage primitives.\n\n\u003c!---\nNOTE! When updating the tables below, be sure to update the docs site version too:\nhttps://docs.newrelic.com/docs/agents/go-agent/get-started/go-agent-compatibility-requirements\n--\u003e\n\n#### Service Frameworks\n\n| Project | Integration Package |  |\n| ------------- | ------------- | - |\n| [gin-gonic/gin](https://github.com/gin-gonic/gin) | [v3/integrations/nrgin](https://godoc.org/github.com/newrelic/go-agent/v3/integrations/nrgin) | Instrument inbound requests through the Gin framework |\n| [gorilla/mux](https://github.com/gorilla/mux) | [v3/integrations/nrgorilla](https://godoc.org/github.com/newrelic/go-agent/v3/integrations/nrgorilla) | Instrument inbound requests through the Gorilla framework |\n| [google.golang.org/grpc](https://github.com/grpc/grpc-go) | [v3/integrations/nrgrpc](https://godoc.org/github.com/newrelic/go-agent/v3/integrations/nrgrpc) | Instrument gRPC servers and clients |\n| [labstack/echo](https://github.com/labstack/echo) | [v3/integrations/nrecho-v3](https://godoc.org/github.com/newrelic/go-agent/v3/integrations/nrecho-v3) | Instrument inbound requests through version 3 of the Echo framework |\n| [labstack/echo](https://github.com/labstack/echo) | [v3/integrations/nrecho-v4](https://godoc.org/github.com/newrelic/go-agent/v3/integrations/nrecho-v4) | Instrument inbound requests through version 4 of the Echo framework |\n| [julienschmidt/httprouter](https://github.com/julienschmidt/httprouter) | [v3/integrations/nrhttprouter](https://godoc.org/github.com/newrelic/go-agent/v3/integrations/nrhttprouter) | Instrument inbound requests through the HttpRouter framework |\n| [micro/go-micro](https://github.com/micro/go-micro) | [v3/integrations/nrmicro](https://godoc.org/github.com/newrelic/go-agent/v3/integrations/nrmicro) | Instrument servers, clients, publishers, and subscribers through the Micro framework |\n\n#### Datastores\n\nMore information about instrumenting databases without an integration package\nusing [newrelic](https://godoc.org/github.com/newrelic/go-agent/v3/newrelic/)\npackage primitives can be found [here](GUIDE.md#datastore-segments).\n\n| Project | Integration Package |  |\n| ------------- | ------------- | - |\n| [lib/pq](https://github.com/lib/pq) | [v3/integrations/nrpq](https://godoc.org/github.com/newrelic/go-agent/v3/integrations/nrpq) | Instrument PostgreSQL driver (`pq` driver for `database/sql`) |\n| [jackc/pgx](https://github.com/jackc/pgx) | [v3/integrations/nrpgx](https://godoc.org/github.com/newrelic/go-agent/v3/integrations/nrpgx) | Instrument PostgreSQL driver (`pgx` driver for `database/sql`)|\n| [jackc/pgx/v5](https://github.com/jackc/pgx/v5) | [v3/integrations/nrpgx5](https://godoc.org/github.com/newrelic/go-agent/v3/integrations/nrpgx5) | Instrument PostgreSQL driver (`pgx/v5` driver for `database/sql`)|\n| [go-mssqldb](github.com/denisenkom/go-mssqldb) | [v3/integrations/nrmssql](https://godoc.org/github.com/newrelic/go-agent/v3/integrations/nrmssql) | Instrument MS SQL driver |\n| [go-sql-driver/mysql](https://github.com/go-sql-driver/mysql) | [v3/integrations/nrmysql](https://godoc.org/github.com/newrelic/go-agent/v3/integrations/nrmysql) | Instrument MySQL driver |\n| [elastic/go-elasticsearch](https://github.com/elastic/go-elasticsearch) | [v3/integrations/nrelasticsearch-v7](https://godoc.org/github.com/newrelic/go-agent/v3/integrations/nrelasticsearch-v7) | Instrument Elasticsearch datastore calls |\n| [database/sql](https://godoc.org/database/sql) | Use a supported database driver or [builtin instrumentation](https://godoc.org/github.com/newrelic/go-agent/v3/newrelic#InstrumentSQLConnector) | Instrument database calls with SQL |\n| [jmoiron/sqlx](https://github.com/jmoiron/sqlx) | Use a supported [database driver](https://godoc.org/github.com/newrelic/go-agent/v3/integrations/nrpq/example/sqlx) or [builtin instrumentation](https://godoc.org/github.com/newrelic/go-agent/v3/newrelic#InstrumentSQLConnector) | Instrument database calls with SQLx |\n| [go-redis/redis](https://github.com/go-redis/redis) | [v3/integrations/nrredis-v7](https://godoc.org/github.com/newrelic/go-agent/v3/integrations/nrredis-v7) | Instrument Redis 7 calls |\n| [go-redis/redis](https://github.com/go-redis/redis) | [v3/integrations/nrredis-v8](https://godoc.org/github.com/newrelic/go-agent/v3/integrations/nrredis-v8) | Instrument Redis 8 calls |\n| [redis/go-redis](https://github.com/redis/go-redis) | [v3/integrations/nrredis-v9](https://godoc.org/github.com/newrelic/go-agent/v3/integrations/nrredis-v9) | Instrument Redis 9 calls |\n| [mattn/go-sqlite3](https://github.com/mattn/go-sqlite3) | [v3/integrations/nrsqlite3](https://godoc.org/github.com/newrelic/go-agent/v3/integrations/nrsqlite3) | Instrument SQLite driver |\n| [snowflakedb/gosnowflake](https://github.com/snowflakedb/gosnowflake) | [v3/integrations/nrsnowflake](https://godoc.org/github.com/newrelic/go-agent/v3/integrations/nrsnowflake) | Instrument Snowflake driver |\n| [mongodb/mongo-go-driver](https://github.com/mongodb/mongo-go-driver) | [v3/integrations/nrmongo](https://godoc.org/github.com/newrelic/go-agent/v3/integrations/nrmongo) | Instrument MongoDB calls |\n\n#### AI\n\n| Project | Integration Package |  |\n| ------------- | ------------- | - |\n| [sashabaranov/go-openai](https://github.com/sashabaranov/go-openai) | [v3/integrations/nropenai](https://godoc.org/github.com/newrelic/go-agent/v3/integrations/nropenai) | Send AI Monitoring Events with OpenAI |\n| [aws/aws-sdk-go-v2/tree/main/service/bedrockruntime](https://github.com/aws/aws-sdk-go-v2/tree/main/service/bedrockruntime) | [v3/integrations/nrawsbedrock](https://godoc.org/github.com/newrelic/go-agent/v3/integrations/nrawsbedrock) | Send AI Monitoring Events with AWS Bedrock |\n\n\n#### Agent Logging\n\n| Project                                               | Integration Package                                                                                 |                                       |\n|-------------------------------------------------------|-----------------------------------------------------------------------------------------------------|---------------------------------------|\n| [sirupsen/logrus](https://github.com/sirupsen/logrus) | [v3/integrations/nrlogrus](https://godoc.org/github.com/newrelic/go-agent/v3/integrations/nrlogrus) | Send agent log messages to Logrus     |\n| [mgutz/logxi](https://github.com/mgutz/logxi)         | [v3/integrations/nrlogxi](https://godoc.org/github.com/newrelic/go-agent/v3/integrations/nrlogxi)   | Send agent log messages to Logxi      |\n| [uber-go/zap](https://github.com/uber-go/zap)         | [v3/integrations/nrzap](https://godoc.org/github.com/newrelic/go-agent/v3/integrations/nrzap)       | Send agent log messages to Zap        |\n| [log/slog](https://pkg.go.dev/log/slog)               | [v3/integrations/nrslog](https://godoc.org/github.com/newrelic/go-agent/v3/integrations/nrslog)     | Send agent log messages to `log/slog` |\n| [rs/zerolog](https://github.com/rs/zerolog)           | [v3/integrations/nrzerolog](https://godoc.org/github.com/newrelic/go-agent/v3/integrations/nrzerolog) | Send agent log messages to Zerolog  |\n\n#### Logs in Context\n\n| Project | Integration Package |  |\n| ------------- | ------------- | - |\n| [sirupsen/logrus](https://github.com/sirupsen/logrus) | [v3/integrations/logcontext-v2/nrlogrus](https://godoc.org/github.com/newrelic/go-agent/v3/integrations/logcontext-v2/nrlogrus) | Send data collected from Logrus log messages to New Relic |\n| [log](https://pkg.go.dev/log) | [v3/integrations/logcontext-v2/logWriter](https://godoc.org/github.com/newrelic/go-agent/v3/integrations/logcontext-v2/logWriter) | Send data collected from the standard library logger log messages to New Relic |\n| [rs/zerolog](https://github.com/rs/zerolog) | [v3/integrations/logcontext-v2/zerologWriter](https://godoc.org/github.com/newrelic/go-agent/v3/integrations/logcontext-v2/zerologWriter) | Send data collected from zerolog log messages to New Relic |\n\n#### AWS\n\n| Project | Integration Package |  |\n| ------------- | ------------- | - |\n| [aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) | [v3/integrations/nrawssdk-v1](https://godoc.org/github.com/newrelic/go-agent/v3/integrations/nrawssdk-v1) | Instrument outbound calls made using Go AWS SDK |\n| [aws/aws-sdk-go-v2](https://github.com/aws/aws-sdk-go-v2) | [v3/integrations/nrawssdk-v2](https://godoc.org/github.com/newrelic/go-agent/v3/integrations/nrawssdk-v2) | Instrument outbound calls made using Go AWS SDK v2 |\n| [aws/aws-lambda-go](https://github.com/aws/aws-lambda-go) | [v3/integrations/nrlambda](https://godoc.org/github.com/newrelic/go-agent/v3/integrations/nrlambda) | Instrument AWS Lambda applications |\n\n#### GraphQL\n\n| Project | Integration Package |  |\n| ------------- | ------------- | - |\n| [graph-gophers/graphql-go](https://github.com/graph-gophers/graphql-go) | [v3/integrations/nrgraphgophers](https://godoc.org/github.com/newrelic/go-agent/v3/integrations/nrgraphgophers) | Instrument inbound requests using graph-gophers/graphql-go |\n| [graphql-go/graphql](https://github.com/graphql-go/graphql) | [v3/integrations/nrgraphqlgo](https://godoc.org/github.com/newrelic/go-agent/v3/integrations/nrgraphqlgo) | Instrument inbound requests using graphql-go/graphql |\n\n#### Misc\n\n| Project | Integration Package |  |\n| ------------- | ------------- | - |\n| [pkg/errors](https://github.com/pkg/errors) | [v3/integrations/nrpkgerrors](https://godoc.org/github.com/newrelic/go-agent/v3/integrations/nrpkgerrors) | Wrap pkg/errors errors to improve stack traces and error class information |\n| [openzipkin/b3-propagation](https://github.com/openzipkin/b3-propagation) | [v3/integrations/nrb3](https://godoc.org/github.com/newrelic/go-agent/v3/integrations/nrb3) | Add B3 headers to outgoing requests |\n| [nats-io/nats.go](https://github.com/nats-io/nats.go) | [v3/integrations/nrnats](https://godoc.org/github.com/newrelic/go-agent/v3/integrations/nrnats) | Instrument publishers and subscribers using the NATS client |\n| [nats-io/stan.go](https://github.com/nats-io/stan.go) | [v3/integrations/nrstan](https://godoc.org/github.com/newrelic/go-agent/v3/integrations/nrstan) | Instrument publishers and subscribers using the NATS streaming client |\n\n\nThese integration packages must be imported along\nwith the [newrelic](https://godoc.org/github.com/newrelic/go-agent/v3/newrelic/) package, as shown in this\n[nrgin example](https://github.com/newrelic/go-agent/blob/master/v3/integrations/nrgin/example/main.go).\n\n### Alternatives\n\nIf 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:\n\n* OpenTelemetry: [github.com/newrelic/opentelemetry-exporter-go](https://github.com/newrelic/opentelemetry-exporter-go)\n* OpenCensus: [github.com/newrelic/newrelic-opencensus-exporter-go](https://github.com/newrelic/newrelic-opencensus-exporter-go)\n* Prometheus Exporter: [github.com/newrelic/nri-prometheus](https://github.com/newrelic/nri-prometheus)\n* Istio Adapter: [github.com/newrelic/newrelic-istio-adapter](https://github.com/newrelic/newrelic-istio-adapter)\n* Telemetry SDK: [github.com/newrelic/newrelic-telemetry-sdk-go](https://github.com/newrelic/newrelic-telemetry-sdk-go)\n\n\n## Support\n\nShould you need assistance with New Relic products, you are in good hands with several support channels.  \n\nIf the issue has been confirmed as a bug or is a Feature request, please file a Github issue.\n\n\n* [Go Agent GUIDE](GUIDE.md): Step by step how-to for key agent features\n* [New Relic Documentation](https://docs.newrelic.com/docs/agents/go-agent): Comprehensive guidance for using our platform\n* [Troubleshooting framework](https://discuss.newrelic.com/t/troubleshooting-frameworks/108787): Steps you through common troubleshooting questions\n* [New Relic Community](https://discuss.newrelic.com/tags/goagent): The best place to engage in troubleshooting questions\n* [New Relic Developer](https://developer.newrelic.com/): Resources for building a custom observability applications\n* [New Relic University](https://learn.newrelic.com/): A range of online training for New Relic users of every level\n\n## Privacy\n\nAt New Relic we take your privacy and the security of your information seriously, and are committed to protecting your information. We must emphasize the importance of not sharing personal data in public forums, and ask all users to scrub logs and diagnostic information for sensitive information, whether personal, proprietary, or otherwise.\n\nWe define \"Personal Data\" as any information relating to an identified or identifiable individual, including, for example, your name, phone number, post code or zip code, Device ID, IP address and email address.\n\nFor more information, review [New Relic’s General Data Privacy Notice](https://newrelic.com/termsandconditions/privacy).\n\n## Contribute\n\nWe encourage your contributions to improve the Go Agent!  Keep in mind when you submit your pull request, you'll need to sign the CLA via the click-through using CLA-Assistant.  You only have to sign the CLA one time per project.  \n\nIf you have any questions, or to execute our corporate CLA, required if your contribution is on behalf of a company, please drop us an email at opensource@newrelic.com.\n\n\n**A note about vulnerabilities**\n\nAs noted in our [security policy](https://github.com/newrelic/go-agent/security/policy), New Relic is committed to the privacy and security of our customers and their data. We believe that providing coordinated disclosure by security researchers and engaging with the security community are important means to achieve our security goals.\n\nIf you believe you have found a security vulnerability in this project or any of New Relic's products or websites, we welcome and greatly appreciate you reporting it to New Relic through [HackerOne](https://hackerone.com/newrelic).\n\nIf you would like to contribute to this project, please review [these guidelines](./CONTRIBUTING.md).\n\nTo [all contributors](https://github.com/newrelic/go-agent/graphs/contributors), we thank you!  Without your contribution, this project would not be what it is today.  We also host a community project page dedicated to \nthe [Go Agent](https://opensource.newrelic.com/projects/newrelic/go-agent).\n\n## License\nThe New Relic Go agent is licensed under the [Apache 2.0](http://apache.org/licenses/LICENSE-2.0.txt) License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fframer%2Fgo-agent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fframer%2Fgo-agent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fframer%2Fgo-agent/lists"}