前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Prometheus 2.30.0版本UI界面打不开Error opening React Index.html

Prometheus 2.30.0版本UI界面打不开Error opening React Index.html

原创
作者头像
觉醒的光
修改2022-02-06 18:09:03
1.6K2
修改2022-02-06 18:09:03
举报
文章被收录于专栏:Guang的技术博客Guang的技术博客

从github上下载Prometheus2.30.0源码,学习scrape原理,通过go build 编译二进制可执行程序,添加promethues.yaml配置文件,启动后,按一般的文档说法,可以直接在浏览器通过http://localhost:9090打开prometheus原生界面查看指标和target信息,实际打开该页面,发现报错:Error opening React index.html: open static/react/index.html: no such file or directory

原因是:https://github.com/prometheus/prometheus/issues/6421

prometheus 2.14.0版本后,UI界面渲染通过 React app 方式来生成,go build 直接编译生成的二进制文件缺少 react app相关的依赖包。

解决方法是:https://github.com/prometheus/prometheus/blob/main/web/ui/README.md

在prometheus源码的prometheus/web/ui/README.md文档中有说明,需要在启动 promethues二进制文件后,再去prometheus/web/ui/路径下,通过npm install 和 npm start命令把 react app 依赖包和生成的程序启动下,然后就可以通过 http://localhost:3000转发代理的方式访问 http://localhost:9090 打开promethues原生UI界面。

注:1. 如果是Mac电脑,npm组件没有安装,需要先把它安装好;

2. 如果,http://localhost:3000转发代理的方式访问 http://localhost:9090发生失败,需要vi /etc/hosts把 127.0.0.1 localhost配置好即可;

Proxy error: Could not proxy request /-/ready from 127.0.0.1:3000 to http://localhost:9090.

See https://nodejs.org/api/errors.html#errors_common_system_errors for more information (ENOTFOUND).

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档