SpringBoot2配置prometheus浏览器访问404
背景:SpringBoot2的项目要配置 actuator + prometheus的健康检查,按照教程配置好之后再浏览器测试 http://localhost:port/prometheus 后404错误
项目pom文件添加;
<!--actuator-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
<version>2.0.1.RELEASE</version>
</dependency>
<!--pometheus 监控-->
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
<version>1.0.3</version>
</dependency>
springboot2的配置文件application.properties添加
management.endpoints.enabled-by-default=true
management.endpoints.web.exposure.include="*"
management.endpoints.web.base-path=/
management.endpoints.jmx.exposure.include="*"
management.endpoints.jmx.shutdown.enabled=false
management.endpoints.metrics.export.prometheus.enabled=true
management.endpoints.metrics.distribution.percentiles-histogram[http.server.requests]=true
management.endpoints.security.enabled=false
management.endpoint.health.show-details=always
然后启动项目发现
问题解决:
*号在yaml文件中属于关健字,所以要加引号,但是再properties文件中就不能加引号
参考:
https://www.liangzl.com/get-article-detail-4864.html
SpringBoot2配置prometheus浏览器访问404的更多相关文章
- Eclipse配置Tomcat,访问404错误
我从官网上面下载的tomcat6,直接启动发现正常使用,但是在Eclipse绑定后启动,访问localhost:8080,本来应该是tomcat的主页,但是却报了404错误. 百度搜索了一下,原来是t ...
- 拦截器的使用,配置手机浏览器访问的h5页面
package com.thinkgem.jeesite.modules.sys.interceptor; import javax.servlet.http.HttpServletRequest; ...
- 配置springboot在访问404时自定义返回结果以及统一异常处理
在搭建项目框架的时候用的是springboot,想统一处理异常,但是发现404的错误总是捕捉不到,总是返回的是springBoot自带的错误结果信息. 如下是springBoot自带的错误结果信息: ...
- Apache 浏览器访问限制配置
浏览器访问限制配置 user_agent收入的浏览器中,我们通过百度,谷歌很容易就可以查到相关的一些资料,方便了我们对知识的查找,但在某些特定情况下,我们并不希望有人可以通过某写搜索引擎直接访问到我们 ...
- 换了台电脑tomcat自己运行没问题,eclipse中配置tomcat开启了浏览器却404错误解决
如果发现下图中 apache tomcat 的Overview 视图中发现 Server Locations 灰色显示 那么首先需要配置好TomCat的TOMCAT_HOME 和 CATALINA_H ...
- 在linux下配置jupyter notebook,本地浏览器访问
1.安装jupyter notebook pip install jupyter 2.生成配置文件 jupyter notebook --generate-config 3.设置登陆密码并生成秘钥 s ...
- 解决使用IIS5.0配置的FTP服务器,客户端浏览器访问时无法获取目录列表的问题。
我在windows xp sp3下利用iis构架了FTP服务器,允许且只允许匿名用户登陆.但刚开始配置好后,不管是使用命令行模式还是使用浏览器都发现无法访问. 于是怀疑防火墙屏蔽端口所致,果不其然,在 ...
- JBoss部署项目log4j配置会造成死锁问题,浏览器访问一直pending状态
今天将项目部署到JBoss服务器上,部署成功后,浏览器访问页面一直在等待响应. 查了很长时间,最后在服务器上通过jstack pid命令查看Java堆栈信息,发现了有两个线程死锁. 看到造成死锁的原因 ...
- centos LAMP第二部分apache配置 下载discuz!配置第一个虚拟主机 安装Discuz! 用户认证 配置域名跳转 配置apache的访问日志 配置静态文件缓存 配置防盗链 访问控制 apache rewrite 配置开机启动apache tcpdump 第二十节课
centos LAMP第二部分apache配置 下载discuz!配置第一个虚拟主机 安装Discuz! 用户认证 配置域名跳转 配置apache的访问日志 配置静态文件缓存 配置防盗链 ...
随机推荐
- MySQL分析数据运行状态利器【show full processlist】
原文地址:https://www.cnblogs.com/shihuc/p/8733460.html 今天的主角是: SHOW [FULL] PROCESSLIST show full process ...
- WPF DataGrid row background converter datagrid 行背景随绑定数据变化,转换器
<DataGrid Grid.Row=" ItemsSource="{Binding SalesList,UpdateSourceTrigger=PropertyChange ...
- CentOS7/Ubuntu18系统时间同步ntp(转载)
转自 https://blog.csdn.net/u010226454/article/details/80896959 ---centos7.2上搭建ntp服务器,并实现时间同步 对于容器编排系统 ...
- FocusVisualStyle
<Style x:Key="MyFocusVisual"> <Setter Property="Control.Template"& ...
- python3 用户名和密码三次错误
一.需求 1)密码输错超过三次进行锁定: 2)如果用户名在锁定文件中提示错误: 二.流程图 三.代码 # Aduthor:CCIP-Ma import sys f=open("passwor ...
- 关于css中的定位
关于前端的几种定位方式 近期自己感觉自己对于前端定位的知识还是不是太理解,所以自己就在这里做一个总结 1.元素的定位属性主要包括定位模式和边偏移两部分. 边偏移属性 描述 top bott ...
- 2.监控软件zabbix-客户端安装
环境准备 Zabbix-Agent只要http://www.zabbix.com/download.php中可以下载的Zabbix-Agent均可以搭建Zabbix-Agent环境,本文选用CentO ...
- js 实现JSONP
编写一个 jsonp.html 内容如下: <!DOCTYPE html> <html lang="en"> <head> <meta c ...
- PostgreSQL 插入行、查表、导出
1.连接数据库 使用cmd选择安装路径下的psql.exe 登录用户名为postgres 输入密码进行登录. D:\PostgreSQL\9.6\bin\psql.exe -U postg ...
- 15、iptables详解
-- http://www.netfilter.org/ http://www.iptables.org/ --参考路径 http://www.netfilter.org/docume ...