Skip to content

[ #004 ] NMaaS-101 - "Prometheus"

In article #001 and #002 you essentially created a NMaaS domain and enabled connectivity between your dedicated and isolated domain to your out of band management equipment network.

Requirements

  • Completed #001
  • Completed #002
  • Basic knowledge related to configuration management
  • Overview

    In this post, we are going to deploy an interesting and popular Metric collector in the micro-service world: Prometheus. For those who would like an introduction to Prometheus, please refer to this post from the RARE project blog.

    Article objective

    This is done in 2 steps:

    • Prometheus application deployment via the NMaaS portal
    • Prometheus configuration specific to RARE domain

    Diagram

    NMaaS portal: Oxidized Diagram

    [#003] - Cookbook

    Prerequisites
    • Having completed #001
    • Having completed #002
    Prometheus application deployment
    • Once your domain is created and associated to your account, log into https://nmaas.eu as in #001
    • select Prometheus application

    Select Oxidized

    • select "Deploy"

    Instance

    • choose a name for your service instance, in our case we chose: "prm"

    The name has a particular importance as it will dynamically create a FQDN for the NMaaS service in the form: <service_name>.<domain>.nmaas.eu In my example it is: prm.rare.nmaas.eu

    • Click on configure (blue bottom on the lefthand side) information

    Instance

    Instance

    • Prometheus access username

      we chose: prometheus

    • Prometheus access password

      we chose: prometheus

    • Global scrape

      As per RARE blog article: 15s

    • Global evaluation

      As per RARE blog article: 30s

    • Jobs

      Job name: router

    • Device (IP address)

      we chose: 192.168.0.1:9001

    • Apply configuration

    Configuration

    VPN Connectivity Warning

    It is important to note that you'll be connected inside a dedicated VPN so you'll be isolated from the outside world as if you were running your own Out of band management network. So we can assume that your domain is secured.

    • Prometheus micro-service status will be update to "Activation in progress"

    INPROGRESS

    • After few minutes the deployment status will be set to "Active"

    INPROGRESS

    Congratulation. You should have completed Prometheus deployment

    Prometheus application specific configuration

    In the RARE domain we have specifically configured a Prometheus agent on each P4 switch. In the configuration above we have only configured a dummy IP address.

    Subsequent configuration will be done through the usual NMaaS micro-service-configuration workflow using git. (Similar to Oxidized post)

    We are using then NMaaS configuration feature (also refer to NMaaS configuration process), which actually will provide us the way to alter Prometheus configuration software.

    • From the NMaaS portal service instance page select "configuration" entry from the drop-down list

    CONFIGURE

    • you should be provided a git command that will let you clone your Prometheus NMaaS configuration repository

    UPDATE

    From a terminal, clone oxidized configuration repository
    1
    2
    3
    4
    5
    6
    7
    git clone ssh://[email protected]/groups-rare/rare-prometheus-382.git
    < enter my SSH credientials ... >
    cd rare-prometheus-382
    ╭─[05/6/21|11:18:47][email protected] ~/rare-prometheus-382  ‹master›
    ╰─➤  ls -l
    total 8
    -rw-r--r--  1 loui  staff  297 May  6 11:17 prometheus.yml
    
    • You can now configure prometheus with your target config and adjust it as you see fit

    For more information please refer to Prometheus official documentation.

    In our case we will use prometheus configuration from the RARE blog post.

    From a terminal, clone oxidized configuration repository
    global:
        scrape_interval: 15s
        evaluation_interval: 30s
    alerting:
        alertmanagers:
            - static_configs:
                - targets:
    rule_files:
    scrape_configs:
        - job_name: 'router'
        metrics_path: /metrics
        scrape_interval: 15s
        static_configs:
        - targets: ['192.168.0.1:9001','192.168.0.2:9001']
            labels:
    

    Verification

    Check that you can access Prometheus using: <svc-name>.<domain>.nmaas.eu
    • Access the application

    ACCESS

    • "Access the application" button shortcut

    ACCESS

    it will lead you to a dynamic FQDN: https://prm.rare.nmaas.eu

    You have now access to Prometheus console

    CONSOLE

    • You can check if the configured agent is reachable

    TARGET

    • In this case you have a problem to reach the Prometheus agent. (Check connectivity to the configured Agent 192.168.0.1:9001 in prometheus.yml)

    TARGET

    Congratulations! You have deployed and configured your Prometheus NMaaS service specifically for your domain !

    Conclusion

    In this article you:

    • You have deployed a powerful and flexible metric collector for your organisation
    • Prometheus uses PUSH model similar to SNMP so every scrape minutes it will interrogate all the configured agents.
    • You have learned how to apply specific configurations to it in order to match your requirements
    • In this example, we used RARE/freeRtr prometheus agent whose configuration is described here. In your case, you agent will have its own different configuration (different IP, port, job name and metrics )

    [ #004 ] NMaaS-101 - key take-away

    • Deploying a NMaaS service is as easy as deploying an application on your mobile phone, you just have to log into the NMaaS portal and of course have the sufficient privileges to deploy application for your domain
    • Deploying an application is a 2 steps process
      • deploy the application via the portal
      • configure the application via git tool
    • Even if Prometheus deployment by NMaaS is made easy, it is mandatory to have a strong knowledge of the tool implemented. In this case, it is of course essential to read documentation from Prometheus web site.