Skip to content
Ondrej Fabry edited this page Jul 24, 2020 · 8 revisions

VPP Agent has Telemetry plugin that exposes VPP statistics in Prometheus format through the default webserver running at port 9191.

The URL for the VPP metrics is /metrics.

For more info about the Telemetry plugin go to: https://docs.ligato.io/en/latest/plugins/vpp-plugins/#telemetry

Prometheus

How to run prometheus:

Guide from Prometheus docs https://prometheus.io/docs/prometheus/latest/installation/ and Docker docs: https://docs.docker.com/config/thirdparty/prometheus/

# point to config below on host
docker run -p 9090:9090 -v /tmp/prometheus.yml:/etc/prometheus/prometheus.yml \
       prom/prometheus

Here is sample configuration file for Prometheus to collect the metrics exported by VPP Agent:

prometheus.yml

global:
  scrape_interval:     15s

scrape_configs:
  - job_name: 'prometheus'
    static_configs:
      - targets: ['localhost:9090']

  - job_name: 'agent'
    metrics_path: '/metrics'
    static_configs:
      - targets: ['172.17.0.3:9191']

  - job_name: 'vpp'
    metrics_path: '/metrics/vpp'
    static_configs:
      - targets: ['172.17.0.3:9191']

Grafana

How to run grafana:

Guide from Grafana docs: https://grafana.com/docs/installation/docker/

# without persistence
docker run -d -p 3000:3000 grafana/grafana

# to persist data in volumes
docker run -d -p 3000:3000 \
    -v /var/lib/grafana:/var/lib/grafana \
    -e "GF_SECURITY_ADMIN_PASSWORD=secret" \
    grafana/grafana

Here is sample dashboard that shows the metrics collected by Prometheus.

And here is the configuration for the dashboard above. It can be imported using Grafana GUI.

grafana dashboard config

