Giter VIP home page Giter VIP logo

Comments (8)

IvanovOleg avatar IvanovOleg commented on July 1, 2024 1

@a-thorat Yes, SM was my backup plan.

from cluster-monitoring-operator.

a-thorat avatar a-thorat commented on July 1, 2024

@IvanovOleg
You can configure additional scrape spec config under prometheus cr names k8s using secret key value.

additionalScrapeConfigs:
key: opa-exporter-config.yaml
name: opa-exporter
optional: true

secret could be like this
opa-exporter-config.yaml
job_name: opa-exporter
kubernetes_sd_configs:

  • role: service

Additionally you can refer this page https://prometheus.io/docs/prometheus/latest/configuration/configuration/#scrape_config

from cluster-monitoring-operator.

IvanovOleg avatar IvanovOleg commented on July 1, 2024

@a-thorat that configuration will be removed on the next reconciliation (in several minutes) as I described above.

from cluster-monitoring-operator.

a-thorat avatar a-thorat commented on July 1, 2024

@IvanovOleg i am sure you might have explored ServiceMonitor CR as well for metrics scraping with service? Not sure this will help but just trying a lil bit.

I tried to configure SM CR and checked prometheus-k8s got this reflected in config file
/etc/prometheus/config_out/prometheus.env.yaml

  • job_name: serviceMonitor/opa-monitoring/prometheus-opa-exporter-mon/0
    honor_labels: false
    kubernetes_sd_configs:
    • role: endpoints
      namespaces:
      names:
      - opa-monitoring
      scrape_interval: 30s
      scheme: http
      relabel_configs:
    • source_labels:
      • job
        target_label: __tmp_prometheus_job_name
    • action: keep
      source_labels:
      • __meta_kubernetes_service_label_app
      • __meta_kubernetes_service_labelpresent_app
        regex: (opa-exporter);true
    • action: keep
      source_labels:
      • __meta_kubernetes_endpoint_port_name
        regex: "9141"
    • source_labels:
      • __meta_kubernetes_endpoint_address_target_kind
      • __meta_kubernetes_endpoint_address_target_name
        separator: ;
        regex: Node;(.*)
        replacement: ${1}
        target_label: node
    • source_labels:
      • __meta_kubernetes_endpoint_address_target_kind
      • __meta_kubernetes_endpoint_address_target_name
        separator: ;
        regex: Pod;(.*)
        replacement: ${1}
        target_label: pod
    • source_labels:
      • __meta_kubernetes_namespace
        target_label: namespace
      • source_labels:
        • __meta_kubernetes_service_name
          target_label: service
    • source_labels:
      • __meta_kubernetes_pod_name
        target_label: pod
    • source_labels:
      • __meta_kubernetes_pod_container_name
        target_label: container
    • action: drop
      source_labels:
      • __meta_kubernetes_pod_phase
        regex: (Failed|Succeeded)
        metric_relabel_configs: []

from cluster-monitoring-operator.

openshift-bot avatar openshift-bot commented on July 1, 2024

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

from cluster-monitoring-operator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.