快速上手prometheaus grafana 监控

介绍

prometheaus 一个定时输出指标数据的巡检组件?

grafana 一个读取指标,可视化的提供了好看界面的组件?

教程

如何和springboot项目集成 【IT老齐153】超级实用!十分钟掌握Prometheus与Grafana监控SpringBoot应用_哔哩哔哩_bilibili

  1. 其中用到了docker来引入Prometheus与Grafana,我直接跟着底下教程 本机安装了,
  2. 学到了 springboot项目暴露监控指标的配置(配置文件放在最后)

如何监控windows【小速通】速通windows平台部署prometheus+grafana监控自机_哔哩哔哩_bilibili

四分钟的教程

安装了个windows_exporter 可以让普罗米修斯监听windows的性能指标

配置文件

yaml 复制代码
global:
  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 is every 1 minute.

alerting:
  alertmanagers:
    - static_configs:
        - targets:
          # - alertmanager:9093

rule_files:
  # - "second_rules.yml"

scrape_configs:
  - job_name: "prometheus"
    static_configs:
      - targets: ["localhost:9090"]
  #windows_exporter的配置
  - job_name: "windows_exporter"
    static_configs:
      - targets: ["localhost:9182"]
  #springboot项目的配置
  - job_name: "springboot_prometheus" 
    scrape_interval: 5s 
    metrics_path: '/actuator/prometheus' 
    static_configs: 
     - targets: ['localhost:81']

pom文件

yaml 复制代码
#springboot yaml 配置
spring:
  application:
    name: springboot-prometheus
management:
  endpoints:
    web:
      exposure:
       include: "*"
  endpoint:
    health:
      show-details: always
    prometheus:
      enabled: true
  metrics:
    export:
      prometheus:
        enabled: true
server:
    port: 81

实操截图

  1. springboot项目 actuator本身可以暴露出来的指标

  2. 加了prometheus依赖后,可以更规范的返回

  3. 上述这个项目的监控界面(用的dashboard id是 4701)

  4. windows_exporter的监控界面(搜windows_exporter 第一个)

开源项目地址

aiwandianao/prometheusGrafanaTinySpringbootDemo: 最基础的普罗米修斯和 Grafana 集成springboot 配置的项目,配有详尽的教程 (github.com)

相关推荐
神雕大侠mu1 天前
Prometheus+Grafana实现对服务的监控
spring boot·spring cloud·grafana·prometheus
川石教育2 天前
Grafana之Dashboard(仪表盘)
java·javascript·grafana·普罗米修斯
XMYX-03 天前
在 CentOS 7.9 上部署 node_exporter 并接入 Prometheus + Grafana 实现主机监控
centos·grafana·prometheus
川石教育4 天前
Grafana当前状态:SingleStat面板
grafana·prometheus·graph面板·普罗米修斯监控
奔跑中的小象6 天前
基于 nvitop+Prometheus+Grafana 的物理资源与 VLLM 引擎服务监控方案
grafana·prometheus·vllm·nvitop
艾文伯特7 天前
Prometheus+Grafana+AlertManager完整安装过程
grafana·prometheus
hwj运维之路9 天前
k8s监控方案实践(三):部署与配置Grafana可视化平台
云原生·kubernetes·grafana
维C°17 天前
Grafana-新增用户
grafana
Yang三少喜欢撸铁20 天前
通过Docker部署Prometheus + Grafana搭建监控平台【超详细版】
linux·服务器·docker·容器·grafana·prometheus
小黑_深呼吸22 天前
k8s平台:手动部署Grafana
运维·学习·kubernetes·grafana·prometheus