Metric Management

Overview

In order to understand metric processing in RBMS it is key to understand how metrics are sampled on RBFS.

RBFS runs Prometheus, an open-source monitoring tool with built-in time series database, to sample metrics from the Brick Data Store (BDS). The BDS is an in-memory database developed by RtBrick and optimized for networking use cases. All configuration and state information is stored in BDS. BDS can be configured to expose certain BDS attributes as metrics in the Prometheus Exposition Format. Prometheus periodically samples the exposed values to create a time series over them. The Prometheus Query Language allows querying the time series data and to apply transformations and statistical computations.

Prometheus includes an alert manager to scan time series for alert conditions and to create a notification whenever an alert condition is satisfied. Since Prometheus runs on the switch the alert conditions are also evaluated on the switch.

All metrics and alerts that shall be enabled permanently by default are configured in the running configuration of the switch. CTRLD allows enabling and disabling metrics on-demand.

The main goal of RBMS is to provide quick access to metrics and time series visualization. RBMS runs a Prometheus instance to federate metrics from the Prometheus instances on the switches. Grafana, an open-source visualization platform, is used to visualize time series data.

The figure below summarizes how RBMS interfaces with Grafana and Prometheus.

RBMS Prometheus Grafana Integration

The RBMS UI provides quick access to Grafana dashboards and embedds dashboard panels in the RBMS UI. In addition, RBMS queries Prometheus based on the configured metrics and the inventory data to provide quick access to the current metric values.

The Metrics Sampling and Monitoring Tutorial provides more details about the concepts outlined in this section.

Working with metrics

Viewing metrics

To view the metrics of an element

  1. Click the Inventory tab. The list of pods appears.

  2. In the pods group box, click on the elements link for pod that contains the element you want to view the metrics for. The list of elements appears.

  3. In the elements group box, click on the element you want to view the metrics for.

  4. Click Metrics in the left navigation pane. The list of metrics and their current values appears.

Metric list
  1. Click on graph to view the time series of a metric.

Metric time series

Enabling a metric

To enable a metric, go to the metric list view

  1. Click Configure metrics. A list of available metrics appears.

Enable metrics
  1. Click Enable for all metrics you want to enable.

Disabling a metric

To disable a metric, go to the metric list view

  1. Click Configure metrics. A list of available metrics appears.

Disable metrics
  1. Click Disable for all metricy you want to disable.

Viewing element dashboards

To open a dashboards of an element

  1. Click the Inventory tab. The list of pods appears.

  2. Click on Elements in the left navigation pane to show the list of known elements.

  3. Click on the element for which you want to access a dashboard. Use the filter to search for a particular element.

  4. Click on Dashboards. The list of available dashboards appears.

Dashboard list
  1. Click on the Dashboard you would like to view. RBMS opens the dashboard in Grafana.

Managing metrics

Adding a new metric

To add a metric

  1. Click the Metrics tab. The list of metrics appears in the Metrics page.

  2. In the Metrics page, click the Add metric button. The New Metric page appears.

rbms metric add1
  1. In the Metric Name field, assign a unique metric name.

The metric name should be in lower case. The name suffix should contain the metric unit. The name prefix should be used to group metrics. Use the _ as delimiter. For example psu_powerout_milliwatts or psu_voltageout_millivolts
  1. In the Display Name field, assign a descriptive metric name.

  2. In the Unit field, specify the metric unit (e.g. °C, W, bps)

  3. In the Scope field, select the scope of the metric.

The following metric scopes exist:

Metric Scope

Description

Element

The metric exists for the element (e.g. chassis temperature)

Physical Interface

The metric exists per physical interface (e.g. interface utilization)

Service

The metric exists per service or daemon (e.g. CPU and memory utilization of a daemon)

Logical Interface

The metric exists per logical interface.

  1. Optionally restrict the metric to certain element roles and platforms.

rbms metric add2
  1. Click Add metric.

Adding the CTRLD configuration

The CTRLD configuration contains the JSON message to enable the metric via CTRLD.

To add the CTRLD configuration

  1. Click Configurations in the left navigation pane. The list of configurations appears.

  2. Click Add config. The New Configuration view appears.

  3. Add the CTRLD JSON object to the JSON editor.

rbms metric config ctrld1
rbms metric config ctrld2
The Metrics sampling and monitoring tutorial provides more information about how to use CTRLD API to manage metrics.
  1. In the Configuration Name field, enter CTRLD.

  2. In the Category field, enter RBFS.

  3. In the Description field, enter an optional description for the configuration.

  4. Click Add config to add the new configuration.

The value of the metric_name attribute in the CTRLD JSON object must be equal to the metric name in RBMS to avoid trouble.

Adding the Prometheus configuration

The Prometheus configuration provides the Prometheus queries to fetch the metrics from Prometheus.

To add the Prometheus configuration.

  1. Click Configurations in the left navigation pane. The list of configurations appears.

  2. Click Add config. The New Configuration view appears.

rbms metric config prometheus1
rbms metric config prometheus2
  1. Add the Prometheus JSON object to the JSON editor.

