I just recently noticed a problem with my long term storage and after some digging around I realized my InfluxDB container must have, at some point, updated to 2.x while my HA config was still setup for 1.x. With some effort, I’m now up and running with InfuxDB 2 but struggling with the syntax within Grafana. InfluxDB has its own query builder in its UI, as well as data display and panels, so I guess I could just use this and do away with Grafana… or build the query there and paste it into Grafana (but at this point seems more of a hassle).
In all of this I stumbled upon VictoriaMetrics and with a little effort I now have that configured with HA as well. Grafana can build queries for VictoriaMetrics so it’s easier to use than InfluxDB 2 (if I want to stay with Grafana).
So I’ve got both running now, and doing some quick compares, both seem to be capturing the data as expected. I’m curious about other’s experience with either InfluxDB 2 or VictoriaMetrics. Those who updated to InfluxDB 2 are you using Grafana or InfluxDB UI? Anyone prefer VictoriaMetrics over InfluxDB for HA? Other thoughts or opinions from long time users of either?
jchh
(my username is my initials (and my first name isn't John))
2
I have not used InfluxDb/Grafana much since it changed to v2 for the same reason. I think to myself 'you’re saving the data so you can worry about interogating it tomorrow)".
Can you share your docker-compose for Victoria and any HA config that was necessary for it (or point to to where I can find it out) - I’ll give it a go.
…used latest just for the trial. Trying to goggle what the HA config is but canl;t see much info on that. I am running Container so cannot use the add-on.
…it could be, but not too sure. I’m running everything on a raspberrypi… on a win10 machine $HOME works in PowerShell but not in CMD.
Glad it was of some use, and I’m interested in what you find. I’m not too experienced in the inner workings of databases but I’m going to run both for a few weeks and try to compare. It seems like InfluxDB is not concerned with compatibility so I’m leaning towards VictoriaMetrics (works with Grafana and compatible with Prometheus ecosystem), but slightly hesitant because it doesn’t seem to be as widely adopted (at least not by HA community).
1 Like
jchh
(my username is my initials (and my first name isn't John))
8
I have been doing a little playing and reading the docs etc. It seems easier to query which is good.
For docker-compose, you might want to check out retentionPeriod which has a default of 1 month (not long). The only 2 commands I have found I need (so far) for it to work with HA is:
command:
- "--retentionPeriod=3y" # default is "1 m"
- "--storageDataPath=/storage"
Also playing with - --selfScrapeInterval=60s to enable self-monitoring in a Grafana dashboard, but I am getting an error in Grafana (Failed to upgrade legacy queries Datasource was not found). The dashboard to import is here. I need to read up a little more on this.
Also worth noting the command - --downsampling.period=30d:5m,180d:1h incase you need to claim space back later. The explanation is here.
@jchh thanks for this info! I think you also need the --httpListenAddr=:8428 command (at least I do) and could be why you’re not seeing the self scrape results??? I’ve reduced my victoriametrics entry in docker-compose.yml to:
jchh
(my username is my initials (and my first name isn't John))
10
thanks for that! …with that extra line we are pretty much identical. The error was in Grafana not VictoriaMetrics but I;ll give it a go and let you know what happens.
I would also change restart: always to restart: unless-stopped as a general rule incase you want it stopped manually fore some reason.
I was using InfluxDB for some years and now i switched to VictoriaMetrics. I tried Influx2 but it was not my friend and is no fun in combination with Grafana. So the search for alternatives began and VictoriaMetrics is the way to go. 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.
Maybe you are interested in Victoria Metrics Add-on for Homeassistant
4 Likes
jchh
(my username is my initials (and my first name isn't John))
15
Very kind of you to share! I currently use HA docker so cannot use add-ons. However I will bookmark that link in case things change for mew
There is an official docker Image of victoriametrics for all platforms, too. I can send you a docker-compose.yml and some examle config of you like. I used this for testing in a ARM MacBook m1 before i created the addon.
jchh
(my username is my initials (and my first name isn't John))
17
I have been using the official docker image since the start of this thread
What I read is InfluxDB 1.x was what people were using. InfluxDB 2.x is different and not so HA friendly.
Q1: Is it likely that InfluxDB 1 will become unsupported, stop working at some version change and leave the HA Grafana community with a broken solution
If Q1 would the HA community not be migrating or planning to migrate to something else?
Clearly the positive voices and contributors to community solutions in this thread have already moved away from InfluxDB
Q2: Do we think the HA community will move enmass to victoria metrics or is there some other time based DB the community will flock to (and support)?
Q3: How resource intensive is Victoria Metrics? Do I read correctly it has the least resource requirements of the time based DBs I might use?
[The question is can I run it (happily) on my Pi - B 1GB?
I know I could do with a better PI its on the list for when they become generally available again]