Skip to content

internet-latency-collector: add aws reachability package - #4313

Draft
thijsvanemmerik wants to merge 1 commit into
tve/cloud-latency-02-node-file-loaderfrom
tve/cloud-latency-03-aws-reachability
Draft

thijsvanemmerik wants to merge 1 commit into
tve/cloud-latency-02-node-file-loaderfrom
tve/cloud-latency-03-aws-reachability

Conversation

@thijsvanemmerik

Copy link
Copy Markdown
Contributor

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 for
reachability testing and picks an address in a given region that does answer.

The package fetches and parses http://ec2-reachability.amazonaws.com/prefixes-ipv4.json into one
sorted 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-1 does not fold into us-west-2 and end up handing out an address in the wrong
place.

Nothing calls the package yet, so nothing changes in production.

Test: go test ./controlplane/internet-latency-collector/internal/awsreach/. The tests use a fake
HTTP client and a fake ping, so no network is needed.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant