Visualization in Grafana

Instructions related to the Grafana UI are applicable to Grafana v11.3.0.

Dashboards Configuration

Visualizing Metrics in Grafana requires a third-party plugin, such as Infinity plugin, which enables Grafana to query various data sources, including REST APIs. Follow the instructions below to configure Grafana and its dependencies.

1

Install the Infinity Plugin

  • Open your Grafana UI instance.

  • Navigate to Administration > Plugins (/grafana/plugins).

  • Search for "Infinity".

  • Click on Install to add the plugin to your Grafana instance.

Alternatively, you can install the plugin using the Grafana CLI by running:

grafana cli plugins install yesoreyeram-infinity-datasource

Check for other installation methods in the plugin's "Installation" documentation.

2

Add and Set Up New Data Source

  • In the Grafana UI, go to Connections > Data Sources (/grafana/connections/datasources).

  • Click Add new data source and search for the Infinity plugin to open data source configuration page.

  • Under URL, Headers & Params for the Infinity plugin, configure the Base URL field.

    • For example, if metrics are available by this URL http://<IP address>/metrics-server/api/v1/metrics/pipeline/classification, configure Base URL as http://<IP address>/metrics-server.

    • Bear in mind, the URL should be accessible from the Grafana instance and the /metrics-server path comes from the Kubernetes VirtualService (.spec.http.match.uri.prefix) resource that should have been created when installing the Metrics Server via Helm.

  • Save the data source configuration.

3

Import the Dashboard JSON

Use these instructions to import the dashboard provided below to visualize classification metrics or regression metrics.

  1. Navigate to Dashboards > New > Import page (/grafana/dashboard/import).

  2. In the Import Dashboard page, paste and load the entire JSON configuration into the Dashboard JSON field.

  3. During the import process, Grafana will ask for a data source. The imported dashboard is configured to use the Infinity plugin. Under "Datasource", ensure the Infinity data source is selected.

  4. Once the correct data source is selected, proceed to click Import.

4

Verify Dashboard Variables

Ensure you choose the correct namespace, pipeline name, model name, and interval.

  • namespace contains Namespaces retrieved from the subscriptions.

  • Pipeline Name contains pipelines deployed within the chosen namespace.

  • Model Name contains models that are part of the deployed pipeline.

  • Interval (interval) contains predefined interval values.

If you need to modify the variables (for example, to change the list of predefined intervals), you can do so in the Dashboard settings (gear icon in the top-right corner).

5

Configure Time Range

By default, the dashboard time range is set to the last 6 hours. However, if you want to view metrics for a specific time range, you can configure it as follows:

  1. Open the dashboard in Grafana.

  2. Click on the time range selector (usually displayed as "Last 30 minutes", "Last 24 hours", or a custom time range).

  3. On the left-hand side in Absolute time range, specify the From and To dates and times for the period you want to monitor.

    • The From time will define the starting point of the time range.

    • The To time will define the ending point of the time range.

  4. After setting the absolute time range, click Apply to confirm the changes.

  5. Change Interval dashboard variable if needed.

Troubleshooting

Dashboard variables selects (namespace, pipeline or model name) are empty

The dashboard uses templating variables such as namespace_var, pipelineName_var, modelName, and interval. These variables are required for the correct functioning of the dashboard and must be configured properly to fetch data from the API.

In case you don't see any values inside dashboard variables, ensure that each variable has the appropriate query set up to fetch data.

  1. Open the Dashboard settings (gear icon in the top-right corner).

  2. Go to the Variables section and verify the following queries for the variables:

    • namespace (namespace_var): fetches subscriptions using /api/v1/pipeline/subscriptions API and select namespace field from the API response rows.

    • Pipeline Name (pipelineName_var): fetches subscriptions using /api/v1/pipeline/subscriptions API, filter rows by the chosen namespace and select pipelineName field using UQL Query.

    • Model Name (modelName): fetches subscriptions using /api/v1/pipeline/subscriptions API, filter rows by the chosen namespace and pipeline, and select modelName field using UQL Query.

Dashboard does not display any data

If the dashboard does not display any data, verify the following:

  • Ensure that the Infinity data source is correctly set up.

  • Confirm that the API URL used in the dashboard's queries is correct and accessible from your Grafana instance.

  • Make sure the variables are properly configured and returning valid data.

  • If you’ve selected a namespace, pipeline, and model, and you see error warnings in the dashboard, try fetching the metrics API outside of Grafana to get a more detailed response error from the server. Currently, the Infinity plugin does not expose API server error descriptions.

If there are no data points within the time bucket:

  • -1 will be returned for scalar metrics such as Accuracy, Recall, Precision, Specificity, F1, MSE, MAE, and RMSE.

  • An empty array will be returned for non-scalar fields, such as the confusion matrix fields.

The Grafana dashboard JSON models provided below are configured to filter out -1 values, so they will not be reflected on the chart. This behavior can be modified in the Panel settings under the Transformations tab.

Refer to the documentation of Infinity plugin limitations.

Classification Metrics Dashboard

A Classification Metrics dashboard is available to monitor key performance metrics for classification models deployed with Core 2. This dashboard provides insights into classification metrics.

Classification Metrics

Use the instructions above to import and configure the dashboard configuration JSON for classification metrics provided below:

Example of a Classification Metrics dashboard using test data

Regression Metrics Dashboard

A Regression Metrics dashboard is available to monitor key performance metrics for regression models deployed with Core 2. This dashboard provides insights into regression metrics.

Regression Metrics

Use the instructions above to import and configure the dashboard configuration JSON for regression metrics provided below:

Example of a Regression Metrics dashboard using test data

Last updated

Was this helpful?