Last active
June 6, 2019 22:15
-
-
Save dkt26111/a3bc7ba45f82c599ab31821597fc7f63 to your computer and use it in GitHub Desktop.
Prometheus configuration file to scrape OpenStack instances that belong to Senlin clusters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global: | |
scrape_interval: 15s | |
scrape_configs: | |
- job_name: 'prometheus' | |
scrape_interval: 5s | |
static_configs: | |
- targets: ['localhost:9090'] | |
# Scrape OpenStack instances | |
- job_name: 'openstack' | |
openstack_sd_configs: | |
- identity_endpoint: http://10.0.20.10/identity | |
region: RegionOne | |
username: admin | |
project_name: admin | |
domain_name: default | |
password: secretsecret | |
role: instance | |
relabel_configs: | |
# Keep only active instances | |
- source_labels: [__meta_openstack_instance_status] | |
action: keep | |
regex: ACTIVE | |
# Keep Senlin instances that have cluster_id | |
- source_labels: [__meta_openstack_tag_cluster_id] | |
action: keep | |
# Update the scraping port if required | |
- source_labels: | |
- __address__ | |
action: replace | |
regex: ([^:]+)(?::\d+) | |
replacement: $1:9100 | |
target_label: __address__ | |
rule_files: | |
- alert.rules.yml | |
alerting: | |
alertmanagers: | |
- static_configs: | |
- targets: | |
- 'localhost:9093' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment