应用监控中,关于对git信息进行监控的一些问题

关于监控的配置,在上一章节已经说过,下面就是我在配置git信息中的步骤和问题
1.首先依照上一张引入相关依赖外,再引入plugin如下

<build>
        <plugins>
            <plugin>
                <groupId>pl.project13.maven</groupId>
                <artifactId>git-commit-id-plugin</artifactId>
            </plugin>
        </plugins>
</build>

2.然后将项目提交到git上如下:
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
3.在maven窗口中我们可以找到git-commid-id:revision
在这里插入图片描述
右键-Run Maven Build
在这里插入图片描述
4.结束后我们可以在target/classes/com下面找到一个git.properties文件
在这里插入图片描述
里面是关于git的相关信息
在这里插入图片描述
5.用postman访问http://localhost:8080/actuator/info可以得到相关信息
在这里插入图片描述
如果想要获得所有git信息可以在application.properties中加入:

management.info.git.mode=full

重启后再次访问http://localhost:8080/actuator/info可得如下信息
在这里插入图片描述

发布了12 篇原创文章 · 获赞 1 · 访问量 141

猜你喜欢

转载自blog.csdn.net/u010574271/article/details/103460462