Out of the box, rspamd cannot export in prometheus format.

To achieve this goal, we will use graphite-exporter.

Side graphite-exporter:

- match: rspamd.actions.*
  name: rspamd_actions
    action: $1

The rspamd side of the metric_exporter.conf file:

backend = "graphite";
host = "graphite-exporter";
port = 9109;
timeout = 10;
interval = 60;

metrics = [
    "actions.add header",
    "actions.no action",
    "actions.rewrite subject",
    "actions.soft reject",

Prometheus side:

- job_name: 'graphite-exporter'
  scrape_interval: 30s
  - targets: ["graphite-exporter:9108"]

Then you can display the collected data in visualization tools.