Per https://aws.amazon.com/xray/faqs/:
Q: My application components run in their own AWS accounts. Can I use X-Ray to collect data across AWS accounts?
Yes, the X-Ray agent can assume a role to publish data into an account different from the one in which it is running. This enables you publish data from various components of your application into a central account.
I know that I can assume a role like so:
st := sts.NewFromConfig(awsConf)
creds := stscreds.NewAssumeRoleProvider(st, "myRoleArn")
awsConf.Credentials = aws.NewCredentialsCache(creds)
I know that I can create an xray service using those creds:
import xrayv2 "github.com/aws/aws-sdk-go-v2/service/xray"
xrayService := xrayv2.NewFromConfig(awsConf)
The problem is that the xray service is made for interacting directly with the xray API, it doesn't have any of the wonderful magic that the xray client provides. The xray client I know is configured this way:
import "github.com/aws/aws-xray-sdk-go/xray"
xray.Configure(xray.Config{
DaemonAddr: "",
ServiceVersion: "",
Emitter: nil,
SamplingStrategy: nil,
StreamingStrategy: nil,
ExceptionFormattingStrategy: nil,
ContextMissingStrategy: nil,
LogLevel: "",
LogFormat: "",
})
Regardless of if I was using the aws or aws-v2 library, I don't see a place where I can provide the xray client any sort of aws conf / credential provider. I can create a custom emitter, but I was hoping to avoid that.
Any ideas on how I might provide a credentials cache to github.com/aws/aws-xray-sdk-go/xray
?