Prometheus integration

Prometheus Server is a Trento Server component responsible for pulling the Memory and CPU utilization metrics collected by the node-exporter in the agent hosts and serving them to the web component. The web component renders the metrics as dynamic graphical charts in the details view of the registered hosts.

Requirements

The node-exporter must be installed and running in the agent hosts and Prometheus Server must be able to reach the agent hosts at the IP address and port that the node-exporter is bound to.

The IP address and port that Prometheus Server uses to reach the node-exporter can be changed by setting parameter node-exporter-target with value <ip_address>:<port> in the agent configuration file.

If the parameter is not set, Prometheus Server uses the lowest IPv4 address discovered in the host with default port 9100.

Kubernetes deployment

When using the Helm chart to deploy Trento Server on a Kubernetes cluster, an image of Prometheus Server is deployed automatically. No further actions are required by the user, other than ensuring that it can reach the node-exporter in the agent hosts.

In a Kubernetes cluster with multiple nodes, the user can select on which node to deploy the Prometheus Server by adding the following flag to the Helm installation command:

--set prometheus.server.nodeSelector.LABEL=<value>

Where <value> is the label assigned to the node where the user wants Prometheus Server to be deployed.

systemd deployment

In a systemd deployment of Trento Server, you can choose between using an existing installation of Prometheus Server, installing a dedicated Prometheus Server instance, or not using Prometheus Server at all.

Use an existing installation

If you already have an existing Prometheus Server that you want to use with Trento Server, you must set CHARTS_ENABLED=true and PROMETHEUS_URL pointing to the right address and port in the Trento Web configuration file. You must restart restart the Trento Web service to enable the changes.

The lowest required Prometheus Server version is 2.28.0.

Use the section Install Prometheus on SUSE Linux Enterprise Server for SAP applications 16.0 as a reference to adjust the Prometheus Server configuration.

Install Prometheus Server from SUSE Package Hub on SUSE Linux Enterprise Server for SAP applications 15.x

SUSE Package Hub packages are tested by SUSE but are not officially supported as part of the SUSE Linux Enterprise Server for SAP applications base product. Users should assess the suitability of these packages based on their own risk tolerance and support needs.

Enable the SUSE Package Hub repository (replace 15.x with the version of your operating system, for example 15.7):

SUSEConnect --product PackageHub/15.x/x86_64
zypper refresh

Now proceed with the same steps as in Install Prometheus on SUSE Linux Enterprise Server for SAP applications 16.0.

Install Prometheus on SUSE Linux Enterprise Server for SAP applications 16.0

  1. Create the Prometheus user and group:

    groupadd --system prometheus
    useradd -s /sbin/nologin --system -g prometheus prometheus
  2. Install Prometheus using Zypper:

    zypper in golang-github-prometheus-prometheus
  3. Configure Prometheus for Trento by replacing or updating the existing configuration at /etc/prometheus/prometheus.yml with:

    global:
      scrape_interval: 30s
      evaluation_interval: 10s
    
    scrape_configs:
      - job_name: "http_sd_hosts"
        honor_timestamps: true
        scrape_interval: 30s
        scrape_timeout: 30s
        scheme: http
        follow_redirects: true
        http_sd_configs:
          - follow_redirects: true
            refresh_interval: 1m
            url: http://localhost:4000/api/prometheus/targets

    Note: the value of the url parameter above assumes that the Trento Web service is running in the same host as Prometheus Server.

  4. Enable and start the Prometheus service:

    systemctl enable --now prometheus
  5. If firewalld is running, allow Prometheus to be accessible and add an exception to firewalld:

    firewall-cmd --zone=public --add-port=9090/tcp --permanent
    firewall-cmd --reload
  6. Set CHARTS_ENABLED=true and PROMETHEUS_URL=http://localhost:9090 in the Trento Web configuration file and restart the Trento Web service.

    systemctl restart trento-web

    Note: the value of the PROMETHEUS_URL parameter above assumes that the Trento Web service is running in the same host as Prometheus Server.

Not using Prometheus Server

If you decide not to use Prometheus Server in your Trento installation, you must disable graphical charts in the UI by setting CHARTS_ENABLED=false in the Trento Web configuration file.