go-agent
go-agent copied to clipboard
External Services(AWS sdk go v2 ) api calls are not logged / visible when using github.com/newrelic/go-agent/v3/integrations/nrawssdk-v
Description
External Services(AWS sdk go v2 ) api calls are not logged / visible when using github.com/newrelic/go-agent/v3/integrations/nrawssdk-v2 . I tried to log external api calls to s3 and sqs but the requests are not logged or shown in. newrelic ui
Steps to Reproduce
This is the code I Tried
txn := instrumentation.GetNewRelic().StartTransaction("S3_API")
defer txn.End()
cfg, err := config.LoadDefaultConfig(context.TODO())
if err != nil {
fmt.Println("Error loading AWS config:", err)
}
nrAsg.AppendMiddlewares(&cfg.APIOptions, txn)
sqsClient = sqs.NewFromConfig(cfg)
return sqsClient, err
That's strange. Do you see them being logged if you try running the example file here
Hi @ARKKYN we had a PR that reported something similar, and I was wondering if you had tried this: https://github.com/newrelic/go-agent/pull/599/files
specifically this part:
awsConfig, err := config.LoadDefaultConfig(ctx, func(awsConfig *config.LoadOptions) error {
// Instrument all new AWS clients with New Relic
nrawssdk.AppendMiddlewares(&awsConfig.APIOptions, nil)
return nil
})