2.6.0
New Features
Added support for async: the ability to instrument multiple concurrent goroutines, or goroutines that access or manipulate the same Transaction.
The new
Transaction.NewGoroutine() Transactionmethod allows transactions to create segments in multiple goroutines!NewGoroutinereturns a new reference to theTransaction. This must be called any time you are passing theTransactionto another goroutine which makes segments. Each segment-creating goroutine must have its ownTransactionreference. It does not matter if you call this before or after the other goroutine has started.All
Transactionmethods can be used in anyTransactionreference. TheTransactionwill end whenEnd()is called in any goroutine.Example passing a new
Transactionreference directly to another goroutine:go func(txn newrelic.Transaction) {defer newrelic.StartSegment(txn, "async").End()time.Sleep(100 * time.Millisecond)}(txn.NewGoroutine())Example passing a new
Transactionreference on a channel to another goroutine:ch := make(chan newrelic.Transaction)go func() {txn := <-chdefer newrelic.StartSegment(txn, "async").End()time.Sleep(100 * time.Millisecond)}()ch <- txn.NewGoroutine()Added integration support for
aws-sdk-goandaws-sdk-go-v2.When using these SDKs, a segment will be created for each out going request. For DynamoDB calls, these will be Datastore segments and for all others they will be External segments.
- v1 Documentation
- v2 Documentation
- Added span event and transaction trace segment attribute configuration. You may control which attributes are captured in span events and transaction trace segments using the
Config.SpanEvents.AttributesandConfig.TransactionTracer.Segments.Attributessettings. For example, if you want to disable the collection of"db.statement"in your span events, modify your config like this:
cfg.SpanEvents.Attributes.Exclude = append(cfg.SpanEvents.Attributes.Exclude,newrelic.SpanAttributeDBStatement)To disable the collection of all attributes from your transaction trace segments, modify your config like this:
cfg.TransactionTracer.Segments.Attributes.Enabled = false
Bug Fixes
- Fixed a bug that would prevent External Segments from being created under certain error conditions related to Cross Application Tracing.
Miscellaneous
Improved linking between Cross Application Transaction Traces in the APM UI. When
Config.CrossApplicationTracer.Enabled = true, External segments in the Transaction Traces details will now link to the downstream Transaction Trace if there is one. Additionally, the segment name will now include the name of the downstream application and the name of the downstream transaction.Update attribute names of Datastore and External segments on Transaction Traces to be in line with attribute names on Spans. Specifically:
"uri"=>"http.url""query"=>"db.statement""database_name"=>"db.instance""host"=>"peer.hostname""port_path_or_id"+"host"=>"peer.address"