qbittorrent-exporter icon indicating copy to clipboard operation
qbittorrent-exporter copied to clipboard

Cardinality problem of `qbittorrent_torrent_info`

Open markalex2209 opened this issue 10 months ago • 1 comments

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 avatar Apr 11 '24 12:04 markalex2209

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

markalex2209 avatar Apr 11 '24 12:04 markalex2209