a. 直接 从release 页面 https://github.com/aliyun/aliyun-cms-grafana/releases 里面下载 aliyun_cms_grafana_datasource_v2.0.tar.gz
b. 下载到 grafan的plugin目录中,解压缩 tar -xzf aliyun_cms_grafana_datasource_v2.0.tar.gz
c. 修改 conf/defaults.ini 允许未签名插件运行
allow_loading_unsigned_plugins = aliyun_cms_grafana_datasource
d. 重启grafana
2、源代码安装
a. 前端编译
进入aliyun-cms-grafana目录下,执行grunt命令(需要安装nodejs和npm),则会按照Gruntfile.js里面的配置将项目里面的文件打包到指定的目录,
当前配置是将项目文件打包到dist目录下,发布的时候打包发布整个插件目录下的文件,dist目录下一定是经源文件编译后的。
b. 服务端编译
需要安装
go 1.14
mage
之后在目录中运行 mage -v, 会自动在 dist目录下生成 相应的二进制包。之后跟随前端代码统一发布
c. 部署
1)按照上面顺序编译完成后,代码都会到dist下面。包括前端文件和二进制可执行文件 cms-datasource*。
2)保证 cms-datasource* 都具有可执行权限。chmod +x cms-datasource*
3) 在grafana 的plugin目录中,创建 aliyun_cms_grafana_datasource 目录,把编译出来的dist目录拷贝到此
4) 修改 conf/defaults.ini 允许未签名插件运行
allow_loading_unsigned_plugins = aliyun_cms_grafana_datasource
5) 重启grafana
3、配置云监控grafana数据源
a.进入grafana的数据源配置页面(Data Sources),点击Add data source进入配置表单页面,填入数据源名称(Name),
在数据源类型(Type)对应的下拉列表中选择CMS Grafana Service。
b. 配置你的AK 和阿里云ID
如果显示Success Data source is working,说明数据源配置成功,可以开始在grafana中访问阿里云监控的数据了。
具体可参考:https://help.aliyun.com/document_detail/109434.html?spm=a2c4g.11186623.6.565.70d048adQpRZsT
aliyun_cms_grafana_datasource
V2.0 Backend Plugin
@yichangtian yichangtian released this on 29 Jan · 2 commits to master since this release
改造为backend plugin模式
数据源配置增加了Aliyun UserId 字段。如果用户需要使用自监控数据和站点监控数据,配置UI上需要手动配置上阿里云Uid。
14、20210128
升级到版本2.0 并生成之前版本1.0
a. 请求方式改为服务端请求,解决客户端AK可以明文读取的安全问题
granfana使用的是v5.3.4,监控RDS服务,点击Save & Test按钮 ,状态一直显示Testing, F12控制台报错 【c3 is not defined 】;
切换最新版本的grafana 6.5.1,点击Save & Test按钮页面直接报错【c3 is not defined】
Docker安装,添加数据源时提示以下信息,请问如何修复,谢谢。
Unable to dynamically transpile ES module A loader plugin needs to be configured via SystemJS.config({ transpiler: 'transpiler-module' }). Instantiating http://localhost:3000/public/plugins/aliyun_cms_grafana_datasource/module.js Loading plugins/aliyun_cms_grafana_datasource/module
在granfa的大盘中配置variable变量函数的时候,发现调用tags(rds,cn-hangzhou,instance,null,null),返回错误信息,无法取到rds信息。 但是调用tags(ecs,cn-hangzhou,instance,null,null)是可以正常取到值。 返回的错误信息是:
SDK.ServerError
ErrorCode: BothEmpty.TagsAndResources
Recommend: https://error-center.aliyun.com/status/search?Keyword=BothEmpty.TagsAndResources&source=PopGw
RequestId: C1E67068-8AD8-4582-83AF-D73E966EAD22
Message: The specified Tags and ResourcesIds are not allow to both empty.