Skip to content

⛑️ Prometheus Configuration

📝 Overview

After installing the Prometheus Server, you can view the install-info.txt to find the Grafana and Prometheus Server URL , and thier default admin Credential.

By default, the installation via script generated on EdgeHit Controller will automatically add the CP as a target of the Prometheus Server. You need to use the bash script in the machine to add Load Proxy node as target of the prometheus server


Below are several important file to take note in Prometheus Server

  • /usr/local/edgehit/prometheus/install-info.txt to find Grafana Dashboard URL and Default Admin Credential

  • /usr/local/edgehit/prometheus/bin/edge-target.sh to add Load Proxy as Scraping Target to the Prometheus server

Note

Node-Exporter are installed to EdgeHit Controller and Load Proxy with PSK Authentication using HTTP AUTH.



🔧 Add Load Proxy as Target

All action are performed by a bash script named edge-targets.sh at /usr/local/edgehit/prometheus/bin/edge-targets.sh the usage of the script is shown below:

bash ./edge-targets.sh <command> [argument]
Command Argument Description
add IP or domain Add a Load Proxy as target into Prometheus config.
remove IP or domain Remove a Load Proxy target from Prometheus config.
list (none) List all target of Prometheus config.
help (none) Display help message.

Note

The Script above reads EDGE_HTTP_AUTH_PASS value from the .env file of Prometheus Server. Make sure that this corespond to the same value in the Load Proxy Instance.



✂️ Add LoadUP as Target

Note

If you defined EDGE_HTTP_AUTH_PASS value in LoadUP-CP and LoadUP-Worker to be same as Load Proxy, you can use the above step to configure LoadUP as Target. Else, you need to follow the step below to add Prometheus Target

You need to manually configure the Promotheus.yml since the EDGE_HTTP_AUTH_PASS in LoadUP-CP and LoadUP-Worker is not defined in Prometheus Server.

The Prometheus Process is running on a docker image with config file mounted to /usr/local/edgehit/prometheus/storage/conf/prometheus/. Thus you can edit the file directly on Prometheus server

  1. note down the value of LOADUP_HTTP_AUTH_PASS in LoadUP-CP and loadup_worker_http_auth_pass in LoadUP-Worker. You can refer to the command below:

    On LoadUP-CP
        grep '^LOADUP_HTTP_AUTH_PASS=' /usr/local/loadup/loadup-cp/.env
    

    On LoadUP-Worker
        grep '^Loadup_worker_http_auth_pass=' /usr/local/loadup/loadup-worker/.env
    

  2. On the prometheus Server, edit the file /usr/local/edgehit/prometheus/storage/conf/prometheus/prometheus.yml and add following under the section scrape_configs

    On prometheus.yml
        - job_name: LoadUP-CP
            scheme: https
            basic_auth:
            username: 'admin'
            password: '<LOADUP_HTTP_AUTH_PASS>'
            tls_config:
            insecure_skip_verify: true
            static_configs:
            - targets:
                - '<LoadUP-CP Domain>:9200/metrics'
    
        - job_name: LoadUP-Worker
            scheme: https
            basic_auth:
            username: 'admin'
            password: '<Loadup_worker_http_auth_pass>'
            tls_config:
            insecure_skip_verify: true
            static_configs:
            - targets:
                - '<LoadUP-Worker Domain>:9200/metrics'
    

    Note

    You can also define the same key for both CP and Worker by editing the .env value and Restart the docker-compose stack, so you can define both under same job and it will be tidier.



🔨 Add Dashboard to Grafana

The grafana server is installed without any dashboard, So you can choose dashboard based on own preference. Below shows an example on how to configure grafana

  1. Login to the web console using default credential in install-info.txt

  2. Navigate to Home > Dashboard section on the side panel Pic

  3. Click on New dashboard Pic

  4. Define you own dashboard or import the node exporter-full instance using the ID 1860. For more info, refer to Grafana Dashboards Pic

  5. Once the dashboard is added, you can view it at the Dashboard Section. Pic

    • There are 3 jobs which coresponds to the Node-Exporter metric from EdgeHit Controller , Load Proxy, Or the Prometheus Server. ( node coresponds to the Load Proxy nodes)
    • There are 1 nodename under each job except the node job which will show nodename that is added via edge-targets.sh script.

    Same output for job edgesuiite and prometheus-node

    if EdgeHit Controller and Prometheus Server is on same node, the two job actually output metric for the same server. As the the exporter itself is build into docker-image for each installation script.