VictoriaMetrics-Community / homeassistant-addon-victoriametrics

VictoriaMetrics Add-on for Home Assistant OS is the perfect solution for long term data storage of your smart home sensor data and visualization with Grafana.
MIT License
95 stars 24 forks source link

How to rewrite labels #31

Closed andyfr closed 8 months ago

andyfr commented 1 year ago

Hi,

I want to change some labels and the name of metrics. I followed the VictoriaDB guide and setup a relabel config. Now I'm struggling with where to place the relabel config.

Does this work at all, when using the influx integration?

For completeness, I want to apply following config:

andyfr commented 1 year ago

It took me a while to figure out it need to add it to the scrape configuration in prometheus.tpl. (Never used victoriadb/prometheus before)

Is there a recommended way to replace the configuration? As far as I can see, this might be related to Map the Home Assistant config directory to the add-on container, although I don't care about the location of the configuration file, as long as I can change it ;)

denisgolius commented 1 year ago

It took me a while to figure out it need to add it to the scrape configuration in prometheus.tpl. (Never used victoriadb/prometheus before)

Is there a recommended way to replace the configuration? As far as I can see, this might be related to Map the Home Assistant config directory to the add-on container, although I don't care about the location of the configuration file, as long as I can change it ;)

Hey @andyfr, we have a great coockbook about relabeling. You can practice at https://play.victoriametrics.com/select/accounting/1/6a716b0f-38bc-4856-90ce-448fd713e3fe/prometheus/graph/#/?g0.range_input=30m&g0.end_input=2023-10-16T04%3A34%3A31&g0.tab=0&g0.relative_time=last_30_minutes

fuslwusl commented 8 months ago

@denisgolius Thanx for your help!