Skip to content

Commit 0ef89ed

Browse files
committed
chore: Update comments
1 parent df3480b commit 0ef89ed

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

v3/integrations/nrawssdk-v2/example/main.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,14 @@ func main() {
5454
}
5555

5656
s3Client := s3.NewFromConfig(awsConfig)
57+
// If you want to instrument per request pass InitializeMiddleware in an optional
58+
// function with the resolved awsConfig.Credentials
59+
// output, err := s3Client.ListBuckets(ctx, nil, func(o *s3.Options) {
60+
// nrawssdk.InitializeMiddleware(&o.APIOptions, ctx, awsConfig.Credentials)
61+
// if err != nil {
62+
// log.Fatal(err)
63+
// }
64+
// })
5765
output, err := s3Client.ListBuckets(ctx, nil)
5866
if err != nil {
5967
log.Fatal(err)

v3/integrations/nrawssdk-v2/nrawssdk.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ func AppendMiddlewares(apiOptions *[]func(*smithymiddle.Stack) error, txn *newre
197197
// if err != nil {
198198
// log.Fatal(err)
199199
// }
200-
// nrawssdk.InitializeMiddleware(awsConfig, nil, awsConfig.Credentials)
200+
// nrawssdk.InitializeMiddleware(awsConfig, ctx, awsConfig.Credentials)
201201
//
202202
// The middleware can also be added later, per AWS service call using
203203
// the `optFns` parameter. For example:
@@ -215,7 +215,7 @@ func AppendMiddlewares(apiOptions *[]func(*smithymiddle.Stack) error, txn *newre
215215
//
216216
// txn := loadNewRelicTransaction()
217217
// output, err := s3Client.ListBuckets(ctx, nil, func(o *s3.Options) error {
218-
// nrawssdk.AppendMiddlewares(&o.APIOptions, txn, o.Credentials)
218+
// nrawssdk.InitializeMiddlewares(&o.APIOptions, ctx, wsConfig.Credential)
219219
// return nil
220220
// })
221221
// if err != nil {

v3/newrelic/config.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ type Config struct {
9494
MaxSamplesStored int
9595
}
9696

97+
// CloudAWS allows the setting of the AccountID and the enabling/disabling
98+
// of AccountID decoding using the AWS access key
9799
CloudAWS struct {
98100
AccountID string
99101
AccountDecoding struct {

0 commit comments

Comments
 (0)