Documentation
¶
Overview ¶
Package nrawssdk instruments requests made by the https://github.com/aws/aws-sdk-go-v2 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.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendMiddlewares ¶
func AppendMiddlewares(apiOptions *[]func(*smithymiddle.Stack) error, txn *oldfritter.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 `oldfritter.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 { log.Fatal(err) } 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 { log.Fatal(err) } ... txn := loadNewRelicTransaction() nraws.AppendMiddlewares(&awsConfig.APIOptions, txn)
Types ¶
This section is empty.