nrawssdk

package module
Version: v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

README

v3/integrations/nrawssdk-v2 GoDoc

Package nrawssdk instruments https://github.com/aws/aws-sdk-go-v2 requests.

import "github.com/newrelic/go-agent/v3/integrations/nrawssdk-v2"

For more information, see godocs.

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 *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 {
    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.

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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