The Prometheus JSON object contains the following properties:

Attribute

Description

element

The Prometheus query to fetch the metric values for an element. RBMS replaces {{element_name}} with the name of the selected element.

ifp

The Prometheus query to fetch the metric values for a physical interface. RBMS replaces {{element_name}} with the name of the selected element and {{ifp_name}} with the name of the selected physical interface.

ifl

The Prometheus query to fetch the metric values for a logical interface. RBMS replaces {{element_name}} with the name of the selected element and {{ifl_name}} with the name of the selected physical interface.

service

The Prometheus query to fetch the metric values for a physical interfaces. RBMS replaces {{element_name}} with the name of the selected element and {{service_name}} with the name of the selected physical interface.

labels

String array with the names of the labels that shall be displayed in the metrics list.

  1. In the Configuration Name field, enter Prometheus.

  2. In the Category field, enter RBFS.

  3. In the Description field, enter an optional description for the configuration.

  4. Click Add configuration to add the new configuration.

Removing a metric

To remove a metric from RBMS

  1. Click on the Metrics tab. The list of metrics appears.

  2. Click on the metric you want to remove.

  3. Click on Remove metric. A confirmation dialog appears.

  4. Click on Confirm to remove the metric. Check the force option to remove the metric including the metric configurations.

Managing dashboards

Registering Dashboards

Configuring the visualization platform

RBMS needs to know the visualization platform hosting the dashboard that shall be accessible from RBMS.

To register a visualization platform

  1. Click the Inventory tab.

  2. Click on + to expand the Administration menu.

  3. Click on Dashboard & Panels in the navigation pane. The list of registered dashboards and panels appears.

rbms vis platform add1
  1. Click on Add visualization platform. The list of known visualization platforms appears.

rbms vis platform add2
  1. Click on Add visualization platform to add a new visualization platform. The New visualization platform appears.

rbms vis platform add3

In the Name field, provide a unique visualization platform name. In the Origin field, provide the origin of the visualization. In the Description field, provide an optional description of the visualization platform.

Click Add visualization platform to add the visualization platform.

Registering a dashboard

The dashboard must accept an element query parameter specifying the element for which the metrics shall be displayed.

To add a Grafana dashboard to RBMS

  1. Open the dasbhoard in Grafana.

  2. Click the Share Icon.

rbms dashboard grafana 1
  1. Uncheck the Current time option.

  2. Select the light theme.

  3. Click on Copy to copy the displayed link.

rbms dashboard grafana 2
  1. Proceed to RBMS.

  2. Click on the Inventory tab.

  3. Click on + to expand the Administration menu.

  4. Click on Dashboard & Panels in the left navigation pane. The list of registered dashboard and panels appears.

rbms vis platform add1
  1. Click Add visualization. The New Visualization page appears.

rbms dashboard reg1
  1. From the Visulization Platform select box, select the Grafana instance that hosts the dashboard.

  2. In the Visualization Name field, specify a unique descriptive name. The name is displayed in the dashboard list of an element.

  3. In the Description field, add an optional dashboard description. The description is displayed in the element dashboard list.

  4. Paste the link into the URL field. Assign {{element_name}} as value for the element variable declared in the dashboard. RBMS replaces {{element_name}} with the name of the currently displayed element.

  5. Optionally restrict the dashboards to certain element roles or platforms.

rbms dashboard reg2
  1. Click Add visualization to add the dashboard.

Registering a panel for a configured metric

The panel must accept URL query parameters specifying the element for which the metric shall be displayed.

To add a Grafana panel to RBMS

  1. Open the dasbhoard in Grafana.

  2. Open the context menu for the panel you want to embedd in RBMS.

  3. Click the Share menu.

rbms panel grafana 1
  1. Uncheck the Current time option.

  2. Select the light theme.

  3. Click on Copy to copy the displayed link.

rbms panel grafana 2
  1. Proceed to RBMS.

  2. Click on the Inventory tab.

  3. Click on + to expand the Administration menu.

  4. Click on Dashboard & Panels in the left navigation pane. The list of registered dashboard and panels appears.

rbms vis platform add1
  1. Click Add visualization. The New Visualization page appears.

rbms panel reg2
  1. From the Visulization Platform select box, select the Grafana instance that hosts the dashboard.

  2. In the Visualization Name field, specify a unique descriptive name.

  3. Check the Panel checkbox.

  4. In the Panel Name field, add the name of the metric displayed in the panel.

  5. In the Width field, add the width of the panel as absolute value (px or em) or in percent.

  6. In the Height field, add the height of the panel as absolute value (px or em) or in percent.

  7. In the Description field, add an optional dashboard description. The description is displayed in the element dashboard list.

  8. Paste the link into the URL field. Assign {{element_name}} as value for the element variable declared in the dashboard. RBMS replaces {{element_name}} with the name of the currently displayed element.

  9. Optionally restrict the panel to certain element roles or platforms.

rbms dashboard reg2
  1. Click Add visualization to add the panel.

Support for other visualization platforms

RBMS supports all visualization platforms accepting the element for which data shall be displayed as URL query parameter.