caseyscarborough / qbittorrent-exporter

A prometheus exporter for qBittorrent.
73 stars 10 forks source link

Cardinality problem of `qbittorrent_torrent_info` #25

Open markalex2209 opened 2 months ago

markalex2209 commented 2 months ago

Metric qbittorrent_torrent_info exposes dynamically changing labels. This is a problem because each labelset is an additional time series: https://prometheus.io/docs/practices/instrumentation/#do-not-overuse-labels

Labels like progress, dl_speed, up_speed, downloaded are frequently changing, and basically result in a creation of new time series for each name on every scrape.

Since all of these labels are exposed as proper values in other metrics, I'd argue this metric is not needed at all.

But if you'd like to keep it for compatibility (or any other) reasons, I suggest making this metric optional.

markalex2209 commented 2 months ago

To prevent cardinality explosion, this metric can be dropped on relabeling with configuration like this:

  - job_name: 'qbittorrent'
    static_configs:
      - targets: ['qbittorrent-exporter:17871']
    metric_relabel_configs:
    - source_labels: [__name__]
      regex: 'qbittorrent_torrent_info'
      action: drop