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

[Prometheus][Collector] Support Customizing condition #5259

Closed
BenB196 opened this issue Feb 13, 2023 · 2 comments · Fixed by #5317
Closed

[Prometheus][Collector] Support Customizing condition #5259

BenB196 opened this issue Feb 13, 2023 · 2 comments · Fixed by #5317
Labels
release-pending Team:Cloudnative-Monitoring Label for the Cloud Native Monitoring team [elastic/obs-cloudnative-monitoring]

Comments

@BenB196
Copy link
Contributor

BenB196 commented Feb 13, 2023

Today the Prometheus Collector integration's condition is hardcoded to a bool for leader election:

condition: ${kubernetes_leaderelection.leader} == true

The issue with this is it makes it so that the Prometheus collector integration can't be used for auto-discovery. Similar to other integrations

Example, Istio:

Given that Prometheus is one of the more common methods for exposing metrics within things like Kubernetes, it would be a great value add to be able to define conditions

@tetianakravchenko
Copy link
Contributor

Hi @BenB196.

The issue with this is it makes it so that the Prometheus collector integration can't be used for auto-discovery. Similar to other integrations

In case of prometheus collector you need to provide the list of hosts, that will be scraped by this integration - https://github.com/elastic/integrations/blob/main/packages/prometheus/data_stream/collector/manifest.yml#L6-L13

Could you please explain what issue you are trying to solve with condition field here?

@tetianakravchenko tetianakravchenko added the Team:Cloudnative-Monitoring Label for the Cloud Native Monitoring team [elastic/obs-cloudnative-monitoring] label Feb 18, 2023
@BenB196
Copy link
Contributor Author

BenB196 commented Feb 18, 2023

Hi @tetianakravchenko the issue currently with the Prometheus collector is that you can only provide a static list of hosts. If you want to monitor a deployment on Kubernetes that has multiple (dynamically named) pods, you'll want to scrape all those pods individually. With the current setup, you are unable to achieve this.

However, this does become achievable once you add the ability to set the condition.

The Istio Proxy Metrics is a working example of using the Prometheus Collector, in conjunction with condition to be able to achieve this outcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-pending Team:Cloudnative-Monitoring Label for the Cloud Native Monitoring team [elastic/obs-cloudnative-monitoring]
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants