Coder Social home page Coder Social logo

actuator's Introduction

actuator

应用监控:出错时自动报警等,健康状况、内存情况第一个问题:端点的配置

spring boot 端点官方文档 https://docs.spring.io/spring-boot/docs/2.1.7.RELEASE/reference/html/production-ready-endpoints.html

开启redis 端点: 就是一个请求的url地址 端点开启 不等于端点能用,还有一个概念是端点暴漏 #端点暴漏 ,暴漏端点:端点用 ,号分隔例health,info

* 表示暴漏所有

management.endpoints.web.exposure.include=*

直接暴漏不安全:需要加安全 加security

健康指示器 { "status": "UP", "components": { "diskSpace": { "status": "UP", "details": { "total": 263882534912, "free": 254692610048, "threshold": 10485760 } }, "ping": { "status": "UP" } } } 添加redis后,就显示redis的健康情况 { "status": "UP", "components": { "diskSpace": { "status": "UP", "details": { "total": 263882534912, "free": 254692532224, "threshold": 10485760 } }, "ping": { "status": "UP" }, "redis": { "status": "UP", "details": { "version": "3.0.504" } } } }

info 包含三大块 1、自定义信息 2、git信息 3、项目构建信息

1、自定义信息 #info 端点配置 [email protected]@ [email protected]@ [email protected]@ info.author.name=codefarmer info.author.address=www.codefarmer.fun 例;显示 { "app": { "encoding": "UTF-8", "java": { "source": "1.8.0_181" } }, "java": { "target": "1.8.0_181" }, "author": { "name": "codefarmer", "address": "www.codefarmer.fun" } } 代码优先级高于properties配置 { "app": { "encoding": "UTF-8", "java": { "source": "1.8.0_181" } }, "java": { "target": "1.8.0_181" }, "author": { "email": "[email protected]" } } 2、增加git信息 pom中 pl.project13.maven git-commit-id-plugin org.springframework.boot spring-boot-maven-plugin

生成后:target->classes { "app": { "encoding": "UTF-8", "java": { "source": "1.8.0_181" } }, "java": { "target": "1.8.0_181" }, "author": { "email": "[email protected]" }, "git": { "build": { "host": "DESKTOP-9EQ4382", "version": "0.0.1-SNAPSHOT", "time": "2020-02-23T12:10:10Z", "user": { "name": "zhanglianhui", "email": "[email protected]" } }, "branch": "master", "commit": { "message": { "short": "first add", "full": "first add" }, "id": { "describe": "607648b-dirty", "abbrev": "607648b", "describe-short": "607648b-dirty", "full": "607648bd8e4814ba068c7f1d975a834450d17c37" }, "time": "2020-02-23T11:58:03Z", "user": { "email": "[email protected]", "name": "zhanglianhui" } }, "closest": { "tag": { "name": "", "commit": { "count": "" } } }, "local": { "branch": { "ahead": "NO_REMOTE", "behind": "NO_REMOTE" } }, "dirty": "true", "remote": { "origin": { "url": "Unknown" } }, "tags": "", "total": { "commit": { "count": "1" } } } } 3、构建信息 pl.project13.maven git-commit-id-plugin org.springframework.boot spring-boot-maven-plugin build-info 生成后:target->classes->META-INF 显示: { "app": { "encoding": "UTF-8", "java": { "source": "1.8.0_181" } }, "java": { "target": "1.8.0_181" }, "author": { "email": "[email protected]" }, "git": { "build": { "host": "DESKTOP-9EQ4382", "version": "0.0.1-SNAPSHOT", "time": "2020-02-23T12:10:10Z", "user": { "name": "zhanglianhui", "email": "[email protected]" } }, "branch": "master", "commit": { "message": { "short": "first add", "full": "first add" }, "id": { "describe": "607648b-dirty", "abbrev": "607648b", "describe-short": "607648b-dirty", "full": "607648bd8e4814ba068c7f1d975a834450d17c37" }, "time": "2020-02-23T11:58:03Z", "user": { "email": "[email protected]", "name": "zhanglianhui" } }, "closest": { "tag": { "name": "", "commit": { "count": "" } } }, "local": { "branch": { "ahead": "NO_REMOTE", "behind": "NO_REMOTE" } }, "dirty": "true", "remote": { "origin": { "url": "Unknown" } }, "tags": "", "total": { "commit": { "count": "1" } } }, //build信息 "build": { "version": "0.0.1-SNAPSHOT", "artifact": "actuator", "name": "actuator", "group": "fun.codefarmer", "time": "2020-02-23T12:36:54.877Z" } }

actuator's People

Contributors

405609791 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.