图表类型: Time
xcol: time
ycol: PV, UV
query: * | select (__time__ - (__time__ % 60000)) as time,count(1) as PV, count(distinct account_id) as UV group by time
图表类型: Time
xcol: time,dimension
ycol: PV, UV
query: * | select (__time__ - (__time__ % 60000)) as time,dimension,count(1) as PV, count(distinct account_id) as UV group by time,dimension
单值图(Stat / Gauge)
配置参数
图表类型: Stat
xcol: stat
ycol: PV, UV
query: * | select count(1) as PV, count(distinct account_id) as UV
饼图(Pie)
配置参数
图表类型: Pie
xcol: Pie
ycol: status,cnt
query: status>200 | select status,count(*) cnt group by status
柱状图(Pie)
配置参数
图表类型: Bar
xcol: bar
ycol: method,PV,UV
query: * | select method,count(1) as PV,count(distinct account_id) as UV group by method
表格
配置参数
图表类型: Table
xcol: table
ycol: time,PV,UV
query: * | select (__time__ - (__time__ % 60000)) as time,count(1) as PV, count(distinct account_id) as UV group by time
火山引擎日志服务数据源
安装
依赖 Grafana >= 9.x版本
Grafana 6.x~8.x版本请使用1.0版本
插件目录是 /usr/lib/grafana/plugins:
插件目录是 {PATH_TO}/grafana-6.6.0/data/plugins:
配置文件路径为:/etc/grafana/grafana.ini
配置文件路径为:{PATH_TO}/grafana-6.6.0/conf/defaults.ini
设置
首先,kill终止Grafana进程。然后执行重启命令
使用
目前TLS的Grafana插件支持时间序列图、表格两种形式的图表。时间序列图既是随着时间变化的折线图。
表格是明细日志的查看。
添加数据源
在数据源管理面板, 添加 LogService 数据源
在 settings 面板, 设置 URL 为您日志服务endpoint,例如: https://tls-cn-beijing.volces.com ,Access 设置为 Server(Default)
设置 Region、Topic参数,以及账号的AccessKeyId ,设置 AccessKeyId 和 AccessKeySecret。
注:Grafana版本在>=9.x版本,数据源创建支持AccountMode选项,只填写AccessKeyId、AccessKeySecret,在数据查询时选择region和topic。
设置完成后,点击保存可以测试数据源是否可以访问。
添加图表
时间序列图表(TimeSeries)
配置参数
单值图(Stat / Gauge)
配置参数
饼图(Pie)
配置参数
柱状图(Pie)
配置参数
表格
配置参数