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

fix: Optimize Prometheus scrape target discovery #1663

Conversation

hisarbalik
Copy link
Contributor

@hisarbalik hisarbalik commented Dec 7, 2024

Description

A MetricPipeline using the input prometheus on a cluster with an high amount of pods will result in a DaemonSet of the telemetry-agent where every instance will consume high memory, even if not data get processed.
Every single agent is processing only the pods located on the related node, however, the discovery mechanism does not respect the node sharding and will discover all pods. This problem gets fixed by this PR by adjusting the discovery to exclude already pods not located on the same node as the agent.

Changes proposed in this pull request (what was done and why):

  • The metric agent should discover the scrape targets deployed on the same node as the agent instance is running, this will reduce memory and CPU consumption on larger clusters significant. Configuration documentation can be found here

Changes refer to particular issues, PRs or documents:

Traceability

  • The PR is linked to a GitHub issue.
  • The follow-up issues (if any) are linked in the Related Issues section.
  • If the change is user-facing, the documentation has been adjusted.
  • If a CRD is changed, the corresponding Busola ConfigMap has been adjusted.
  • The feature is unit-tested.
  • The feature is e2e-tested.

@hisarbalik hisarbalik requested a review from a team as a code owner December 7, 2024 17:27
@kyma-bot kyma-bot added cla: yes Indicates the PR's author has signed the CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 7, 2024
@hisarbalik hisarbalik added this to the 1.30.0 milestone Dec 7, 2024
@hisarbalik hisarbalik added kind/bug Categorizes issue or PR as related to a bug. area/metrics MetricPipeline labels Dec 7, 2024
@hisarbalik hisarbalik changed the title fix: Optimize Prometheus resource discovery fix: Optimize Prometheus scrape target discovery Dec 9, 2024
@k15r k15r self-assigned this Dec 9, 2024
@kyma-bot kyma-bot added the lgtm Looks good to me! label Dec 10, 2024
@hisarbalik hisarbalik merged commit 502f50f into kyma-project:main Dec 10, 2024
41 of 42 checks passed
@hisarbalik hisarbalik deleted the fix-metric-agent-promethues-scrape-config branch December 10, 2024 08:00
hisarbalik added a commit to hisarbalik/telemetry-manager that referenced this pull request Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/metrics MetricPipeline cla: yes Indicates the PR's author has signed the CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm Looks good to me! size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants