Supporterino / truenas-graphite-to-prometheus

A graphite exporter mapping file for truenas scale >23.10.1 metrics and some example grafana dashboards
GNU General Public License v3.0
78 stars 12 forks source link

Request: add prefix to metrics name #22

Closed yuta1024 closed 8 months ago

yuta1024 commented 8 months ago

Could you please add prefix to metrics name? e.g.) physical_memory -> truenas_physical_memory

I think it will be easily to distinguish it from the metrics of other exporters. However, I am concerned that backwards compatibility will be broken...

Supporterino commented 8 months ago

I understand the request but I honestly don't like this approach since it would indeed break the backwards compatibility and I find it rather annoying to have such a prefix. You can work with the job label which is set by prometheus to narrow down your metrics if needed or if desperately want the prefix you can add it in your scrape_config like this:

scrape_configs:
- job_name: 'truenas_exporter'
  static_configs:
  - targets: ['localhost:9108']
  metric_relabel_configs:
  - source_labels: [__name__]
    target_label: __name__
    replacement: truenas_$1
yuta1024 commented 8 months ago

Thank you for your idea. It fits just for me! I've accomplished what I would like to do. So I'll close this issue. Thank you!