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

how to automate add the new Node Exporters to the targets array of prometheus.yml #2881

Closed
bdonth opened this Issue Jun 27, 2017 · 2 comments

Comments

Projects
None yet
3 participants
@bdonth
Copy link

bdonth commented Jun 27, 2017

i have basic prometheus.yml file in my environment i.e ..

###
 apiVersion: v1
 kind: ConfigMap
 metadata:
   creationTimestamp: null
   name: prometheus-core
 data:
   prometheus.yml: |
     global:
       scrape_interval: 10s
       scrape_timeout: 10s
       evaluation_interval: 10s
 
     rule_files:
       - '/etc/prometheus-rules/*.rules'
 
     scrape_configs:
        # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
       - job_name: 'prometheus'
 
         # Override the global default and scrape targets from this job every 5 seconds.
         scrape_interval: 5s
 
         # metrics_path defaults to '/metrics'
         # scheme defaults to 'http'.
 
         static_configs:
           - targets: ['localhost:9090'] 

Now if i get any new Nodes in my environment, my prometheus.yml file should get automatically updated my targets section like below i.e.

###
  apiVersion: v1
  kind: ConfigMap
  metadata:
    creationTimestamp: null
    name: prometheus-core
  data:
    prometheus.yml: |
      global:
        scrape_interval: 10s
        scrape_timeout: 10s
        evaluation_interval: 10s
  
      rule_files:
        - '/etc/prometheus-rules/*.rules'
  
      scrape_configs:
         # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
        - job_name: 'prometheus'
  
          # Override the global default and scrape targets from this job every 5 seconds.
          scrape_interval: 5s
  
          # metrics_path defaults to '/metrics'
          # scheme defaults to 'http'.
  
          static_configs:
            - targets: ['localhost:9090','12.10.17.6:9100','12.10.17.19:9100'] 

Can any one suggest how i achieve this ?

@andrewhowdencom

This comment has been minimized.

Copy link

andrewhowdencom commented Jun 27, 2017

Perhaps if you asked your question in the mailing list you may find the help you're looking for? At the least, you can cc hello@andrewhowden.com and I can provide you with some insights.

https://groups.google.com/forum/#!forum/prometheus-users

@grobie grobie closed this Jun 27, 2017

@lock

This comment has been minimized.

Copy link

lock bot commented Mar 23, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 23, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.