VictoriaMetrics Add-on for long-term storage and data source for Grafana
If you are looking for an efficient and easy to use way for long term storage of your Home Assistant data - just use VictoriaMetrics. I am still impressed how efficient this database stores all my sensor values an the database size stays so tiny compared to InfluxDB an others.
Grafana and VictoriaMetrics
Grafana and VictoriaMetrics are a dream team. I was using InfluxDB for some years and now switched to VictoriaMetrics. I tried Influx2 but it was not my friend and was no fun in combination with Grafana. I don’t want to write database queries when creating a simple visualization in Grafana. So the search for alternatives began and VictoriaMetrics is the way to go.
Replacement for InfluxDB and Prometheus
VictoriaMetrics Time Series Database is 100% compatible with the Prometheus and InfluxDB line protocol. So Homeassistant is able to connect to VictoriaMetrics with the InfluxDB. In Grafana you can use the Prometheus or InfluxDB data source.
Much better long term storage
VictoriaMetrics offers an ultra efficient compression for data storage, is highly optimized for time series data and has low RAM usage. So this is the perfect solution for long term storage of high amounts of data like all sensor values of your smart home.
VictoriaMetrics as Home Assistant Add-on
Because i am using Home Assistant OS (Hass.io) on a RaspberryPi 4 and wanted to run Victoria Metrics on the same system i created VictoriaMetrics as Add-on for Home Assistant.
I hope you enjoy this Add-on and it will make long-term data storage and visualization of your Home Assistant data a lot easier. The Add-on including documentation is available at GitHub.
How should I configure VictoriaMetrics on an already working HA with InfluxDB pre-existent?
I want to keep InfluxDB as is, at least for some time, and just append this new database of VictoriaMetrics to the system. Give it a try.
I think the configuration.yaml file should not contain two influxdb: main entries with child parameters different for the real InfluxDB and the VictoriaMetrics.
Not surprisingly HA log indicates duplicate entry in the config file.
@oetken Thanx for your fix of the retention setting and your optimizations - your stuff is merged and available as addon version 1.8.13!!!
You are very welcome as contributor if you have more great features to include.
I thing is is not possible to add two influxdb targets in homeassistant.
I used influxdb database before and archived everything. When i need the old data i start a docker-compose setup with influx and grafana to view the old data.
Since then i am using victoria-metrics and grafana without any problems and never regretted this decission. victoria-metrics is a rock solid and stable time series database for long term storage of all your homeassistant data.
Can someone shortly describe what is the use of the file prometheus.yml?
Dockerfile has a couple of lines hinting to it’s use
# Run service with prometheus scraper
# CMD [ "/victoria-metrics-prod", "-storageDataPath", "/data", "-promscrape.config", "/prometheus.yml"]
So it’s a configuration file for a scraper?
If the HA influxdb integration is pushing the data to VictoriaMetrics, what would you need this scraper for?
I landed here after realising that the Influxdb add-on is no longer maintained. Of course a Prometheus add-on is actively being developed and could also fill this void: GitHub - hassio-addons/addon-prometheus: Prometheus - Home Assistant Community Add-ons
What I don’t get is why in our configuration.yaml we must use the Influxdb integration instead of the Prometheus integration, which is available for Home Assistant Prometheus - Home Assistant
VictoriaMetrics is supposed to be a replacement for Prometheus after all.
What? This is a first one for me… Is the badge autogenerated or what? It has to be fixed asap.
Anyway VictoriaMetrics seems a very good project and claims that it’s very faster than influxdb+less ram. I haven’t tested these claims, but I installed it and indeed it feeds Grafana just fine…
Do you happen to know how we could change various options for this addon (scrape interval etc.) and perhaps add a couple more external scrapers (like node-exporter)? I can see the prometheus.yml file in /addons/git/8f49de54/victoria-metrics folder but it’s besides a Dockerfile and used for it, I don’t think it’s a file for options. I guess some parameters may be passed through command-line flags (VictoriaMetrics · The High Performance Open Source Time Series Database & Monitoring Solution) but it’s a little bit complicated and for external scrapers, they must be referred to in the prometheus.yml file.
I think prometheus.yml should be exposed to the host via a volume, so we could edit it, but it’s not.