awslabs / collectd-cloudwatch

A collectd plugin for sending data to Amazon CloudWatch
MIT License
199 stars 131 forks source link

Detect region correctly in Local Zones #88

Closed nmx closed 4 years ago

nmx commented 4 years ago

The previous logic assumed that the region could always be determined by stripping the last character from the Availability Zone. This is no longer true; for example the Local Zone us-west-2-lax-1a corresponds to the region us-west-2.

Read the region directly from the instance identity document instead.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.