Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Target Allocator Support for Native Prometheus Receiver #1390

Merged
merged 8 commits into from
Oct 14, 2024

Conversation

okankoAMZ
Copy link
Contributor

@okankoAMZ okankoAMZ commented Oct 14, 2024

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.

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 okankoAMZ marked this pull request as ready for review October 14, 2024 20:52
@okankoAMZ okankoAMZ requested a review from a team as a code owner October 14, 2024 20:52
plugins/inputs/prometheus/target_allocator.go Outdated Show resolved Hide resolved
plugins/inputs/prometheus/target_allocator.go Show resolved Hide resolved
plugins/inputs/prometheus/target_allocator.go Outdated Show resolved Hide resolved
plugins/inputs/prometheus/start.go Outdated Show resolved Hide resolved
@okankoAMZ okankoAMZ merged commit 7a5a026 into target-allocator Oct 14, 2024
@okankoAMZ okankoAMZ deleted the ta-collector branch October 14, 2024 22:26
Copy link
Contributor

@musa-asad musa-asad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

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.

3 participants