备忘录二:春天引导驱动器+普罗米修斯+ Grafana

  

  <强>   一:春天引导致动器      

  
      <李>   

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

      李   <李>   

      春天的引导应用中引入      

      李   
  <前>   & lt; dependency>   & lt; groupId> org.springframework.boot   & lt; artifactId> spring-boot-starter-actuator   & lt;/dependency>   之前   

  ,3. application.yml文件配置      
  

  <前>   #,管理   管理:   端点才能:   ,,,网站:   ,,,,,曝光:   ,,,,,,,包括:,“*”;   端点才能:   ,,,健康:   ,,,,,显示详细:总是   之前   

     

  

     <强>            

  
      <李>   

      将测微计普罗米修斯注册添加到春天引导应用。   

      李   
  <前>   & lt; dependency>   & lt; groupId> io.micrometer   & lt; artifactId> micrometer-registry-prometheus   & lt;/dependency>   之前   

  ,,2.码头工人拉取      

  <前>   docker  pull 舞会/普罗米修斯   之前   

  ,3。         
  

  <前>   #,my  global 配置   全球:   scrape_interval才能:,,,,,15 s  #, Set 从而scrape  interval 用every  15,秒只Default  is  every  1分钟。   ,,evaluation_interval: 15 s  #, Evaluate  rules  every  15,秒只,default  is  every  1分钟。   #,才能scrape_timeout  is  set 用,global  default  (10)。   #,Load  rules  once 以及periodically  evaluate  them  according 用,global  & # 39; evaluation_interval& # 39;。   rule_files:   #,才能成功;“first_rules.yml"   #,才能成功;“second_rules.yml"   #,A  scrape  configuration  containing  exactly  one  endpoint 用刮:   #,Here 变# 39;s  Prometheus 本身。   scrape_configs:   #才能,从而job  name  is  added  as  a  label “工作=& lt; job_name>”,用any  timeseries  scraped 得到却;能够配置。   之处,才能job_name: & # 39;普罗米修斯# 39;   ,,,#,metrics_path  defaults 用& # 39;/指标# 39;   ,,,#,scheme  defaults 用& # 39;http # 39;。   ,,,static_configs:   ,,,什么,目标:,(& # 39;127.0.0.1:9090& # 39;】   之处,才能job_name: & # 39; spring-actuator& # 39;   ,,,metrics_path:, & # 39;/mybatis/致动器/普罗米修斯# 39;   ,,,scrape_interval: 5 s   ,,,static_configs:   ,,,什么,目标:,(& # 39;112.74.105.178:8888& # 39;】   之前   

  4 .运行      

  <前>   docker  run  -d  - name=prometheus  -p  9090:9090  -v /mnt/演示/prometheus.yml:/etc/普罗米修斯/prometheus.yml 舞会/prometheus ——config.file=/etc/普罗米修斯/prometheus.yml   之前   

     5 .查看      

  

     

  

  <强>   三:Grafana      

  
      <李>   

      码头工人运行Grafana镜像   

      李   
  <前>   docker  run  -d  - name=grafana  -p  3000:3000  grafana/grafana   之前   

  ,2。         

  

        

  

        

  

        

备忘录二:春天引导驱动器+普罗米修斯+ Grafana