Hey all,
I work as a DevRel over at InfluxData. Hearing your pain over the 1.X to 2.X move of InfluxDB OSS. If you have any questions or ideas to pass on happy to take them back to the team.
I would assume that since the filtering is done before pushing, and we only change where the data is pushed.
1 Like
jchh
(my username is my initials (and my first name isn't John))
35
I don’t have this line.
1 Like
jchh
(my username is my initials (and my first name isn't John))
36
I got it working!
Here is my docker and HA configuration.yaml for anyone else…
docker-compose.yaml - note: vmagent no longer needed…
# uses InfluxDb integration in HA to push changes to VM's listening port: 8428
victoriametrics: # http://dietpi:8428
container_name: victoriametrics
image: victoriametrics/victoria-metrics:latest
volumes:
- ./vm/vmdata:/storage
- /etc/localtime:/etc/localtime:ro # only for RPi (Docker Mac is a VM)
command:
- "--selfScrapeInterval=60s" # to enable self-monitoring ➜ Grafana
- "--retentionPeriod=3y" # default is "1m"
- "--storageDataPath=/storage"
- "--httpListenAddr=:8428" # Influx HA config must also use 8428
network_mode: host
restart: unless-stopped
configuration.yaml (HA) note: prometheus no longer needed
FYI, recent versions of VictoriaMetrics allow controlling the frequency of disk write operations with the -inmemoryDataFlushInterval command-line flag. This may help saving the lifetime for commodity SD cards with limited number of write cycles. See CHANGELOG · VictoriaMetrics for more details.
Thankyoufuslwusl for this add-on and thank-you @fuslwusl , @jchh and others for all the development to this topic and advice.
I upgraded to a raspberry PI4 (4GB) and now have Victoria Metrics and Grafna running, using the HA Influx integration. (Graphs on steriods and long term statistics here I come )
For anyone with some experience of HA, its a minimal effort. I have offered @fuslwusl some tweaks to the installation instructions based on my experience.
For the record: HA says the Victoria metrics add-on is using 1.1% “add-on RAM usage” that would be 4.5% of 1GB I guess.
And Grafna: 1.5% ie 6% of 1GB
The added CPU is apparently 0.3% (of a PI4)
(The whole rPI4 (4GB) is running at 31% RAM utilisation and zero swap file use, )
Hey, I’m trying to set up VictoriaMetrics now and I’m struggling to understand the token, organization and bucket settings. I cannot find any of these in any place in VM? I seem to remember these from way back when I meddled with Influxdb, but are these needed when working with VM?
VictoriaMetrics doesn’t need any of that, the setup is trivial in the VM side, there is no configuration at all, you just pass the retention period in the docker command line, that’s it, in the HA side you use the config for influx v1 without org, bucket, token ok r password, see the link below.
Thanks to this thread I discovered VM while researching options for long term storage, and I got VM/grafana running in 10 minutes, it’s fantastic. All in a raspberry pi with a just-installed crucial x6 ssd. Also running frigate with a coral accelerator, all dockerized.
jchh
(my username is my initials (and my first name isn't John))
41
Ha! …I’m using the config for influx v2 - still works!
Do I understand the configuration correct and I can use InfluxDB (I use InluxDB2) and VictoriaMetrics parallel.
So I could test if VM suits my needs and have written all data also to my old InfluxDB instance in case I would stay with InfluxDB after my tests?
1 Like
jchh
(my username is my initials (and my first name isn't John))
45
Sorry. I have tried to get both (InfluxDB2 and VM) running at the same time. For me with HA OS 2023.02 it was not possible. Home Assistant could only have a connection to one InfluxDB instance. If I try to configure a second instance I get HTTP connection errors from InfluxDB integration.
jchh
(my username is my initials (and my first name isn't John))
47
I’m using HA container (docker) so maybe that’s the difference, but only have 1 InfluxDb instance - not sure why you are trying to configure a 2nd.
Hi there, I ran across this thread while looking for the best way to store long term data from my HA installation and I’m considering victoriametrics after some reading.
For the time being, I increased the retention period for HA’s recorder, but I want to migrate asap as my DB keeps on growing. Preferably, without losing historical data.
Does anyone have a recommendation for getting the HA data into victoriametrics? Is there a direct export possibility from HA to victoriametrics or do I need to migrate to InfluxDB first and then use this script: GitHub - Maaxion/homeassistant2influxdb: Migration of Home Assistant's log database to InfluxDB ?