amazon-cloudwatch-agent icon indicating copy to clipboard operation
amazon-cloudwatch-agent copied to clipboard

Target Allocator Support for Native Prometheus Receiver

Open okankoAMZ opened this issue 1 year ago • 1 comments

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.

CloudWatch Metrics ScreenShot

Requirements

Before commit the code, please do the following steps.

  1. Run make fmt and make fmt-sh
  2. Run make lint

okankoAMZ avatar Oct 15 '24 17:10 okankoAMZ

Fixed my nits so that the asked change is clear.

musa-asad avatar Oct 23 '24 02:10 musa-asad

Approving from prior reviews

sky333999 avatar Nov 13 '24 20:11 sky333999