8 Star 37 Fork 15

lianglongqun / grafana-proxy

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

grafana-proxy

grafana提供了功能强大的监控图表功能,我们希望将grafana与业务系统集中,并且希望能够自定义grafana dashboard的页面内容。

实现方案

  • 采用zuul作为grafana的代理组件,在grafana返回dashboard页面内容时,动态插入JavaScript文件,通过JavaScript修改页面来实现。
  • 这种方案不需要修改grafana源码,就可以实现快速,有效的定制。

使用

1. 启动grafana,并且配置grafana允许匿名访问

docker run -d --name=grafana -v /etc/grafana/grafana.ini:/etc/grafana/grafana.ini -v /var/lib/grafana:/var/lib/grafana -p 3000:3000 grafana/grafana:4.6.2

grafana.ini配置文件示例

grafana如何配置匿名访问,请参考 http://https://my.oschina.net/weidedong/blog/759725

2. 在grafana中创建一个d1的dashboard,通过grafana直接访问d1 dashboard

http://192.168.1.6:3000/dashboard/db/dashboard?orgId=1

multisources

3. 部署grafana-proxy

grafana-proxy的配置文件为application.yml,修改grafana-server参数

grafana-server: http://192.168.1.6:3000

4. 通过grafana-proxy访问d1 dashboard

http://localhost:8800/dashboard/db/d1?orgId=1

multisources

5. 这个就完成对grafana dashboard的修改。配合grafana的template variables功能,可以更多高级功能。

The MIT License (MIT) Copyright (c) 2018 lianglongqun Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

采用代理方案,通过代理访问grafana,实现自定义grafana dashboard页面功能。将grafana与业务系统集成。 展开 收起
Java
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Java
1
https://gitee.com/jscode/grafana-proxy.git
git@gitee.com:jscode/grafana-proxy.git
jscode
grafana-proxy
grafana-proxy
master

搜索帮助