Setting up filters - CHERTS/pgscv GitHub Wiki

Setting up filters

TLDR: Setting up the filters to disable collecting specific kind of metrics.

Sometimes you need to limit collecting metrics by specific labels. Simple example is limiting collecting of block devices metrics by device names - the monitored system might have a lot of virtual block devices and almost all metrics about them might be not needed at all. In such cases, collecting could be adjusted using filters. Filter is a label and regexp-based pattern used to filtering label values.

  1. To enable filters, add the necessary collector/label pair into filters section. Use include or exclude for specifying the pattern. The exclude is working as include all, but exclude specified. The include is opposite and is working as exclude all, but include specified. Both options should not be used together (include wins).
collectors:
  postgres/statements:
    filters:
      database:
        exclude: "^.*_(test|staging)$"

In this example, all metrics collected by postgres/statements collector with databases names matched by specified regexp, will not be exposed.

  1. After editing configuration, restart the service.
systemctl restart pgscv