{
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "description": "Metrics retrieved from telemetry plugin",
  "editable": true,
  "gnetId": null,
  "graphTooltip": 0,
  "id": 1,
  "iteration": 1558618291472,
  "links": [],
  "panels": [
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "Prometheus",
      "description": "",
      "fill": 1,
      "gridPos": {
        "h": 9,
        "w": 15,
        "x": 0,
        "y": 0
      },
      "id": 12,
      "interval": "",
      "legend": {
        "alignAsTable": true,
        "avg": false,
        "current": true,
        "hideEmpty": false,
        "hideZero": false,
        "max": false,
        "min": false,
        "rightSide": true,
        "show": true,
        "sort": null,
        "sortDesc": null,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 2,
      "links": [],
      "nullPointMode": "null",
      "percentage": false,
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [
        {
          "alias": "/bytes/",
          "yaxis": 2
        }
      ],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "vpp_interfaces_rx_bytes{agent=\"$agent\"}",
          "format": "time_series",
          "hide": false,
          "interval": "",
          "intervalFactor": 1,
          "legendFormat": "{{name}} - RX bytes",
          "refId": "D"
        },
        {
          "expr": "vpp_interfaces_tx_bytes{agent=\"$agent\"}",
          "format": "time_series",
          "hide": false,
          "interval": "",
          "intervalFactor": 1,
          "legendFormat": "{{name}} - TX bytes",
          "refId": "E"
        },
        {
          "expr": "vpp_interfaces_rx_packets{agent=\"$agent\"}",
          "format": "time_series",
          "hide": false,
          "interval": "",
          "intervalFactor": 1,
          "legendFormat": "{{name}} - RX packets",
          "refId": "C"
        },
        {
          "expr": "vpp_interfaces_tx_packets{agent=\"$agent\"}",
          "format": "time_series",
          "hide": false,
          "interval": "",
          "intervalFactor": 1,
          "legendFormat": "{{name}} - TX packets",
          "refId": "B"
        },
        {
          "expr": "vpp_interfaces_rx_errors{agent=\"$agent\"}",
          "format": "time_series",
          "hide": false,
          "interval": "",
          "intervalFactor": 1,
          "legendFormat": "{{name}} - RX errors",
          "refId": "H"
        },
        {
          "expr": "vpp_interfaces_tx_errors{agent=\"$agent\"}",
          "format": "time_series",
          "hide": false,
          "interval": "",
          "intervalFactor": 1,
          "legendFormat": "{{name}} - TX errors",
          "refId": "I"
        },
        {
          "expr": "vpp_interfaces_drops{agent=\"$agent\"}",
          "format": "time_series",
          "interval": "",
          "intervalFactor": 1,
          "legendFormat": "{{name}} - drops",
          "refId": "A"
        },
        {
          "expr": "vpp_interfaces_punts{agent=\"$agent\"}",
          "format": "time_series",
          "interval": "",
          "intervalFactor": 1,
          "legendFormat": "{{name}} - punts",
          "refId": "F"
        },
        {
          "expr": "vpp_interfaces_rx_miss{agent=\"$agent\"}",
          "format": "time_series",
          "interval": "",
          "intervalFactor": 1,
          "legendFormat": "{{name}} - RX miss",
          "refId": "G"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Interface stats",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "decimals": null,
          "format": "short",
          "label": "packets",
          "logBase": 1,
          "max": null,
          "min": "0",
          "show": true
        },
        {
          "format": "decbytes",
          "label": "bytes",
          "logBase": 1,
          "max": null,
          "min": "0",
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "columns": [
        {
          "text": "Avg",
          "value": "avg"
        }
      ],
      "datasource": "Prometheus",
      "description": "",
      "fontSize": "100%",
      "gridPos": {
        "h": 9,
        "w": 9,
        "x": 15,
        "y": 0
      },
      "id": 5,
      "links": [],
      "pageSize": null,
      "scroll": true,
      "showHeader": true,
      "sort": {
        "col": null,
        "desc": false
      },
      "styles": [
        {
          "alias": "Time",
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "pattern": "Time",
          "type": "date"
        },
        {
          "alias": "",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "decimals": 0,
          "pattern": "/.*/",
          "thresholds": [],
          "type": "number",
          "unit": "short"
        }
      ],
      "targets": [
        {
          "expr": "vpp_nodes_counter{agent=\"$agent\"}",
          "format": "time_series",
          "intervalFactor": 1,
          "legendFormat": "{{item}}: {{reason}}",
          "refId": "A"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Node Counters",
      "transform": "timeseries_aggregations",
      "type": "table"
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "fill": 2,
      "gridPos": {
        "h": 7,
        "w": 11,
        "x": 0,
        "y": 9
      },
      "id": 10,
      "legend": {
        "alignAsTable": false,
        "avg": false,
        "current": true,
        "hideEmpty": false,
        "max": false,
        "min": false,
        "rightSide": false,
        "show": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "paceLength": 10,
      "percentage": false,
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": true,
      "targets": [
        {
          "expr": "vpp_memory_used{agent=\"$agent\"}",
          "format": "time_series",
          "instant": false,
          "intervalFactor": 1,
          "legendFormat": "used [{{threadID}}]",
          "refId": "B"
        },
        {
          "expr": "vpp_memory_reclaimed{agent=\"$agent\"}",
          "format": "time_series",
          "intervalFactor": 1,
          "legendFormat": "reclaimed [{{threadID}}]",
          "refId": "A"
        },
        {
          "expr": "vpp_memory_free{agent=\"$agent\"}",
          "format": "time_series",
          "intervalFactor": 1,
          "legendFormat": "free [{{threadID}}]",
          "refId": "C"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Memory",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "decbytes",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "columns": [],
      "fontSize": "100%",
      "gridPos": {
        "h": 12,
        "w": 13,
        "x": 11,
        "y": 9
      },
      "id": 9,
      "links": [],
      "pageSize": null,
      "scroll": true,
      "showHeader": true,
      "sort": {
        "col": 9,
        "desc": true
      },
      "styles": [
        {
          "alias": "Time",
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "mappingType": 1,
          "pattern": "Time",
          "type": "hidden"
        },
        {
          "alias": "calls",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "mappingType": 1,
          "pattern": "Value #A",
          "thresholds": [],
          "type": "number",
          "unit": "short"
        },
        {
          "alias": "vectors",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "mappingType": 1,
          "pattern": "Value #B",
          "thresholds": [],
          "type": "number",
          "unit": "short"
        },
        {
          "alias": "suspends",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "mappingType": 1,
          "pattern": "Value #C",
          "thresholds": [],
          "type": "number",
          "unit": "short"
        },
        {
          "alias": "clocks",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "mappingType": 1,
          "pattern": "Value #D",
          "thresholds": [],
          "type": "number",
          "unit": "short"
        },
        {
          "alias": "vectors/call",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": null,
          "mappingType": 1,
          "pattern": "Value #E",
          "thresholds": [],
          "type": "number",
          "unit": "short"
        },
        {
          "alias": "",
          "colorMode": null,
          "colors": [
            "rgba(245, 54, 54, 0.9)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(50, 172, 45, 0.97)"
          ],
          "dateFormat": "YYYY-MM-DD HH:mm:ss",
          "decimals": 2,
          "link": false,
          "mappingType": 1,
          "pattern": "(job|instance|agent)",
          "thresholds": [],
          "type": "hidden",
          "unit": "short"
        }
      ],
      "targets": [
        {
          "expr": "vpp_runtime_calls{job=\"vpp\", agent=\"$agent\"}+0\n\n",
          "format": "table",
          "instant": true,
          "interval": "",
          "intervalFactor": 2,
          "legendFormat": "{{item}} calls",
          "refId": "A"
        },
        {
          "expr": "vpp_runtime_vectors{agent=\"$agent\"}+0",
          "format": "table",
          "hide": false,
          "instant": true,
          "intervalFactor": 2,
          "legendFormat": "{{item}} vectors",
          "refId": "B"
        },
        {
          "expr": "vpp_runtime_suspends{agent=\"$agent\"}+0",
          "format": "table",
          "hide": false,
          "instant": true,
          "intervalFactor": 2,
          "legendFormat": "{{item}} suspends",
          "refId": "C"
        },
        {
          "expr": "vpp_runtime_clocks{agent=\"$agent\"}+0",
          "format": "table",
          "hide": false,
          "instant": true,
          "intervalFactor": 2,
          "legendFormat": "{{item}} clocks",
          "refId": "D"
        },
        {
          "expr": "vpp_runtime_vectors_per_call{agent=\"$agent\"}+0",
          "format": "table",
          "hide": false,
          "instant": true,
          "intervalFactor": 2,
          "legendFormat": "{{item}} vectors/call",
          "refId": "E"
        }
      ],
      "timeFrom": null,
      "timeShift": null,
      "title": "Runtime",
      "transform": "table",
      "type": "table"
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "fill": 1,
      "gridPos": {
        "h": 5,
        "w": 11,
        "x": 0,
        "y": 16
      },
      "id": 2,
      "legend": {
        "alignAsTable": true,
        "avg": false,
        "current": true,
        "hideEmpty": false,
        "hideZero": false,
        "max": false,
        "min": false,
        "rightSide": true,
        "show": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "paceLength": 10,
      "percentage": false,
      "pointradius": 2,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [
        {
          "alias": "default-numa-0 (0) - num allocs",
          "yaxis": 2
        },
        {
          "alias": "default-numa-0 (0) - num free",
          "yaxis": 2
        }
      ],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "vpp_buffers_size{agent=\"$agent\"}",
          "format": "time_series",
          "instant": false,
          "intervalFactor": 1,
          "legendFormat": "{{item}} ({{threadID}}) - size",
          "refId": "B"
        },
        {
          "expr": "vpp_buffers_alloc{agent=\"$agent\"}",
          "format": "time_series",
          "instant": false,
          "intervalFactor": 1,
          "legendFormat": "{{item}} ({{threadID}}) - alloc",
          "refId": "E"
        },
        {
          "expr": "vpp_buffers_free{agent=\"$agent\"}",
          "format": "time_series",
          "instant": false,
          "intervalFactor": 1,
          "legendFormat": "{{item}} ({{threadID}}) - free",
          "refId": "C"
        },
        {
          "expr": "vpp_buffers_num_alloc{agent=\"$agent\"}",
          "format": "time_series",
          "instant": false,
          "intervalFactor": 1,
          "legendFormat": "{{item}} ({{threadID}}) - num allocs",
          "refId": "A"
        },
        {
          "expr": "vpp_buffers_num_free{agent=\"$agent\"}",
          "format": "time_series",
          "instant": false,
          "intervalFactor": 1,
          "legendFormat": "{{item}} ({{threadID}}) - num free",
          "refId": "D"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Buffers",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "decbytes",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": "",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    }
  ],
  "refresh": "30s",
  "schemaVersion": 18,
  "style": "dark",
  "tags": [
    "vpp"
  ],
  "templating": {
    "list": [
      {
        "allValue": null,
        "current": {
          "text": "agent1",
          "value": "agent1"
        },
        "datasource": "Prometheus",
        "definition": "label_values(agent)",
        "hide": 0,
        "includeAll": false,
        "label": null,
        "multi": false,
        "name": "agent",
        "options": [],
        "query": "label_values(agent)",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "datasource": null,
        "filters": [],
        "hide": 0,
        "label": "",
        "name": "Filters",
        "skipUrlSync": false,
        "type": "adhoc"
      }
    ]
  },
  "time": {
    "from": "now-30m",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ],
    "time_options": [
      "5m",
      "15m",
      "1h",
      "6h",
      "12h",
      "24h",
      "2d",
      "7d",
      "30d"
    ]
  },
  "timezone": "",
  "title": "VPP telemetry",
  "uid": "61gpso3iz",
  "version": 4
}
Clone this wiki locally