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

ScrapeConfig is not pushed to PrometheusAgent objects #2311

Closed
stijzermans opened this issue Sep 4, 2024 · 0 comments
Closed

ScrapeConfig is not pushed to PrometheusAgent objects #2311

stijzermans opened this issue Sep 4, 2024 · 0 comments
Labels
community enhancement New feature or request fixed

Comments

@stijzermans
Copy link
Contributor

Is your feature request related to a problem? Please describe.
When using Prometheus in Agent mode, scrape configs are not pushed by the operator. The operator logs the following message:

main-controller.go:1546] error syncing 'infra-minio/minio': prometheuses.monitoring.coreos.com "prometheus-grafana-kube-pr-prometheus" not found

My prometheus is running with the following deployment.

apiVersion: monitoring.coreos.com/v1alpha1
kind: PrometheusAgent
metadata:
  name: prometheus-grafana-kube-pr-prometheus
  namespace: infra-monitoring
spec:
  ...

Operator is configured as following:

  values:
    operator:
      env:
        - name: PROMETHEUS_NAMESPACE
          value: "infra-monitoring"
        - name: PROMETHEUS_NAME
          value: "prometheus-grafana-kube-pr-prometheus"
        - name: WATCHED_NAMESPACE
          value: "infra-minio"

When running the operator with the same configuration, but Prometheus running as kind: Prometheus, it does work as expected.

Describe the solution you'd like
Both prometheuses.monitoring.coreos.com and prometheusagents.monitoring.coreos.com should be considered when searching for PROMETHEUS_NAME and pushing scraping config, not just prometheuses.monitoring.coreos.com

Describe alternatives you've considered
Using manual deployment of a probe (such as #2067) or a manual scrape config, but this removes the purpose of this functionality to dynamically provision this.

Can also mount the additionalScrapeConfigsSecret on PrometheusAgent, but that is be limited to a single scrape config secret.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community enhancement New feature or request fixed
Projects
None yet
Development

No branches or pull requests

3 participants