prometheus 406 求大神不吝賜教

wln608 2020-09-02 11:29:05
http://localhost:17001/actuator/prometheus

頁面:HTTP ERROR 406
...全文
6258 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
wln608 2020-09-04
  • 打赏
  • 举报
回复
application.yml文件下面配置 management: endpoints: web: exposure: include: info,health,prometheus server: servlet: context-path: / port: 17001 pom.xml下面引入 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> <!-- Micrometer Prometheus registry --> <dependency> <groupId>io.micrometer</groupId> <artifactId>micrometer-registry-prometheus</artifactId> </dependency>
wln608 2020-09-04
  • 打赏
  • 举报
回复
街头小贩 2020-09-03
  • 打赏
  • 举报
回复
贴一下你的请求和响应截图
Neal_Shan 2020-09-03
  • 打赏
  • 举报
回复
你提供信息有限,不过406是客户端异常,406是指请求返回的内容不符合你的request header里Accept的定义,例如/actuator/prometheus需要Accept:text/plain, 我猜你要么是Accept写错了,要么很可能引入了处理json的jar,导致/actuator/prometheus返回的是json,而不是text

50,528

社区成员

发帖
与我相关
我的任务
社区描述
Java相关技术讨论
javaspring bootspring cloud 技术论坛(原bbs)
社区管理员
  • Java相关社区
  • 小虚竹
  • 谙忆
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