kubernetes_sd_configs: - role: endpoints scheme: https tls_config: ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token relabel_configs: - source_labels: [__meta_kubernetes_namespace, __meta_kubernetes_service_name...
• consul_sd_configs • dns_sd_configs • ec2_sd_configs • openstack_sd_configs • file_sd_configs • gce_sd_configs • kubernetes_sd_configs • marathon_sd_configs • nerve_sd_configs • serverset_sd_configs • triton_sd_configs 基于文件的服务发现 基于文件的发现只比静...
- job_name:'file_sd_config_CAserver'file_sd_configs: - files: - /prometheus/sd_my_server.json refresh_interval: 10s#增加配置段vim case3-2-prometheus-deployment.yaml volumeMounts: - mountPath: /prometheus/file_sd/ name: file-sd-config volumes: - name: file-sd-config hostPath: path: /...
重启prometheus服务(调用/-/reload使得配置变更生效,前提是开启了--web.enable-lifecycle支持) 一般修改配置如告警规则等属于低频事件,修改保持了就需要重启使之生效,那其实期望这两步能够合二为一,即: 修改完配置立刻应用更新。 promethesu本身也提供这一功能,配置关键字为file_sd_configs,实现这一功能的引入的项目...
- file_sd_configs: - files: - tatgets/alertmanagers.yaml refresh_interval: 60s //基于文件的服务发现的YAML文件 ]# vim /apps/prometheus/tatgets/alertmanagers.yaml - targets: - 10.1.1.11:9093 labels: "app":"alertmanager" 2、监控Alertmanager ...
prometheus02-file_sd_configs 1.配置文件(自动发现) [root@zabbix-proxy prometheus]# cat prometheus.yml# my global configglobal: scrape_interval: 15s# Set the scrape interval to every 15 seconds. Default is every 1 minute.evaluation_interval: 15s# Evaluate rules every 15 seconds. The default ...
- file_sd_configs: - files: - 'configs/nginx.yml' job_name: Nginx Server metrics_path: /metrics relabel_configs: - source_labels: [__address__] regex: (.*) target_label: instance replacement: $1 - source_labels: [__address__] ...
mysql.yml的172.18.0.23:9104会通过prometheus配置文件中的file_sd_configs配置,作为变量传给$1,然后替换__address__,因而被prometheus所识别。 6、使prometheus配置生效 [root@prometheus-21 prometheus]# pgrep -fl prometheus 33 /data/prometheus/prometheus --storage.tsdb.retention=30d ...
file_sd_configs: - files: - targets/t1.json - targets/t2.json refresh_interval: 5m 4、Config是一个接口: Config接口 Config是一个接口的定义,每种服务发现协议都会存在一个对应Config接口的实现(见下图)。该接口主要定义两个方法: 1、Name() string:定义服务发现协议类型,如eureka、kubernetes等等; ...