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:

  1. In the Query configuration for a panel (visualization) object, e.g. a table, gauge, or chart,

  2. 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:

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:

{
  "cache": "plants",
  "column": "Plant",
  "filter": {"Status": "online", "On Schedule": true}
}

To complete the query configuration: