Grafana Data Source
Grafana is an open source visualization tool which can be used to visualise data from ITRS Analytics. If you have existing Grafana installs, you can seamlessly integrate data from ITRS Analytics into your current dashboards.
You can also create visualisations using ITRS Analytics Dashboards.
Prerequisites Copied
Note
Starting with Grafana data source version 3.0.2, the new ITRS Analytics data source plugin replaces the previous ITRS Group Obcerv plugin. The old ITRS Group Obcerv plugin is no longer supported.
-
Grafana (version 9.5.3 or higher, up to 10.2.2) is installed and running. For more information, refer to the Grafana installation documentation,
-
The Grafana and ITRS Analytics Keycloak integration is configured and functioning correctly. For guidance, see How to configure Grafana to authenticate users via ITRS Analytics.
Configure the data source Copied
To download and install the plugin, choose one of the following options:
- From the Grafana Plugins website
- By manually downloading the Grafana data source from the ITRS Resources website
Once you have logged into your instance of Grafana, you must configure the ITRS Analytics data source.
To add a new data source:
-
Go to Administration > Data sources in the Grafana navigation panel.
-
Click Add data source, search for
ITRS Analyticsand select it. -
Specify the data source settings. The following settings are available:
Field Description Name Specify a display name for the data source. ITRS Analytics API Host and port of the ITRS Analytics REST API, for example, https://local.itrslab.com/obcerv-app-api-gatewaySkip tls verification If you want to skip the TLS verification. - You can also click on the Default switch on the top of the screen if you want it to appear as default datasource.
-
Click Save & test to save the configuration.
For more information, see the official Grafana documentation to add a data source here.
Query the data source Copied
To visualise data from ITRS Analytics, you can create a new panel in a new or existing Grafana dashboard.
-
Open a dashboard or create a new dashboard.
-
Click New > New dashboard, and then click Add visualization.
-
Select the default data source.
-
Under Queries, set the query to the ITRS Analytics data source using the name you specified above.
-
Specify the query parameters:
Field Description Alias Displayed in the legend to identify a time series. Filter Filters will be available for auto-completion when composing a query, they are in the form _attribute/dimension="value"_, for example_pod="collection-agent-sx6cv"_.Metric Name of the metric. Metrics will be available for auto-completion. Group by Dimensions or attributes to group by the results. Buckets Used to populate the BucketsinBucketRequest.Bucket function Used to populate the FunctioninBucketRequest.Forecast If enabled, returns the forecast of the selected metric. Please note that it only works if the filter returns only one metric.
To use status metrics, select the metric and select All fields to display non-numeric fields:
Templates and variables Copied
You can define variables in Grafana that allow you to dynamically change the data displayed on your dashboards. You can use the ITRS Analytics data source to populate variables.
To add a new ITRS Group ITRS Analytics query variable:
-
Go to the Dashboards and click Edit to switch to edit mode.
-
Open the Dashboard settings.
-
Click Variables > Add variable.
-
Configure the variable using the following options:
Field Description Name Variable name, this name will be used in the data source to refer to the variable with the $symbol in front.Label Label of the text box displayed in the panel. Data source Specify ITRS Analytics.Query Specify the query used to populate the variables list. -
(Optional) You can check multi-value switch if you want to choose more than one value for the variable.
-
To see a preview of the values, click Run query.
Grafana query syntax Copied
The syntax for the Query used to get the variable values is json with the form:
{ "name": "<dimension-or-attribute>" }
Consider this as an example:
{ "name": "container" }
Variables with filter Copied
Variables can be filtered by another variable, using a dimension or an attribute. The syntax to populate variables with a filter is:
{ "name": "<dimension-or-attribute>", "filter": [{ "name": "<dimension-or-attribute>", "value": "$variableName1" }] }
The filter is a list of objects with the fields name and value. The name must be an attribute or dimension name, the value can be a specific value or the name of another variable with the $preffix. For example, if a variable named kubecontainer exists, then the query could be:
{ "name": "pod", "filter": [{ "name": "container", "value": "$kubecontainer" }] }
This allows variable chaining so the values of some variables can be used to filter other dependent variables.