amazon-cloudwatch-agent
amazon-cloudwatch-agent copied to clipboard
Target Allocator Support for Native Prometheus Receiver
Description of the issue
We have a new tool called Target Allocator, which provides scrape configs. These changes allows telegraf based prometheus receiver to pull scrape configs from Target Allocator endpoint.
There was a bug on config returning if TA exist instead of does not exist on this PR(#1390) thus reverted and created this one.
Description of changes
- Added Target Allocator Manager(TAM), based on contrib version but with a wrapper
- TAM is now included and checked during initial and reload configs to make sure TA is enabled or disabled.
- When TA is enabled the TAM will provide the prometheus config to telegraf prometheus receiver directly. (without a file read)
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
- Added some unit tests which pass
- Manually tested where I can see metrics on CloudWatch when Agent is deployed.
Requirements
Before commit the code, please do the following steps.
- Run
make fmtandmake fmt-sh - Run
make lint
Fixed my nits so that the asked change is clear.
Approving from prior reviews