3.4.0
New Features
Attribute
http.statusCodehas been added to external span events representing the status code on an http response. This attribute will be included when added to an ExternalSegment in one of these three ways:- Using
NewRoundTripperwith your http.Client - Including the http.Response as a field on your
ExternalSegment - Using the new
ExternalSegment.SetStatusCodeAPI to set the status code directly
To exclude the
http.statusCodeattribute from span events, update your agent configuration like so, wherecfgis yournewrelic.Configobject.cfg.SpanEvents.Attributes.Exclude = append(cfg.SpanEvents.Attributes.Exclude, newrelic.SpanAttributeHTTPStatusCode)- Using
Error attributes
error.classanderror.messageare now included on the span event in which the error was noticed, or on the root span if an error occurs in a transaction with no segments (no chid spans). Only the most recent error information is added to the attributes; prior errors on the same span are overwritten.To exclude the
error.classand/orerror.messageattributes from span events, update your agent configuration like so, wherecfgis yournewrelic.Configobject.cfg.SpanEvents.Attributes.Exclude = append(cfg.SpanEvents.Attributes.Exclude, newrelic.newrelic.SpanAttributeErrorClass, newrelic.SpanAttributeErrorMessage)
Changes
Use
Context.FullPath()for transaction names when using Gin version 1.5.0 or greater. Gin transactions were formerly named after theContext.HandlerName(), which uses reflection. This change improves transaction naming and reduces overhead. Please note that because your transaction names will change, you may have to update any related dashboards and alerts to match the new name.// Transactions previously named"GET main.handleGetUsers"// will be change to something like this match the full path"GET /user/:id"
3.3.0
New Features
Added support for GraphQL in two new integrations:
Added database instrumentation support for snowflakedb/gosnowflake.
Changes
- When using
newrelic.StartExternalSegmentornewrelic.NewRoundTripper, if existing cross application tracing or distributed tracing headers are present on the request, they will be replaced instead of added. - The
FromContextAPI which allows you to pull a Transaction from a context.Context will no longer panic if the provided context is nil. In this case, a nil is returned.
Known Issues and Workarounds
If a .NET agent is initiating distributed traces as the root service, you must update that .NET agent to version 8.24 or later before upgrading your downstream Go New Relic agents to this agent release.
3.2.0
New Features
- Added support for
v7of go-redis/redis in the new v3/integrations/nrredis-v7 package.
Changes
Updated Gorilla instrumentation to include request time spent in middlewares. Added new
nrgorilla.Middlewareand deprecatednrgorilla.InstrumentRoutes. Register the new middleware as your first middleware usingRouter.Use. See the godocs examples for more details.r := mux.NewRouter()// Always register the nrgorilla.Middleware first.r.Use(nrgorilla.Middleware(app))// All handlers and custom middlewares will be instrumented. The// transaction will be available in the Request's context.r.Use(MyCustomMiddleware)r.Handle("/", makeHandler("index"))// The NotFoundHandler and MethodNotAllowedHandler must be instrumented// separately using newrelic.WrapHandle. The second argument to// newrelic.WrapHandle is used as the transaction name; the string returned// from newrelic.WrapHandle should be ignored._, r.NotFoundHandler = newrelic.WrapHandle(app, "NotFoundHandler", makeHandler("not found"))_, r.MethodNotAllowedHandler = newrelic.WrapHandle(app, "MethodNotAllowedHandler", makeHandler("method not allowed"))http.ListenAndServe(":8000", r)
Known Issues and Workarounds
If a .NET agent is initiating distributed traces as the root service, you must update that .NET agent to version 8.24 or later before upgrading your downstream Go New Relic agents to this agent release.
New Features
Support for W3C Trace Context, with easy upgrade from New Relic trace context.
Distributed Tracing now supports W3C Trace Context headers for HTTP and gRPC protocols when distributed tracing is enabled. Our implementation can accept and emit both W3C trace header format and New Relic trace header format. This simplifies agent upgrades, allowing trace context to be propagated between services with older and newer releases of New Relic agents. W3C trace header format will always be accepted and emitted. New Relic trace header format will be accepted, and you can optionally disable emission of the New Relic trace header format.
When distributed tracing is enabled with
Config.DistributedTracer.Enabled = true, the Go agent will now accept W3C'straceparentandtracestateheaders when callingTransaction.AcceptDistributedTraceHeaders. When callingTransaction.InsertDistributedTraceHeaders, the Go agent will include the W3C headers along with the New Relic distributed tracing header, unless the New Relic trace header format is disabled usingConfig.DistributedTracer.ExcludeNewRelicHeader = true.Also, see Knowns Issues and Workarounds.
Added support for elastic/go-elasticsearch in the new v3/integrations/nrelasticsearch-v7 package.
Known Issues and Workarounds
If a .NET agent is initiating distributed traces as the root service, you must update that .NET agent to version 8.24 or later before upgrading your downstream Go New Relic agents to this agent release.
3.0.0
We are pleased to announce the release of Go Agent v3.0.0! This is a major release that includes some breaking changes that will simplify your future use of the Go Agent.
Please pay close attention to the list of Changes.
Changes
- A full list of changes and a step by step checklist on how to upgrade can be found in the v3 Migration Guide.
New Features
- Support for Go Modules. Our Go agent integration packages support frameworks and libraries which are changing over time. With support for Go Modules, we are now able to release instrumentation packages for multiple versions of frameworks and libraries with a single agent release; and support operation of the Go agent in Go Modules environments. This affects naming of our integration packages, as described in the v3 Migration Guide (see under "Changes" above).
- Detect and set hostnames based on Heroku dyno names. When deploying an application in Heroku, the hostnames collected will now match the dyno name. This serves to greatly improve the usability of the servers list in APM since dyno names are often sporadic or fleeting in nature. The feature is controlled by two new configuration options
Config.Heroku.UseDynoNamesandConfig.Heroku.DynoNamePrefixesToShorten.
Notes
New Relic's Go agent v3.0 is currently available for review and beta testing. Your use of this pre-release is at your own risk. New Relic disclaims all warranties, express or implied, regarding the beta release.
If you do not manually take steps to use the new v3 folder you will not see any changes in your agent.
This is the third release of the pre-release of Go agent v3.0. It includes changes due to user feedback during the pre-release. The existing agent in`"github.com/newrelic/go-agent"` is unchanged.
Fixes
The Go agent v3.0 code in the v3 folder has the following changes:
- A ConfigFromEnvironment bug has been fixed.
2.16.2
New Relic's Go agent v3.0 is currently available for review and beta testing. Your use of this pre-release is at your own risk. New Relic disclaims all warranties, express or implied, regarding the beta release.
If you do not manually take steps to use the new v3 folder you will not see any changes in your agent.
This is the second release of the pre-release of Go agent v3.0. It includes changes due to user feedback during the pre-release. The existing agent in "github.com/newrelic/go-agent" is unchanged. The Go agent v3.0 code in the v3 folder has the following changes:
Transaction names created by
WrapHandle,WrapHandleFunc, nrecho-v3, nrecho-v4, nrgorilla, and nrgin now include the HTTP method. For example, the following code:http.HandleFunc(newrelic.WrapHandleFunc(app, "/users", usersHandler))now creates a metric called
WebTransaction/Go/GET /usersinstead ofWebTransaction/Go/users. As a result of this change, you may need to update your alerts and dashboards.The ConfigFromEnvironment config option is now strict. If one of the environment variables, such as
NEW_RELIC_DISTRIBUTED_TRACING_ENABLED, cannot be parsed, thenConfig.Errorwill be populated and NewApplication will return an error.ConfigFromEnvironment now processes
NEW_RELIC_ATTRIBUTES_EXCLUDEandNEW_RELIC_ATTRIBUTES_INCLUDE.
2.16.1
L’agent Go v3.0 de New Relic est actuellement disponible pour évaluation et tests bêta. Votre utilisation de cette préversion est à vos propres risques. New Relic décline toute garantie, expresse ou implicite, concernant la sortie bêta.
Si vous ne prenez pas manuellement les mesures nécessaires pour utiliser le nouveau dossier v3, comme décrit ci-dessous, vous ne verrez aucun changement dans votre agent.
Cette sortie 2.16.1 inclut un nouveau dossier v3.0 qui contient la pré-sortie de l’agent Go v3.0 ; l’agent Go v3.0 inclut des changements majeurs. Nous sollicitons vos commentaires et espérons que vous examinerez ceci et testerez les modifications avant la sortie officielle.
Il ne s’agit pas d’une sortie 3.0 officielle, c’est juste un moyen de recueillir des commentaires sur les modifications proposées. Il n’a pas le tag 3.0 dans Github, et la sortie 3.0 n’est pas encore disponible pour la mise à jour dans votre fichier Go mod. Afin de tester ces modifications, vous devrez cloner ce référentiel (repository) dans votre répertoire source Go, sous [go-src-dir]/src/github.com/newrelic/go-agent. Une fois que vous avez extrait la source, vous devrez suivre les étapes de la deuxième section de v3/MIGRATION.md.
Une liste des modifications et des instructions d’installation est incluse dans le dossier v3 et peut être consultée ici
Pour cette version de pré-sortie (bêta) de l’agent Go v3.0, veuillez noter :
- Les modifications dans le dossier v3 représentent ce que nous prévoyons de sortir dans {'-'}2 semaines pour notre sortie majeure 3.0. Cependant, comme nous sollicitons des retours sur les modifications, et qu’il existe une possibilité de changements majeurs avant la sortie officielle.
- Il ne s’agit pas d’une sortie 3.0 officielle ; elle n’a pas le tag 3.0 dans Github et la sortie 3.0 n’est pas encore disponible pour la mise à jour dans votre fichier Go mod.
- Si vous testez ces modifications et rencontrez des problèmes, des questions, ou avez des commentaires que vous aimeriez transmettre, veuillez ouvrir un ticket ici et assurez-vous d’inclure le label
3.0.- Pour les normaux (non 3.0) problèmes/questions, nous vous demandons de les signaler via notre site d’assistance ou notre forum de la communauté. Veuillez signaler uniquement les questions liées à la pré-sortie 3.0 directement via GitHub.
Nouvelle fonctionnalité
La V3 ajoutera la prise en charge des modules Go. Les fichiers go.mod existent dans le dossier v3, mais ils ne seront pas utilisables tant que nous n’aurons pas officiellement tagué la sortie 3.0. Les exemples de tags de version que nous prévoyons d’utiliser pour différents modules incluent :
v3.0.0v3/integrations/nrecho-v3/v1.0.0v3/integrations/nrecho-v4/v1.0.0
Changements
- Les modifications sont celles sur lesquelles nous avons précédemment demandé des commentaires dans ce ticket.
- Une liste complète des modifications incluses, ainsi qu’une liste de contrôle pour la mise à niveau, est disponible dans v3/MIGRATION.md.
2.16.0
Upcoming
- The next release of the Go Agent is expected to be a major version release to improve the API and incorporate Go modules. Details available here: https://github.com/newrelic/go-agent/issues/106 We would love your feedback!
Bug Fixes
- Fixed an issue in the nrhttprouter integration where the transaction was not being added to the requests context. This resulted in an inability to access the transaction from within an httprouter.Handle function. This issue has now been fixed.