Monitor Cloud Exchange with Prometheus and Grafana

Monitor Cloud Exchange with Prometheus and Grafana

Configure a Metric Exporter for Cloud Exchange

  1. Download the latest version of the linux node exporter from: Releases · prometheus/node_exporter.
    $ wget https://github.com/prometheus/node_exporter/releases/download/v1.7.0/node_exporter-1.7.0.linux-amd64.tar.gz
  2. Extract the node exporter and start it in the background.
    $ tar -xvf node_exporter-1.7.0.linux-amd64.tar.gz
    $ cd node_exporter-1.7.0.linux-amd64
    $ ./node_exporter &
  3. Verify the connectivity by opening your machine address with port 9100.
    > http://<machine_IP>:9100

Note

If this is to be used for an EC2 instance, make sure you expose the port from AWS console > inbound rules.

Note

We recommend that you configure Prometheus and Grafana on a new instance so it will not affect existing Cloud Exchange performance.

You will need to install docker and docker-compose on the new machine, and then use the steps in the following sections to configure Prometheus and Grafana on the new machine.

Configure Prometheus

  1. Create a prom directory in /opt.
    $ cd /opt
    $ mkdir prom
  2. Create a Prometheus config file with the following content.
    $ vi prom/prometheus.yml

    Note

    Change your machine IP in the targets section.

    global:
      scrape_interval: 15s
      scrape_timeout: 10s
      evaluation_interval: 15s
    alerting:
      alertmanagers:
      - follow_redirects: true
        enable_http2: true
        scheme: http
        timeout: 10s
        api_version: v2
        static_configs:
        - targets: []
    scrape_configs:
    - job_name: machines
      scrape_interval: 5s
      scrape_timeout: 5s
      scheme: http
      metrics_path: /metrics
      static_configs:
      - targets:
        - :9100 
  3. Create a docker-compose file with following content.
    $ vi prom/docker-compose.yml
    
    version: "3.3"
    services:
      prometheus:
        image: prom/prometheus
        volumes:
          - ./prometheus.yml:/etc/prometheus/prometheus.yml
        ports:
          - "9090:9090"
    
  4. Start Prometheus.
    $ cd prom
    $ docker-compose up -d
    $ cd ..
  5. Verify the connectivity by going to: http://<your machine ip>:9090/

Configure Grafana

  1. Create a grafana directory in /opt.
    $ cd /opt
    $ mkdir grafana
  2. Create a docker-compose file with following content.
    $ vi grafana/docker-compose.yml
    version: "3.3"
    services:
      grafana:
        user: "0"
        image: grafana/grafana-enterprise
        volumes:
          - ./data:/var/lib/grafana:z
        ports:
          - "3000:3000"
  3. Start Grafana.
    $ cd grafana
    $ docker-compose up -d
    $ cd ..
  4. Open the Grafana UI by going to: http://<your machine ip>:3000/
    1. Log in with default credentials admin / admin).
    2. Change the default password.
  5. Log in to Grafana with the new password.
  6. Now add Prometheus as the Data Source.
    1. Click the menu icon, expand Connections, and click Data sources.

    2. Click Add data source.

    3. Select Prometheus.

    4. Enter the Prometheus settings, and then scroll down and click Save & test.

  7. Create a Dashboard.
    1. Go to the home page and click Create your first dashboard.

    2. Click Import dashboard.

    3. Enter 1860 for the ID and click Load.

    4. Enter a Dashboard name, select the Prometheus data source that you added previously, and then click Import.

  8. Now you can see the dashboard for a Cloud Exchange instance.

Share this Doc

Monitor Cloud Exchange with Prometheus and Grafana

Or copy link

In this topic ...