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: /...
- static_configs: - targets:# - alertmanager:9093# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.rule_files:# - "first_rules.yml"# - "second_rules.yml"# A scrape configuration containing exactly one endpoint to scrape:# Here it's Prometheus its...
重启prometheus服务(调用/-/reload使得配置变更生效,前提是开启了--web.enable-lifecycle支持) 一般修改配置如告警规则等属于低频事件,修改保持了就需要重启使之生效,那其实期望这两步能够合二为一,即: 修改完配置立刻应用更新。 promethesu本身也提供这一功能,配置关键字为file_sd_configs,实现这一功能的引入的项目...
- 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__] ...
- 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 ...
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 ...
prom/prometheus:v2.18.0 --config.file=/etc/prometheus/prometheus.yml --web.enable-lifecycle 如果使用 file_sd_configs ,那么修改启动命令为: 1 2 3 4 5 docker run --name=prometheus -d \ -p 9090:9090 \ -v /opt/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml \ ...
" file_sd_configs: - files: - /opt/prometheus/targets/network-*.yml refresh_interval: 2m # scrape_interval: 5s # 针对SNMP采集节点 覆盖全局配置15s metrics_path: /snmp params: module: - if_mib # community: # 当 snmp_exporter snmp.yml 配置文件没有指定 community,此处定义的 community 生效...