You can translate the document:

Goal

This document explains how to connect from Grafana to Denodo. Grafana is an open-source, general-purpose dashboard and graph composer, which runs as a web application. It supports graphite, InfluxDB or opentsdb as backends.

Content

Running Grafana

Grafana can be run in the cloud or installed on Windows, Mac, Linux, Docker or ARM platform:

  1. Download Grafana from https://grafana.com/grafana/download
  2. Start the server (<GRAFANA_HOME>/bin/grafana_server.sh|exe)
  3. Open the app in your browser, go to http://localhost:3000/login
  4. Login. By default, use admin/admin, but you will be asked to change the password after the first login

Setting up a Denodo Data Source in Grafana

  • Go to the menu Configuration > Data Sources
  • Click on the “Add Data Source” button
  • Name: Denodo
  • Type: PostgreSQL
  • Host: <Denodo host name>:9996 (default ODBC port)
  • Database: <virtual database name>
  • Login: <Denodo user>
  • Password: *******
  • SSL mode: disable
  • Click “Save & Test

Timeseries

In order to use Grafana’s Timeseries capabilities, you should make sure to have a timestamp column in the Denodo view you are accessing from Grafana.

For instance, if you have a view with a column representing a date but of ‘text’ data type, you can convert date string to timestamp value with the following function:

to_timestamp(‘format’, str value, locale)

With this string input ‘Tue Dec 04 2018 17:36:44 GMT’ it will look something like this:

to_timestamp('EEE MMM dd yyyy HH:mm:ss z', <input>, 'en_US')

You can find references for date formatting here: SimpleDateFormat.

You also need to make sure that the values used in Grafana are numeric type. You can convert those values using the cast function:

CAST(<value> AS FLOAT)

Creating a Dashboard Panel in Grafana

  • Click on “Add panel” in your selected dashboard.
  • Under the panel name select the “Edit” menu.
  • Select the Denodo Data Source.
  • Type your VQL query:

SELECT  $__time(timestamp), value

FROM dv_my_view

WHERE $__timeFilter(timestamp) and

sensor='temperature' and

devicename='DenoSens1'

Questions

Ask a question

You must sign in to ask a question. If you do not have an account, you can register here