Opening SystemLink Test Result From Grafana Using Dynamic Links

Updated Apr 12, 2024

Environment

Software

  • SystemLink Server
  • SystemLink Test Module
  • SystemLink Jupyter Notebook Add-On

This article demonstrates how to add a dynamic link to a Grafana panel displaying SystemLink Test Insights information. This functionality allows a user to click on a specific cell in a Grafana table and open the corresponding Test Result page in SystemLink.
 

Prerequisites

Follow the steps below to configure a Grafana panel (such as a table) consisting of test result information to link to specific Test Results in SystemLink.
 
  1. Ensure that the Grafana panel consists of a column displaying the Result ID for each individual result.
  2. Hover over the Grafana panel and press E on the keyboard to enter Edit Mode.
  3. In the options window to the right-hand side, scroll to find the Data Links option.
  4. Click Add Link.
    • Note: this link will apply to the entire table.
  5. [OPTIONAL] In the pop-up window, enable Open in new tab.
  6. Enter the URL corresponding to the Test Result URL in SystemLink.
    • This URL takes the format of https://<server name>/#testmonitor/testresults/testresult/<result ID> or  http://<server name>/#testmonitor/testresults/testresult/<result ID> depending on whether your server is configured for HTTPS or HTTP.
    • To create a static link (i.e. open the same test result regardless of which table cell is clicked):
      1. In SystemLink, select Test Insights >> Results.
      2. Select the specific result that you wish to link to.
      3. Copy the URL directly into the Grafana Data Link.
    • To create a dynamic link (i.e. open a different test result depending on which table cell is clicked):
      1. The Data Link URL should be <http or https>://<server name>/#testmonitor//testresults/testresult/${__data.fields["<Result IDs Column>"]}
      2. <http or https> depends on whether your sever is configured for HTTPS. To check this, open the NI Web Server Configuration application and review the HTTPS tab.
      3.  <server name> is the name of your SystemLink Server.
      4. <Result IDs Column> is the name of the column in the table that stores the result IDs.
    • The images below show a Grafana table with a column called "Result ID", and a Data Link with the syntax http://<server name>/#testmonitor//testresults/testresult/${__data.fields["Result ID"]}

Grafana Dashboard With Result ID.PNG

Data Link.PNG
 
  1. [OPTIONAL] To hide the "Result ID" column in the table, while maintaining the dynamic link functionality, you must configure an Override. Follow the steps below:
    1. Hover over the panel and press E on the keyboard to enter Edit Mode.
    2. From the Options window on the right-hand side, select the Overrides tab.
    3. Click Add Field Override.
    4. Select Fields with Name. In the drop-down menu, select the name of the column that you wish to hide.
    5. Click Add Override Property. In the drop-down menu, select Hide in Table.
    6. Enable the Hide in Table option.
    7. Below is a picture of the Grafana panel after enabling the Hide in Table option. The "Result ID" column is no longer visible to the user, but the dynamic links still apply.

Grafana Dashboard Without Result ID.PNG