Plugin for Grafana
rtvquery - a data source plugin for RTView
This plugin provides access to cache data stored on an RTView Enterprise data server.
Setup
You should add and configure one instance of this plugin for each RTView data server from which you'd like to view data on a Grafana dashboard. You'll need to know the URL for each data server's rtvquery servlet. For an RTView EE central server that URL would typically be <https://myhost:8068/rtview-central-rtvquery
.> In that case, the rtvquery data source plugin would be configured as follows:
HTTP
URL: <https://myhost:8068/rtview-central-rtvquery>
Access: Server
The Access setting determines how a Grafana dashboard sends http requests for cache data to that rtvquery servlet. If Access = Server (the default) each request is sent to the Grafana server which routes it to the rtvquery servlet. If Access = Browser the request is sent directly to the servlet, which is slightly more efficient. However, server access is required if the rtvquery servlet is behind a firewall and is accessible from the Grafana server but not from client browsers. It also avoids CORS restrictions that would otherwise require tweaks to the rtvquery servlet's web.xml deployment file.
If the rtvquery servlet is secured (requires login) you'll also need to configure the Auth section for the plugin:
Click the toggle for Basic Auth. Do not enable the "With Credentials" option.
Next, in the Basic Auth Details section, enter the username and password for the rtvquery login.
AUTH
Basic auth: yes. With Credentials: no
Basic Auth Details
User: rtvuser
Password: ***
Use
The rtvquery plugin can be used to apply rtview cache data to a Grafana dashboard in two ways:
In the Query configuration for a panel (visualization) object, e.g. a table, gauge, or chart,
In the Variables configuration for the dashboard, to assign a variable's possible values.
These are described below.
Panel object query
Click Edit on the panel object's title. Then in the Query tab, select an instance of the rtvquery plugin from the dropdown list of available data sources. The cache query editor appears, with these fields:
Cache: a dropdown list of the caches available on the data server
Table: a dropdown list of the tables in the selected cache (current, history, etc)
Columns: Defaults to
-All-
for all columns. You can select a column from the dropdown, then click+
to select one or more additional columns. Select-- remove --
from the dropdown to remove a previously added column. You can't remove the first column, or reorder columns (but see the text edit mode section below).Filter: Blank by default. Click
+
to select a column and enter a filter value for that column. The values are compared for an exact match, wildcards are not supported. Use a comma to separate multiple filter values for the same column, (e.g. Plant = Baltimore,Dallas). You can also specify a filter value of $x where x is the name of a dashboard variable.Format as: Select
time series
if the visualization object is a graph (time chart), otherwise selecttable
Text edit mode
This is intended for advanced users. If you click the pencil icon (tooltip = Toggle text edit mode) the query is shown in JSON format. You can use this mode to reorder columns, or as a quick way to make other changes that might be cumbersome using the dropdowns. But you'll need to pay attention to correct use of quotes, commas, etc to avoid syntax errors.
Variable assignment query
You can use the rtvquery plugin to assign a list of values to a dashboard variable from a single column in a cache table. The variables can be useful for filtering queries on panel objects, as described above.
Click the dasboard settings (gear) icon, then select the Variables tab, then add a new variable or select an existing one. In the General section, set Type = Query
. Then in the Query Options section, select an rtvquery instance from the Data Source dropdown. Set Refresh = On Dashboard Load
, so that the query is run each time the dashboard is loaded.
Next, in the Query section, specify the name of the cache and the column from which the values should be retrieved, in JSON format. For example, if you want to use the values from the Plant column in a cache named plants, enter the following:
{"cache": "plants", "column": "Plant"}
If you want to apply a filter to the column so that only certain values from the column are used, add a filter field to specify column name:value pairs. For example, this query gets values from the Plant column in the plants cache, but only from rows where the value in the Status column is "online" and the value in the On Schedule column is true:
To complete the query configuration:
In the Selection Options section, you must deselect the Multi-value option.
If you want "All" to be included in the list of possible values for the variable, select
Include All option
. Then you must setCustom all value = *
.