Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign up[question] Dynamic Prometheus configuration #2041
Comments
This comment has been minimized.
This comment has been minimized.
|
@hgontijo There's no support for multiple config files - if you want to change arbitrary things in the config while Prometheus is running, you can just send a If all you want to change are the targets, you can use any of the dynamic service discovery mechanisms, including |
This comment has been minimized.
This comment has been minimized.
|
Great, As far the refresh_interval, the documentation says # Refresh interval to re-read the files.
[ refresh_interval: <duration> | default = 5m ]... however the refresh rate for me was a couple of secs. I tried to configure the refresh_interval as: scrape_configs:
- job_name: 'blackbox-http-2xx-secure'
metrics_path: /probe
params:
module: [http_2xx] # Look for a HTTP 200 response.
file_sd_configs:
- files:
- '/etc/prometheus/blackbox/*.yml'
- refresh_interval: 10s
relabel_configs:
- source_labels: [__address__]
regex: (.*)(:80)?
target_label: __param_target
replacement: ${1}
- source_labels: [__param_target]
regex: (.*)
target_label: instance
replacement: ${1}
- source_labels: []
regex: .*
target_label: __address__
replacement: 127.0.0.1:9115 # Blackbox exporter.And it gives this error message:
it works fine without the refresh_interval on the job configuration. |
This comment has been minimized.
This comment has been minimized.
|
@hgontijo That is odd. Refreshes resulting from the refresh timer should execute the same code path as the initial load or refreshes triggered by changes to the files. By the way: you probably do not need to set your refresh interval to 10s. The |
This comment has been minimized.
This comment has been minimized.
|
@juliusv the error message happens when I configure refresh_interval under file_sd_configs and restart (stop/start) the service. As you suggested, I'll go without refresh_interval since the file change detection works fine. |
brian-brazil
closed this
Oct 26, 2016
brian-brazil
added
the
kind/question
label
Oct 26, 2016
This comment has been minimized.
This comment has been minimized.
nuaays
commented
May 9, 2017
This comment has been minimized.
This comment has been minimized.
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. |
hgontijo commentedSep 29, 2016
•
edited
I'd like to automate the process of adding more configuration after Prometheus installation.
My use case is to add more blackbox configuration (under scrape_configs) to prometheus.yml on-the-fly. Is there a way to setup multiple Prometheus config files?
Environment
prometheus, version 1.1.3 (branch: master, revision: ac374aa)
build user: root@3e392b8b8b44
build date: 20160916-11:36:30
go version: go1.6.3