2.1.0 New
Go Agent now supports distributed tracing
Distributed tracing lets you see the path that a request takes as it travels through your distributed system. By showing the distributed activity through a unified view, you can troubleshoot and understand a complex system better than ever before.
Distributed tracing is available with an APM Pro or equivalent subscription. To see a complete distributed trace, you need to enable the feature on a set of neighboring services. Enabling distributed tracing changes the behavior of some New Relic features, so carefully consult the transition guide before you enable this feature.
To enable distributed tracing, set the following fields in your config. Note that distributed tracing and cross application tracing cannot be used simultaneously.
config := newrelic.NewConfig("Your Application Name", "__YOUR_NEW_RELIC_LICENSE_KEY__") config.CrossApplicationTracer.Enabled = false config.DistributedTracer.Enabled = true
Please refer to the distributed tracing section of the guide for more detail on how to ensure you get the most out of the Go agent's distributed tracing support.
New distributed trace calls/functions
Added functions NewContext and FromContext for adding and retrieving the Transaction from a Context. Handlers instrumented by WrapHandle, WrapHandleFunc, and nrgorilla.InstrumentRoutes may use FromContext on the request's context to access the Transaction. Thanks to @caarlos0 for the contribution! Though NewContext and FromContext require Go 1.7+ (when context was added), RequestWithTransactionContext is always exported so that it can be used in all framework and library instrumentation.
2.0.0 New
The
End()
functions defined on theSegment
,DatastoreSegment
, andExternalSegment
types now receive the segment as a pointer, rather than as a value. This prevents unexpected behaviour when a call toEnd()
is deferred before one or more fields are changed on the segment.In practice, this is likely to only affect this pattern:
defer newrelic.DatastoreSegment{// ...}.End()Instead, you will now need to separate the literal from the deferred call:
ds := newrelic.DatastoreSegment{// ...}defer ds.End()When creating custom and external segments, we recommend using
newrelic.StartSegment()
andnewrelic.StartExternalSegment()
, respectively.Added GoDoc badge to README. Thanks to @mrhwick for the contribution!
Config.UseTLS
configuration setting has been removed to increase security. TLS will now always be used in communication with New Relic Servers.
New Features
- Added support for Cross Application Tracing (CAT). Please refer to the upgrading section of the guide for more detail on how to ensure you get the most out of the Go agent's new CAT support.
- The agent now collects additional metadata when running within Amazon Web Services, Google Cloud Platform, Microsoft Azure, and Pivotal Cloud Foundry. This information is used to provide an enhanced experience when the agent is deployed on those platforms.
New
- Added new RecordCustomMetric method to Application. This functionality can be used to track averages or counters without using custom events. See Custom Metric Documentation
- Fixed import needed for
logrus
. The importSirupsen/logrus
had been renamed tosirupsen/logrus
. Thanks to @alfred-landrum for spotting this. - Added ErrorAttributer, an optional interface that can be implemented by errors provided to
Transaction.NoticeError
to attach additional attributes. These attributes are subject to attribute configuration. - Added Error, a type that allows direct control of error fields.
- Updated license to address scope of usage.
New
- Added support for github.com/gin-gonic/gin in the new
nrgin
package.
Notes
- Fixed incorrect metric rule application when the metric rule is flagged to terminate and matches but the name is unchanged.
Segment.End()
,DatastoreSegment.End()
, andExternalSegment.End()
methods now return an error which may be helpful in diagnosing situations where segment data is unexpectedly missing.
Notes
- Added support for gorilla/mux in the new
nrgorilla
package.
Notes
Added support for custom error messages and stack traces. Errors provided to
Transaction.NoticeError
will now be checked to see if they implement ErrorClasser and/or StackTracer. Thanks to @fgrosse for this proposal.Added support for pkg/errors. Thanks to @fgrosse for this work.
Fixed tests for Go 1.8.
Notes
- Added support for slow query traces. Slow datastore segments will now generate slow query traces viewable on the datastore tab. These traces include a stack trace and help you to debug slow datastore activity.
- Added new DatastoreSegment fields
ParameterizedQuery
,QueryParameters
,Host
,PortPathOrID
, andDatabaseName
. These fields will be shown in transaction traces and in slow query traces.
Notes
- Added a timeout parameter to the Application.Shutdown method.