Fix support for VolumeId dimension on nitro instances #1728
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.
Description of the issue
Linux allows mounting disks using a device alias (symlink) but the CWAgent is not able to resolve the EBS VolumeId for the device. Fixes #1727.
When PR #1156 implemented support to use
${aws:VolumeId}
for a dimension value, it included extensive normalization of the device name:amazon-cloudwatch-agent/plugins/processors/ec2tagger/internal/volume/volume.go
Lines 109 to 145 in 4123ffc
This linux specific logic runs for all platforms, prevents the device names returned by the
describeVolumesProvider
(DescribeVolumes.Volumes.Attachments
) from being included in the volume cache map. This normalization is not needed for the results of the linuxhostProvider
as it enumerates the devices registered in/sys/block/
.Description of changes
/dev/
) todescribeVolumesProvider.DeviceToSerialMap
method.License
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Tests
Requirements
Before commiting your code, please do the following steps.
make fmt
andmake fmt-sh
make lint
Integration Tests
To run integration tests against this PR, add the
ready for testing
label.