Configuring Prometheus without ServiceMonitor
Configure Prometheus with annotations to scrape SNMP-based metrics from SNMP Exporter.
The following example configures Prometheus (community edition) to scrape metrics from MATRIXX endpoints:
# adds additional scrape configs to prometheus.yml
extraScrapeConfigs: |
- job_name: 'matrixx_mib'
scrape_interval: 15s
scrape_timeout: 14s
honor_labels: true
static_configs:
- targets:
- ckpt-s1e1-0.matrixx.svc.cluster.local:14700
- proc-s1e1-0.matrixx.svc.cluster.local:14700
- publ-s1e1-0.matrixx.svc.cluster.local:14700
labels:
subdomain: 'subdomain-1'
metrics_path: /snmp
params:
module: [matrixx_mib]
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: snmp-exporter-ag1.matrixx.svc.cluster.local:9116
- job_name: 'matrixx_common_mib'
honor_labels: true
static_configs:
- targets:
- ckpt-s1e1-0.matrixx.svc.cluster.local:14700
- proc-s1e1-0.matrixx.svc.cluster.local:14700
- publ-s1e1-0.matrixx.svc.cluster.local:14700
- tralb-proc-s1e1-0.matrixx.svc.cluster.local:14700
- tralb-publ-s1e1-0.matrixx.svc.cluster.local:14700
- tra-dr-ag1-0.tra-ag1.matrixx.svc.cluster.local:14700
labels:
subdomain: 'subdomain-1'
metrics_path: /snmp
params:
module: [matrixx_common_mib]
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: snmp-exporter-ag1.matrixx.svc.cluster.local:9116
scrape_interval: 15s
scrape_timeout: 14s
- job_name: 'matrixx_sysinfo_mib'
scrape_interval: 15s
scrape_timeout: 14s
honor_labels: true
static_configs:
- targets:
- ckpt-s1e1-0.matrixx.svc.cluster.local:14700
- proc-s1e1-0.matrixx.svc.cluster.local:14700
- publ-s1e1-0.matrixx.svc.cluster.local:14700
- tralb-proc-s1e1-0.matrixx.svc.cluster.local:14700
- tralb-publ-s1e1-0.matrixx.svc.cluster.local:14700
- tra-dr-ag1-0.tra-ag1.matrixx.svc.cluster.local:14700
labels:
subdomain: 'subdomain-1'
metrics_path: /snmp
params:
module: [matrixx_sysinfo_mib]
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: snmp-exporter-ag1.matrixx.svc.cluster.local:9116
- job_name: 'matrixx_tra_mib'
scrape_interval: 15s
scrape_timeout: 14s
honor_labels: true
static_configs:
- targets:
- tralb-proc-s1e1-0.matrixx.svc.cluster.local:14700
- tralb-publ-s1e1-0.matrixx.svc.cluster.local:14700
- tra-dr-ag1-0.tra-ag1.matrixx.svc.cluster.local:14700
labels:
subdomain: 'subdomain-1'
metrics_path: /snmp
params:
module: [matrixx_tra_mib]
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: snmp-exporter-ag1.matrixx.svc.cluster.local:9116
- job_name: 'matrixx_generalservice_mib'
scrape_interval: 15s
scrape_timeout: 14s
honor_labels: true
static_configs:
- targets:
- ckpt-s1e1-0.matrixx.svc.cluster.local:14700
- proc-s1e1-0.matrixx.svc.cluster.local:14700
- publ-s1e1-0.matrixx.svc.cluster.local:14700
- tralb-proc-s1e1-0.matrixx.svc.cluster.local:14700
- tralb-publ-s1e1-0.matrixx.svc.cluster.local:14700
labels:
subdomain: 'subdomain-1'
metrics_path: /snmp
params:
module: [matrixx_generalservice_mib]
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: snmp-exporter-ag1.matrixx.svc.cluster.local:9116
For more information about Prometheus configuration, see the values.yaml file at the Prometheus git repository website.