<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>spring on Tony Wu&#39;s Blog</title>
    <link>https://tonywu1995.github.io/tags/spring/</link>
    <description>Recent content in spring on Tony Wu&#39;s Blog</description>
    <generator>Hugo -- gohugo.io</generator>
    <lastBuildDate>Sun, 03 Oct 2021 16:25:57 +0800</lastBuildDate><atom:link href="https://tonywu1995.github.io/tags/spring/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Spring Boot監控(中)</title>
      <link>https://tonywu1995.github.io/java/spring-boot-monitor-2/</link>
      <pubDate>Sun, 03 Oct 2021 16:25:57 +0800</pubDate>
      
      <guid>https://tonywu1995.github.io/java/spring-boot-monitor-2/</guid>
      <description>步驟 安裝Prometheus/Grafana 設定Prometheus設定向我們spring boot application位置 # 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_configs:# The job name is added as a label `job=&amp;lt;job_name&amp;gt;` to any timeseries scraped from this config.- job_name: &amp;#39;My-Spring-Boot-Application&amp;#39;# Override the global default and scrape targets from this job every 5 seconds.</description>
    </item>
    
    <item>
      <title>Spring Boot監控(上)</title>
      <link>https://tonywu1995.github.io/java/spring-boot-monitor-1/</link>
      <pubDate>Wed, 22 Sep 2021 22:47:52 +0800</pubDate>
      
      <guid>https://tonywu1995.github.io/java/spring-boot-monitor-1/</guid>
      <description>前言 常在河邊走那裡不失鞋，當一個後端工程師，常常會遇到上線Application server突然無法壞掉的問題，因此我們需要一個監控的Server來輔助我們上線的Application，本篇將使用Prometheus監控server當作範例來做為展示 步驟 Spring boot 安裝Prometheus Client 在pom.xml上新增兩個dependency spring-boot-starter-actuator: spring boot內建的監控library micrometer-registry-prometheus: 在spring boot上提供prometheus metrics格式 &amp;lt;dependency&amp;gt;&amp;lt;groupId&amp;gt;org.springframework.boot&amp;lt;/groupId&amp;gt;&amp;lt;artifactId&amp;gt;spring-boot-starter-actuator&amp;lt;/artifactId&amp;gt;&amp;lt;/dependency&amp;gt;&amp;lt;dependency&amp;gt;&amp;lt;groupId&amp;gt;io.micrometer&amp;lt;/groupId&amp;gt;&amp;lt;artifactId&amp;gt;micrometer-registry-prometheus&amp;lt;/artifactId&amp;gt;&amp;lt;/dependency&amp;gt; Spring boot 調整設定檔 在applcation.yml 新增下列設定 management:endpoint:health:show-details: alwaysprometheus:enabled: trueendpoints:web:exposure:include: prometheus,healthmetrics:tags:application: ${spring.application.name}health:diskspace:enabled: truedefaults:enabled: false 設定好，啟動spring boot即可在http://:/actuator/prometheus看到metrics 參考連結 Spring boot Spring boot Actuator Micrometer Registry Prometheus </description>
    </item>
    
  </channel>
</rss>
