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"