Comments (11)
Just to clarify. After creating those files you'll like to load them with file_sd like this:
- file_sd_configs:
- files:
- /etc/prometheus/file_sd/*.yml
?
from ansible-prometheus.
No, I would like to be able to configure them with a specific job.
See this prometheus config and how we're currently deploying the config files.
from ansible-prometheus.
You are using this role at FOSDEM?! So great! 🎉 Shame I cannot go there this year 😟
But back to the subject. Look how we apply file_sd
right now in defaults/main.yml. We can just change line L54 to get wildcard and that way by default it will load all target jobs. However if someone wants to overwrite this behaviour, he can just by specifying different prometheus_scrape_configs
. This way role could create custom target files and you could load them with custom jobs. Is this ok?
from ansible-prometheus.
No, using a wildcard there goes against Prometheus job design. It would basically lump all targets into one job. This is why I changed the default scrape_config to only specify one target file. 😃
The goal here is to allow many different jobs with different sets of target lists.
from ansible-prometheus.
I get it. However we need some default way to load those files. Imagine when someone decides to describe targets in prometheus_targets
but forgets to write custom prometheus_scrape_config
what then? This way we ensure prometheus will load this config albeit not the way it was designed to work.
from ansible-prometheus.
Adjusting scrape configs and targets at the same time is basically a requirement for Prometheus anyway. You can't have targets without a correctly identified scrape config.
from ansible-prometheus.
You are right. However you can define it via label system, look at this: https://github.com/cloudalchemy/demo-site/blob/master/group_vars/all/vars#L9 and then this: http://demo.cloudalchemy.org:9090/targets
One scrape config, multiple jobs.
from ansible-prometheus.
I don't know if such usage is an anti-pattern or isn't, but it's the simplest way we could think of. With such config you just say: here is your target list, they belong to this environment and do this job.
from ansible-prometheus.
The example demo site configuration is not the right pattern to define multiple jobs.
from ansible-prometheus.
Ok, we'll change it after doing #60
from ansible-prometheus.
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.
from ansible-prometheus.
Related Issues (20)
- RestrictSUIDSGID not supported in Debian buster HOT 1
- Multiple targets in scrape_configs HOT 2
- Restrict binary access HOT 2
- Cannot start prometheus if prometheus_db_dir is under /home
- checksum failed because is not the good line selected in sha256sums.txt (when install prometheus) HOT 1
- prometheus_config_dir/consoles and prometheus_config_dir/console_libraries are inaccessible HOT 1
- Role fails on 'Fail when file_sd targets are not defined in scrape_configs' while using consul_sd HOT 1
- Stance on default alert rules HOT 1
- Deprecation warning about `include` HOT 1
- Ability to specify oauth2 configuration HOT 1
- child process. Crashing instead. - Checksums HOT 4
- Download URL HOT 1
- Can't see consul_sd_configs on prometheus.yml HOT 1
- v4.0.0 seems to have disappeared from galaxy HOT 10
- Selinux packages for Oracle Linux 8 HOT 1
- Installing from distribution repo HOT 1
- relabel_configs in prometheus_scrape_configs HOT 1
- Updating prometheus_web_config doesn't reload prometheus HOT 2
- Add AlmaLinux variable file HOT 3
- Is ansible-prometheus abandoned? No commits have been made since January 2022 (now October 2022) HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansible-prometheus.