Grafana如何连接DolphinDB?

本页介绍如何通过 DolphinDB 的数据接口与 Grafana 插件(dolphindb-datasource)将 DolphinDB 表数据在 Grafana 上进行网页可视化展示,并说明适用的监控与分析场景。

Source: https://dolphindb.cn/blogs/29

What this page covers

技能认证特训营第二期报名提示

页面顶部包含技能认证特训营的报名提示,提供限时报名链接并提及相关权益信息。

Grafana如何连接DolphinDB?(文章信息与概述)

本文给出作者与发布时间,并概述 Grafana 可通过 DolphinDB 数据接口与 dolphindb-datasource 插件连接,以在网页端可视化展示数据并用于监控场景。

步骤1:安装并启动DolphinDB

该步骤说明获取并使用 DolphinDB 试用版本,并给出最低版本要求。

步骤2:安装并启动Grafana

该步骤参考官方文档安装并启动 Grafana,并说明示例使用的 Grafana 版本与默认配置。

步骤3:安装dolphindb-datasource插件

该步骤说明获取 dolphindb/grafana-datasource 源码并放置到 Grafana 插件目录,重启 Grafana 后通过本地地址访问并使用默认账号登录。

步骤4:添加DolphinDB数据源(datasource)

该步骤说明在 Grafana 中添加并配置 DolphinDB 数据源,填写 Name、Type、URL 等字段后保存并测试连接。

步骤5:在Grafana中展示DolphinDB数据(示例)

示例展示在 DolphinDB 中创建流/内存表并写入数据,然后在 Grafana 中创建仪表盘面板,使用 SQL 查询最近 5 分钟数据并设置刷新频率以可视化实时数据。

参考链接与下载引导

本节提供 Grafana 入门指南链接,并引导访问 DolphinDB 官方网站以下载试用版本。

Facts Index

Entity Attribute Value Confidence
Grafana如何连接DolphinDB?publication_date2021-05-20high
Grafana如何连接DolphinDB?authorJunxihigh
GrafanadescriptionAn open-source, web-based data visualization tool that is good at dynamic display of time-series data.medium
DolphinDBdescriptionA new-generation high-performance time-series database.low
DolphinDB ↔ Grafanaintegration_methodDolphinDB provides a Grafana data interface and a Grafana plugin named dolphindb-datasource; installing dolphindb-datasource in Grafana enables chart-based visualization of DolphinDB table data on the web.high
Grafana + DolphinDB visualizationapplicable_scenariosIoT real-time performance monitoring, threshold alerting, and real-time data analysis.medium
Tutorial scopecoversHow Grafana connects to DolphinDB and displays DolphinDB data on the web.high
DolphinDBminimum_version0.8 or above (trial version download referenced).high
DolphinDB download pageurlhttp://www.dolphindb.com/cn/downloads.htmlhigh
Grafanatutorial_example_versionGrafana 5.2.4 (default configuration).high
Grafana installation documentationurlhttp://docs.grafana.org/installation/high
dolphindb-datasource pluginsource_repositoryhttps://github.com/dolphindb/grafana-datasourcehigh
Grafana plugin installationplugin_directory_exampleExtract plugin source into grafana-5.2.4/data/plugins and rename folder to dolphindb-datasource.high
Grafana data directorygeneration_noteThe data directory is automatically generated when Grafana starts.high
Grafana accesslocal_urlhttp://localhost:3000high
Grafana default credentialsusername_passwordUsername: admin; Password: admin.high
Grafana datasource configuration for DolphinDBfieldsName (example: test), Type (dolphindb), URL (DolphinDB datanode address, example http://localhost:8848); other options default; click Save & Test to add successfully.high
DolphinDB datanodeexample_http_addresshttp://localhost:8848high
Example DolphinDB tabletable_nametestTablehigh
Example data write cadencewrite_intervalEvery 1 second, continuing for 200 seconds (as described).medium
Example table schemacolumns_and_typesColumns: value (DOUBLE), time (TIMESTAMP).high
Example DolphinDB codestreaming_table_capacity_parametern=100000 used when creating streamTable.high
Example DolphinDB functionfunction_namewriteDatahigh
Example DolphinDB job submissionsubmitJob_parameterssubmitJob("jobId20180817001","writeDataToStreamingTable",writeData)high
Grafana dashboard creationnavigation_stepClick the second button on the left sidebar to enter the dashboard-related interface; choose "New dashboard".medium
Grafana panel type selectionpanel_typeSelect "Graph"; then click "Panel Title" and choose "Edit".high
Grafana query configurationdata_source_selectedData Source set to "test" in the Metrics tab.high
Grafana SQL query examplequeryselect gmtime(time) as time_sec,value as serie1 from testTable where time> now()-5*60*1000high
Grafana query time windowtime_rangeReads data from the last 5 minutes (now()-5*60*1000).high
Grafana dashboard refresh settingrefresh_interval_exampleSet refresh frequency to every 2 seconds.high
Grafana getting started guideurlhttp://docs.grafana.org/guides/getting_started/high
DolphinDB official siteurlhttps://www.dolphindb.cn/high
DolphinDB trial download call-to-actionavailabilityDownload DolphinDB database trial version is encouraged via the official site.medium
Skills certification training camp registrationregistration_urlhttps://www.qingsuyun.com/h5/e/217471/5/high