网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

备忘录二:SpringBootActuator+Prometheus+Grafana

一:Spring Boot Actuator

创新互联建站于2013年开始,先为兴化等服务建站,兴化等地企业,进行企业商务咨询服务。为兴化企业网站制作PC+手机+微官网三网同步一站式服务解决您的所有建站问题。

  1. Spring-boot-actuator 可在将应用程序投入生产时监视和管理应用程序。可以选择使用 HTTP 端点或 JMX 来管理和监控应用程序

  2. Spring boot 应用中引入 Spring-boot-actuator  

		
			org.springframework.boot
			spring-boot-starter-actuator
		

  3.application.yml文件配置

# management
management:
  endpoints:
    web:
      exposure:
        include: "*"
  endpoint:
    health:
      show-details: ALWAYS

4.Spring Boot Actuator内置Endpoints

备忘录二:Spring Boot Actuator+Prometheus+Grafana 二: Prometheus

  1. 将Micrometer Prometheus 注册添加到Spring Boot应用。

		
			io.micrometer
			micrometer-registry-prometheus
		

    2.Docker 拉取 Prometheus镜像

docker pull prom/prometheus

   3. Prometheus 配置文件

# my global config
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.
  # scrape_timeout is set to the global default (10s).
# 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=` to any timeseries scraped from this config.
  - job_name: 'prometheus'
    # metrics_path defaults to '/metrics'
    # scheme defaults to 'http'.
    static_configs:
    - targets: ['127.0.0.1:9090']
  - job_name: 'spring-actuator'
    metrics_path: '/mybatis/actuator/prometheus'
    scrape_interval: 5s
    static_configs:
    - targets: ['112.74.105.178:8888']

4.运行 Prometheus容器

docker run -d --name=prometheus -p 9090:9090 -v /mnt/demo/prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus --config.file=/etc/prometheus/prometheus.yml

5.查看 Prometheus运行情况

备忘录二:Spring Boot Actuator+Prometheus+Grafana

三:Grafana

  1. Docker 运行Grafana镜像

docker run -d --name=grafana -p 3000:3000 grafana/grafana

   2. Grafana 配置 Prometheus数据源

备忘录二:Spring Boot Actuator+Prometheus+Grafana

3.监控dashboard

备忘录二:Spring Boot Actuator+Prometheus+Grafana


分享题目:备忘录二:SpringBootActuator+Prometheus+Grafana
转载注明:http://bjjierui.cn/article/gjjgpp.html

其他资讯