原文地址:https://soulchild.cn/1963.html prometheus 文件配置项 1. static_configs: # 静态配置 static_configs: # 指定要抓取的目标地址 -targets: ['localhost:9090','localhost:9191'] # 给抓取出来的所有指标添加指定的标签 labels: my: label your: label 1. 2. 3. 4. 5. 6. 7....
- targets: ['192.168.16.115:9090'] - job_name: 'es_cluster' #定义job_name,以服务的类别定义 scrape_interval: 1m #轮询时间间隔 static_configs: file_sd_configs: #定义file_sd_configs - files: - /home/monitor/prometheus/conf.d/es_cluster.json #文件的绝对路径 honor_labels: true #标签 - ...
-job_name:'blackbox_POST_api'scrape_interval:20smetrics_path:/probeparams:module:[POST_api]# 匹配模块名称static_configs:-targets:-https://aaa.bbb.comlabels:url_name:"POST xxxxapi"# 自定义的一个标签,后续可以直接显示到告警中方便查看relabel_configs:-source_labels:[__address__]target_label:__...
直接在Prometheus.yml配置 #http配置-job_name:"blackbox_http"metrics_path:/probeparams:module:[http_2xx]static_configs:-targets:-https://www.baidu.com-https://www.jd.comrelabel_configs:-source_labels:[__address__]target_label:__param_target-source_labels:[__param_target]target_label:instance...
基于kubernetes_sd_configs 自动发现配置 准备Prometheus的自动发现的配置文件并加载 代码语言:javascript 复制 [root@VM-12-8-centos kube-prom]# cat prometheus-additional.yaml-job_name:'blackbox'metrics_path:/probeparams:module:[http_2xx]static_configs:-targets:-http://10.1.226.250:6000-http://10.1....
- job_name: 'docker'static_configs:- targets: ['172.19.0.27:8080']systemctl restart prometheus 启动Prometheus服务,可以在Prometheus UI中看到当前所有的Target状态: 当能够正常采集到cAdvisor的样本数据后,可以通过一下表达式计算容器的CPU使用率. sum(irate(container_cpu_usage_seconds_total{image!=""}[1m]...
static_configs:- targets: ["localhost:9090"]里面有个默认任务,对自己进行监控: "localhost:9090",任务名字为”prometheus“。启动prometheus, 执行 ./prometheus即可。然后浏览器访问 http://localhost:9090,切换到status页面,可以看到如下图所示界面。2.安装和部署grafana Grafana是一个强大的数据展示平台,拥有...
scrape_configs: - job_name: 'prometheus' static_configs: - targets: ['localhost:9090', 'localhost:9100'] labels: group: 'prometheus' scrape_configs表示定义收集规则,指定了:localhost:9090和localhost:9100作为获取信息的地址,并给获取的信息打上了group=prometheus的标签。 2、服务发现配置 Prometheus支持多...
static_configs: - targets: ['localhost:8000'] 2.为了避免采集点太多,可以指定一个额外的配置文件来存储(可以热加载),相当于是基于文件的服务发现。 prometheus.yml: scrape_configs: # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config. ...
tls_config:insecure_skip_verify:truestatic_configs:-targets:['192.168.20.144:8888','192.168.20.144:8889']labels:group:'server'[root@kudu-02prometheus]# <scheme>: a string that can take the valueshttporhttps Configures the scrape request's TLS settings. ...