aws-xray-sdk-go icon indicating copy to clipboard operation
aws-xray-sdk-go copied to clipboard

If configured with hostnames, use hostnames when getting sampling rules

Open jamiecuthill opened this issue 3 years ago • 4 comments

We have an interesting setup where by we would prefer that requests to get sampling rules was using the configured hostname for the daemon rather than the resolved IP address.

As per the allowed configuration we are using "udp:hostname:2000 tcp:hostname:2001" where hostname is our internal cluster daemon hostname.

When the XRay service is constructed the endpoint resolved is setup to use the IP and Port from the resolved daemon configuration.

Is there a reason for this configuration not to use the configured hostname?

jamiecuthill avatar Apr 01 '21 15:04 jamiecuthill

If I understand the question then probably you're asking if SDK should be able to resolve hostname of your environment where daemon is running? If that is the case then I think SDK should be able to use that hostname and port as long as you use allowed configuration format. Here is the method of parsing such double address.

bhautikpip avatar Apr 01 '21 21:04 bhautikpip

My team and I use a single xray daemon for our entire environment, hosted on Fargate. If we push a config change, that causes the IP to change and as a result upstream resources fail to send xray data because (it appears) to cache the IP which the hostname initially resolved to at launch.

This code returns a static IP address. This seems unnecessary from the start, but it would be nice to simply send the telemetry data to the actual domain and port specified rather than the IP that it initially resolves to.

edwardofclt avatar Apr 16 '21 20:04 edwardofclt

Hi @edwardofclt , This looks like an enhancement. I think this is a reasonable ask. I will add this item in our backlog. Meanwhile, Feel free to contribute and let me know If I can help in any way :)

bhautikpip avatar May 03 '21 19:05 bhautikpip

Hey @bhautikpip, just checking in here; is there anything I can do to help move this along?

edwardofclt avatar Jan 23 '22 04:01 edwardofclt