internet-latency-collector: add aws reachability package - #4313
Draft
thijsvanemmerik wants to merge 1 commit into
Draft
thijsvanemmerik wants to merge 1 commit into
thijsvanemmerik wants to merge 1 commit into
Conversation
Fetches the AWS published address list, keys the prefixes by exact region name so a Local Zone such as us-west-2-lax-1 keeps its own key, and pings candidate addresses in order to find the first that answers. Self-contained; no collector changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of measuring latency between AWS regions with the internet latency collector.
RIPE Atlas probes hosted inside AWS regions do not answer ping, so a measurement aimed at one gets
nothing back. This adds
internal/awsreach, which reads the address list AWS publishes forreachability testing and picks an address in a given region that does answer.
The package fetches and parses
http://ec2-reachability.amazonaws.com/prefixes-ipv4.jsoninto onesorted list of IPv4 addresses per region key, then pings candidates in order and returns the first
that answers, up to an attempt cap. The URL is plain HTTP on purpose: the https address redirects
back to http. Region keys are kept exactly as AWS writes them, so a Local Zone such as
us-west-2-lax-1does not fold intous-west-2and end up handing out an address in the wrongplace.
Nothing calls the package yet, so nothing changes in production.
Test:
go test ./controlplane/internet-latency-collector/internal/awsreach/. The tests use a fakeHTTP client and a fake ping, so no network is needed.