package module
v1.2.2 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Aug 10, 2023 License: Apache-2.0 Imports: 7 Imported by: 0


v3/integrations/nrawssdk-v2 GoDoc

Package nrawssdk instruments requests.

import ""

For more information, see godocs.



Package nrawssdk instruments requests made by the library.

For most operations, external segments and spans are automatically created for display in the New Relic UI on the External services section. For DynamoDB operations, datastore segements and spans are created and will be displayed on the Databases page. All operations will also be displayed on transaction traces and distributed traces.

To use this integration, simply apply the AppendMiddlewares fuction to the apiOptions in your AWS Config object before performing any AWS operations. See example/main.go for a working sample.



This section is empty.


This section is empty.


func AppendMiddlewares

func AppendMiddlewares(apiOptions *[]func(*smithymiddle.Stack) error, txn *newrelic.Transaction)

AppendMiddlewares inserts New Relic middleware in the given `apiOptions` for the AWS SDK V2 for Go. It must be called only once per AWS configuration.

If `txn` is provided as nil, the New Relic transaction will be retrieved using `newrelic.FromContext`.

Additional attributes will be added to transaction trace segments and span events: aws.region, aws.requestId, and aws.operation. In addition, http.statusCode will be added to span events.

To see segments and spans for all AWS invocations, call AppendMiddlewares with the AWS Config `apiOptions` and provide nil for `txn`. For example:

awsConfig, err := config.LoadDefaultConfig(ctx)
if err != nil {
nraws.AppendMiddlewares(&awsConfig.APIOptions, nil)

If do not want the transaction to be retrived from the context, you can explicitly set `txn`. For example:

awsConfig, err := config.LoadDefaultConfig(ctx)
if err != nil {


txn := loadNewRelicTransaction()
nraws.AppendMiddlewares(&awsConfig.APIOptions, txn)


This section is empty.


Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL