The guys from victoriametrics sorted out the bug when importing empty measurements, now you get an errors but vmctl continues and everything works now.
They also helped me to find my imported data, maybe it helps someone other when switching.
Integrating victoriametrics like it is described here in the forum has a different naming of the measurements. For example, if you have a sensor like sensor.glances_cpu_used, it looks like this when ha saves the measurements in victoriametrics:
{"metric":{"__name__":"sensor.glances_cpu_used_value","db":"home_assistant","domain":"sensor","entity_id":"glances_cpu_used","friendly_name":"glances CPU used","unit_of_measurement":"%"}
So in fact you have a measurement for every entity_id. When using grafana or vmui you just have to enter your entity id and it will be found.
The imported data has always the name of the measurement, in the database it looks like this:
Can someone kind-hearted please share their influxdb config in configuration.yaml for VictoriaMetrics. Also, can you give me some info on the API syntax to get the last 100 readings from it before I get around trying to install Grafana etc?
Iâm getting an error trying to integrate VictoriaMetrics with HA (docker),
2023-03-16 14:11:33.870 ERROR (SyncWorker_3) [homeassistant.components.influxdb] Cannot connect to InfluxDB due to 'HTTPSConnectionPool(host='localhost', port=8428): Max retries exceeded with url: /write?db=homeassistant (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:997)')))'. Please check that the provided connection details (host, port, etc.) are correct and that your InfluxDB server is running and accessible. Retrying in 60 seconds.
VictoriaMetrics is confirmed to be running at its metrics page.
I have been using the standard functionality for data visualization after switching from OpenHAB. By chance, I came across Victoriametrics. I have installed the VictoriaMetrics Addon and the configuration as stated in the documentation in the configuration.yaml. Now I do not get further:
Do I need the additional influxdb? Or is it already installed by default?
Will the data be stored in influxdb and the VictoriaMetrics DB?
Which host do I use in the configuration.yaml? Simply the IP address of my Raspbis? So with me 192.168.179.37
Is there anything else missing?
And a foolish question: How can I tell it is running? I appreciate any help you can provide.
VictoriaMetrics has an API thatâs compatible with InfluxDB. That means that anything thatâs designed to use InfluxDB (for example, the Home Assistant InfluxDB integration) will work with VictoriaMetrics. It has a Prometheus-compatible API too.
Youâd only need to run VictoriaMetrics, not InfluxDB.
Prometheus has (IMO) a better data model so it might be worth using the Prometheus Home Assistant integration instead of the InfluxDB one with VictoriaMetrics.
Thanks, So why is then a reference to the Influxdb in the configuration.yaml? I still struggle to understand if my setup is correct (host) and if the data is now directed to Victoriametrics. I also tried to find a tutorial on YouTube but only found one in French, which is unfortunately a little rusty after 35 years.
Victoria Metrics has built-in support for clients that support InfluxDB - it can take InfluxDB-style data and convert it to VictoriaMetrics-style data. This means that apps do not need to support VictoriaMetrics specifically - they can just add support for InfluxDB or Prometheus and theyâll also work with VictoriaMetrics.
Home Assistant has native support for logging metrics to InfluxDB.
The InfluxDB section in configuration.yml is enabling Home Assistantâs InfluxDB support. Home Assistant thinks itâs speaking to an InfluxDB server, when itâs really speaking to a Victoria Metrics server.
I was just trying out VictoriaMetrics (not via this addon, just via a regular Docker container) and Home Assistantâs metrics have much better structure if you use the Prometheus integration rather than the InfluxDB one.
You just need to add:
prometheus:
to your Home Assistant config, configure a prometheus.yml file as documented on VictoriaMetricsâ site, then pass it to VictoriaMetrics. This is what my docker-compose.yml looks like:
Thanks, Daniel. I followed the installation instructions, and it is running. At least I can see via Samba that data is constantly being written to the âsmallâ folder, and I do have access via Grafana and a Prometheus connection:
With my below configuration.yaml is the data kept redundant? is influxDB installed with the setting, or do I have to install the add-on additionally?
With Prometheus as the source, I connected Grafana via http://ipaddress_of_raspi:8428, the user âhome assistantâ, and my password. What is the setting for configuring the InfluxDB source in Grafana? Can anybody provide a more detailed description of the configuration, as step 6 in the addon documentation could be more meaningful?
With the active Prometheus connection, how can I use Grafana dashboard templates that usually refer to InfluxDB? Is there a simple way to use them, or must I change the source in the JSON file?
Can I use templates for this setup not to reinvent the wheel? Where can I find them, and with what connection?
No worries, Iâll wait for the new Synology docker container manager to launch from beta and then build it from the .yml file info you set out above. Iâve still got some time before I have nay data in home assistant that I want to track long term (this is for when I eventually get solar to track usage patterns locally)
nevermind, it started to work today, after a reboot of the vm - might be that i had âupgradedâ it to 6GB of RAM (from 4), because i had restarted earlier yet without successâŚ
log doesnât seem to be much of help either: </s> <s>s6-rc: info: service s6rc-oneshot-runner: starting</s> <s>s6-rc: info: service s6rc-oneshot-runner successfully started</s> <s>s6-rc: info: service fix-attrs: starting</s> <s>s6-rc: info: service fix-attrs successfully started</s> <s>s6-rc: info: service legacy-cont-init: starting</s> <s>s6-rc: info: service legacy-cont-init successfully started</s> <s>s6-rc: info: service legacy-services: starting</s> <s>s6-rc: info: service legacy-services successfully started</s> <s>[00:24:46] INFO: Starting Victoria Metrics with retention set to 99y</s> <s>[00:24:46] INFO: Starting Victoria Metrics with args set to </s> <s>2023-07-03T22:24:46.070Z info VictoriaMetrics/lib/logger/flag.go:12 build version: victoria-metrics-20230602-095850-tags-v1.91.2-0-gde9481208</s> <s>2023-07-03T22:24:46.070Z info VictoriaMetrics/lib/logger/flag.go:13 command-line flags</s> <s>2023-07-03T22:24:46.071Z info VictoriaMetrics/lib/logger/flag.go:20 -retentionPeriod="99y"</s> <s>2023-07-03T22:24:46.071Z info VictoriaMetrics/lib/logger/flag.go:20 -storageDataPath="/share/victoria-metrics-data"</s> <s>2023-07-03T22:24:46.071Z info VictoriaMetrics/app/victoria-metrics/main.go:70 starting VictoriaMetrics at ":8428"...</s> <s>2023-07-03T22:24:46.071Z info VictoriaMetrics/app/vmstorage/main.go:108 opening storage at "/share/victoria-metrics-data" with -retentionPeriod=99y</s> <s>2023-07-03T22:24:46.074Z info VictoriaMetrics/lib/memory/memory.go:42 limiting caches to 2466191769 bytes, leaving 1644127847 bytes to the OS according to -memory.allowedPercent=60</s> <s>2023-07-03T22:24:46.093Z info VictoriaMetrics/app/vmstorage/main.go:122 successfully opened storage "/share/victoria-metrics-data" in 0.022 seconds; partsCount: 0; blocksCount: 0; rowsCount: 0; sizeBytes: 0</s> <s>2023-07-03T22:24:46.096Z info VictoriaMetrics/app/vmselect/promql/rollup_result_cache.go:114 loading rollupResult cache from "/share/victoria-metrics-data/cache/rollupResult"...</s> <s>2023-07-03T22:24:46.097Z info VictoriaMetrics/app/vmselect/promql/rollup_result_cache.go:142 loaded rollupResult cache from "/share/victoria-metrics-data/cache/rollupResult" in 0.001 seconds; entriesCount: 0, sizeBytes: 0</s> <s>2023-07-03T22:24:46.097Z info VictoriaMetrics/app/victoria-metrics/main.go:80 started VictoriaMetrics in 0.026 seconds</s> <s>2023-07-03T22:24:46.097Z info VictoriaMetrics/lib/httpserver/httpserver.go:96 starting http server at http://127.0.0.1:8428/</s> <s>2023-07-03T22:24:46.097Z info VictoriaMetrics/lib/httpserver/httpserver.go:97 pprof handlers are exposed at http://127.0.0.1:8428/debug/pprof/</s> <s>
after that itâs still in stopped state
anyone know if and how this can be run in this environment?
What I meant in my comment is that Home Assistant has two integrations: an InfluxDB integration, and a Prometheus integration. I had a better result using the Prometheus integration with VictoriaMetrics, compared to using the InfluxDB integration. Prometheus has a nicer data model than InfluxDB.
Iâm a bit puzzled by the instructions. Iâve installed Victoria Metrics and the instructions then say:
Add influxdb integration to your homeassistant config (using the option measurement_attr: entity_id is recommended)
Firstly, thereâs no such integration, if you try you get the message:
This device cannot be added from the UI
You can add this device by adding it to your âconfiguration.yamlâ. See the documentation for more information.
However, there is an influxdb add on? Which should I use and how? Also, why do I need influxdb, isnât Victoria Metrics its own database?
The addons are always the databases, you only need one of them (in this case the victoriametrics). But you need an integration that pushes the data to the addon, and for both itâs the influxdb integration.
The message you see in the ui means, this one cannot be setup from the ui, you have to manually add it to your configuration.yaml.
Here is an example, you find it also in the docs of the victoriametrics addon:
I highly recommend not to include all your sensor but pick the ones (or domains) you want to have for a long term storage, so the database grows not so fast and you donât store any garbage that you never need anymore in the future.