Exporting metrics to Prometheus

Metrics in MITIGATOR are stored in Graphite. It is possible to export metrics to Prometheus via graphite_exporter.

To organize sending, you need to deploy and configure graphite_exporter
(the main configuration file and the configuration file for metrics matching), then configure sending metrics to graphite_exporter.

Brief sequence of actions:

  1. Writing a metric compliance configuration for specific needs.
  2. Deploying graphite_exporter with this configuration.
  3. Setting up data sending in the MITIGATOR system.

graphite_exporter metrics matching configuration

A list of metrics with a short description is available by link.

Info

It is not guaranteed that metric names will not change between versions.

Configuration example:

mappings:
  - match: ^mitigator\.(\d+)\.elements\.router\.extInputCounter\.(.*)$
    match_type: regex
    name: extInputCounter
    labels:
      instance: $1
      unit: $2

  - match: ^mitigator\.(\d+)\.elements\.\.policy_(\d+)\.policy\.inputCounter\.(.*)$
    name: inputCounter
    match_type: regex
    labels:
      instance: $1
      policy: $2
      unit: $3

  - match: ^mitigator\.(\d+)\.ports\.((?:int|ext)\d+)\.opackets$
    name: opackets
    match_type: regex
    labels:
      instance: $1
      port: $2

MITIGATOR Setup

In docker-compose.override.yml add:

version: "2.2"
services:
  fwstats:
    environment:
      FWSTATS_GRAPHITE_ADDRESS: "carbon-clickhouse.mitigator:2003,some_server:9109"

Where some_server:9109 is the address and port of the graphite_exporter; the first value must be saved. You can specify multiple servers if you wish.

Apply parameters:

docker-compose up -d fwstats