Files
kubernetes/victoria-metrics/scrape.yml
Dustin C. Hatch ca02dfec62 v-m: Add host labels to collectd-virt metrics
The *virt* plugin for *collectd* sets `instance` to the name of the
libvirt domain the metric refers to.  This makes it so there is no label
identifying which host the VM is running on.  Thus, if we want to
classify metrics by VM host, we need to add that label explicitly.

Since the `__address__` label is not available during metric relabeling,
we need to store it in a temporary label, which gets dropped at the end
of the relabeling phase.  We copy the value of that label into a new
label, but only for metrics that match the desired metric name.
2024-01-22 11:12:19 -06:00

294 lines
6.7 KiB
YAML

global:
scrape_interval: 1m
scrape_configs:
- job_name: vmagent
kubernetes_sd_configs:
- role: pod
namespaces:
own_namespace: true
selectors:
- role: pod
label: app.kubernetes.io/name=vmagent
relabel_configs:
- target_label: instance
source_labels:
- __meta_kubernetes_pod_name
- job_name: blackbox
metrics_path: /probe
params:
module:
- icmp
static_configs:
- targets:
- github.com
- cloudflare.com
- amazonaws.com
- azure.com
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: blackbox-exporter:9115
- job_name: websites
scrape_interval: 5m
metrics_path: /probe
params:
module:
- http
static_configs:
- targets:
- http://dustin.hatch.name/
- https://darkchestofwonders.us/
- http://nratonpass.com/
- http://pyrocufflink.net/
- http://ebonfire.com/
- http://chmod777.sh/
- https://hatch.chat/_matrix/client/versions
- https://nextcloud.pyrocufflink.net/
- https://bitwarden.pyrocufflink.blue/
- https://git.pyrocufflink.blue/
- https://jenkins.pyrocufflink.blue/login
- https://tabitha.biz/
- https://dustinandtabitha.com/
- https://hatchlearningcenter.org/
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: blackbox-exporter:9115
- job_name: collectd
honor_labels: true
static_configs:
- targets:
- gw1.pyrocufflink.blue
- k8s-aarch64-n0.pyrocufflink.blue
- k8s-aarch64-n1.pyrocufflink.blue
- k8s-amd64-n3.pyrocufflink.blue
- nut0.pyrocufflink.blue
- nvr1.pyrocufflink.blue
- vmhost0.pyrocufflink.blue
- vmhost1.pyrocufflink.blue
file_sd_configs:
- files:
- /scrape/collectd/scrape-collectd.yml
relabel_configs:
- source_labels:
- __address__
target_label: host__tmp
- source_labels: [__address__]
target_label: __address__
replacement: '$1:9103'
metric_relabel_configs:
- source_labels:
- __name__
- host__tmp
separator: ;
regex: collectd_virt.*;(.*)
target_label: host
- action: labeldrop
regex: host__tmp
- job_name: sambadc
scrape_interval: 1m
metrics_path: /probe
params:
module:
- tcp
dns_sd_configs:
- names:
- _ldap._tcp.pyrocufflink.blue
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: blackbox-exporter:9115
- job_name: dns_recursive
scrape_interval: 1m
metrics_path: /probe
params:
module:
- dns_recursive
static_configs:
- targets:
- 172.30.0.1
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: blackbox-exporter:9115
- job_name: dns_pyrocufflink
scrape_interval: 1m
metrics_path: /probe
params:
module:
- dns_pyrocufflink
static_configs:
- targets:
- 172.30.0.10
- 172.30.0.9
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: blackbox-exporter:9115
- job_name: smtp
scrape_interval: 1m
metrics_path: /probe
params:
module:
- smtp
dns_sd_configs:
- names:
- mail.pyrocufflink.blue
type: A
port: 25
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: blackbox-exporter:9115
- job_name: homeassistant
scheme: https
metrics_path: /api/prometheus
authorization:
type: Bearer
credentials_file: /run/secrets/vmagent/homeassistant.token
static_configs:
- targets:
- homeassistant.pyrocufflink.blue
- job_name: graylog
scheme: https
metrics_path: /api/plugins/org.graylog.plugins.metrics.prometheus/metrics
basic_auth:
username: %{SCRAPE_GRAYLOG_TOKEN}
password: token
static_configs:
- targets:
- graylog.pyrocufflink.blue:443
- job_name: gitea
scheme: https
static_configs:
- targets:
- git.pyrocufflink.blue
- job_name: synapse
metrics_path: /_synapse/metrics
static_configs:
- targets:
- matrix0.pyrocufflink.blue
relabel_configs:
- source_labels: [__address__]
target_label: instance
- source_labels: [__address__]
target_label: __address__
replacement: '$1:9000'
- job_name: unifi
static_configs:
- targets:
- unifi.pyrocufflink.blue:9130
- job_name: jenkins
metrics_path: /prometheus/
scheme: https
static_configs:
- targets:
- jenkins.pyrocufflink.blue
- job_name: burp
scrape_interval: 270s
scrape_timeout: 30s
static_configs:
- targets:
- burp.pyrocufflink.blue:9645
- job_name: minio-backups
metrics_path: /minio/v2/metrics/cluster
scheme: https
static_configs:
- targets:
- burp.pyrocufflink.blue:9000
- job_name: kubernetes
scheme: https
tls_config:
ca_file: /run/secrets/kubernetes.io/serviceaccount/ca.crt
static_configs:
- targets:
- kubernetes.pyrocufflink.blue:6443
- job_name: kubelet
scheme: https
tls_config:
ca_file: /run/secrets/kubernetes.io/serviceaccount/ca.crt
authorization:
type: Bearer
credentials_file: /run/secrets/kubernetes.io/serviceaccount/token
kubernetes_sd_configs:
- role: node
relabel_configs:
- action: labelmap
regex: __meta_kubernetes_node_label_(.+)
- target_label: __address__
replacement: %{KUBERNETES_SERVICE_HOST}:%{KUBERNETES_SERVICE_PORT}
- target_label: __metrics_path__
source_labels:
- __meta_kubernetes_node_name
replacement: /api/v1/nodes/$1/proxy/metrics
- job_name: longhorn
kubernetes_sd_configs:
- role: pod
namespaces:
names:
- longhorn-system
selectors:
- role: pod
label: app=longhorn-manager
relabel_configs:
- action: drop
source_labels:
- __meta_kubernetes_pod_container_init
regex: '^true$'
- target_label: instance
source_labels:
- __meta_kubernetes_pod_node_name
- job_name: zincati
metrics_path: /bridge?selector=zincati
static_configs:
- targets:
- k8s-aarch64-n0.pyrocufflink.blue
- k8s-aarch64-n1.pyrocufflink.blue
- k8s-amd64-n3.pyrocufflink.blue
- nut0.pyrocufflink.blue
- nvr1.pyrocufflink.blue
relabel_configs:
- source_labels: [__address__]
target_label: instance
- source_labels: [__address__]
target_label: __address__
replacement: '$1:9598'