go-agent icon indicating copy to clipboard operation
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

Open ARKKYN opened this issue 1 year ago • 3 comments

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

ARKKYN avatar Oct 12 '23 07:10 ARKKYN

That's strange. Do you see them being logged if you try running the example file here

mirackara avatar Oct 19 '23 17:10 mirackara

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

iamemilio avatar Dec 21 '23 15:12 iamemilio

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
 	})

iamemilio avatar Dec 21 '23 15:12 iamemilio