Monitoring metrics collected by a Prometheus server

You can monitor your system resources by using metrics data that are collected by a Prometheus server while executing a schedule.

Before you begin

You must have created a project in HCL OneTest Server.

You must have installed and configured a Prometheus server.

Read the concept information about Resource Monitoring and monitoring Prometheus server source. See Resource Monitoring service

About this task

The following procedure describes how to select and create Prometheus queries in HCL OneTest Server. You must set a connection between HCL OneTest Server and the Prometheus server first to access to the Prometheus queries.

Enter the connection settings, then select queries.

Procedure

  1. Click Add a source and select Add a Prometheus Server.
  2. Enter the connection settings in the New server dialog box,.
    1. In Target host, enter the IP address or host name and port number of the host where the Prometheus server is installed.
    2. Enter the Path to the API root of Prometheus to point to the Prometheus API where the monitoring data are saved.
    3. Enter the security parameters if required. For information about this section, see related links.
    4. Click Add to close the dialog box.
    The Prometheus server source is created successfully in the background and a dialog box opens to select the Prometheus data queries.
  3. In the Select Prometheus queries dialog box, select queries that are available in the list to collect Prometheus metrics data by clicking the checkboxes.
    You can reset the selection.
    Select Prometheus queries dialog box
  4. Follow these steps to create a query:
    1. Click Add a query.
    2. Enter a name for the new query in the Create a Prometheus query dialog box.
    3. Enter a PromQL query.any keyword and press Ctrl+Space in the Type and test your PromQL query.
      All the possible combinations of keywords and metrics related to your searched keyword are listed.Field where you can enter and test a PromQL query
    4. Select a query in the list.
    5. Click the link that points to the 'Querying Prometheus documentation' page in the information tool tip to find other examples of queries in a web page that you can use as samples.
      Field where you enter a PromQL query
    6. Click Test query.
      If the test is successful, a green check is displayed, otherwise you get a red check with an error message.
    7. Click Create.
  5. Proceed as follows to duplicate a query:
    1. Click the Duplicate icon image of duplicate icon to duplicate a standard query.
    2. Rename the duplicated query in the View the Prometheus query dialog box.
      Make sure that the name you give to the query is not already used.
    3. Modify the query type.
    4. Test the query .
    5. Click Create.
    Note: You can click Create or Duplicate only if the test of the query is successful and the name of the query is not already in use.

    Create a Prometheus query window
  6. Proceed as follows to modify a query:
    1. Click the Modify icon image of modify icon.
    2. Modify the name and type of the query.
    3. Test the query.
    4. Click Update.
    5. Delete duplicated or created queries.
    6. Click Save to close the Select Prometheus queries dialog box.
  7. Click Save and close the Select Prometheus queries dialog box.

Results

The Resource Monitoring page displays the total number of sources you have added to your project and the number of sources ordered by type in cards.

What to do next

Click the links in the cards to go to the sources page and see the performance metrics for each source you added to your project. For more details, see Viewing the performance metrics