没有合适的资源?快使用搜索试试~ 我知道了~
node-exporter-1.3.1.linux-amd64.tar.gz ,基于Prometheus 和 Grafana 实
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 25 浏览量
2023-07-07
17:07:37
上传
评论
收藏 2.81MB DOC 举报
温馨提示
试读
19页
node_exporter-1.3.1.linux-amd64.tar.gz ,基于Prometheus 和 Grafana 实现springboot应用监控和服务器监控,官网的几乎是下载不下来,自从github被微软收购后,我感到了深深的担忧,很多东西都不能下载了。
资源推荐
资源详情
资源评论
基于 Prometheus 和 Grafana 实现
springboot 应用监控和服务器监控
1、Prometheus 环境搭建
1.1 下载和安装 Prometheus
访问 Prometheus 官方网站(https://prometheus.io/download/),下载适合操
作系统的 Prometheus 版本。解压下载的文件,将包含 Prometheus 二进制文件和
配置文件的目录放在合适的位置。
1.2 配置 Prometheus
在 Prometheus 的安装目录中,找到 prometheus.yml 配置文件。打开并编辑该文
件,以配置 Prometheus 以抓取 Spring Boot 应用程序的指标数据。
1.3 配置 Prometheus 抓取 Spring Boot 应用 Metrics
在 prometheus.yml 文件中,找到 scrape_configs 部分,并添加一个新的抓取配
置,如下所示:
scrape_configs:
- job_name: 'spring_boot_app'
metrics_path: '/actuator/prometheus'
static_configs:
- targets: ['localhost:8080'] # 使用你的 Spring Boot 应用程序的实际主机和端口
替换
在此配置中,我们指定了应用程序的/actuator/prometheus 端点作为 Prometheus 抓取指标数据的路
径。确保将 targets 中的 localhost:8080 替换为你的 Spring Boot 应用程序的实际主机名和端口号。
以下是我机器的实际配置:
# my global config
global:
scrape_interval: 5s # Set the scrape interval to every 15 seconds. Default
is every 1 minute.
evaluation_interval: 5s # Evaluate rules every 15 seconds. The default is
every 1 minute.
# scrape_timeout is set to the global default (10s).
# Alertmanager configuration
alerting:
alertmanagers:
- 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 itself.
# scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped
from this config.
# - job_name: "prometheus"
# metrics_path defaults to '/metrics'
# scheme defaults to 'http'.
# static_configs:
# - targets: ["localhost:9090"]
scrape_configs:
- job_name: 'springboot-69-8084'
metrics_path: '/actuator/prometheus'
static_configs:
- targets: ['localhost:8084'] # 使用你的 Spring Boot 应用程序的实际主机和
端口替换
- job_name: 'springboot-69-8082'
metrics_path: '/actuator/prometheus'
static_configs:
- targets: ['localhost:8082'] # 使用你的 Spring Boot 应用程序的实际主机和
端口替换
- job_name: 'springboot-69-8761'
metrics_path: '/actuator/prometheus'
static_configs:
- targets: ['localhost:8761'] # 使用你的 Spring Boot 应用程序的实际主机和
端口替换
- job_name: "nacos_162_8848"
metrics_path: '/actuator/prometheus'
static_configs:
- targets: ['192.168.3.162:8848']
- job_name: "prometheus_162"
static_configs:
- targets: ["192.168.3.162:9090"]
剩余18页未读,继续阅读
资源评论
蒙奇·D·路飞-
- 粉丝: 5707
- 资源: 406
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功