Victoria metrics persistence service

Hello everyone,

I’m happy to announce that I’m working on a VictoriaMetrics persistence binding for openHAB!

VictoriaMetrics is an efficient and highly performant time-series database, often regarded as a superior alternative to InfluxDB due to its performance and simplicity. While VictoriaMetrics supports the same InfluxDB V1 write API (/write endpoint), it currently lacks direct compatibility with openHAB for querying data, meaning graphs and historical data won’t be readily available in openHAB without a dedicated binding.

Given the limited support and future uncertainty around InfluxDB 3.x, VictoriaMetrics presents an excellent alternative solution. A native persistence binding will leverage VictoriaMetrics’ powerful query capabilities, enabling full integration with openHAB, including proper historical data visualization and analysis.

This discussion in the community forum highlights why VictoriaMetrics might be preferable:
https://community.openhab.org/t/what-database-to-use-instead-of-influxdb/149874/21

Additionally, there’s an ongoing proposal to use micrometer persistence services, underscoring the importance of efficient metrics handling:
https://community.openhab.org/t/proposal-micrometer-persistence-service/147306

Pull request is available here: [victoriametrics] Initial contribution of VictoriaMetrics Persistence Binding by johnuopini · Pull Request #18759 · openhab/openhab-addons · GitHub

I am happy to see this development.

I am currently using InfluxDB 1 and would consider replacing it with this new service. Which brings me to the following:

  • it is easy enough to change my persistence service and copy over the configuration from InfluxDB persistence to VictoriaMetrics.
  • Is there a mechanism to migrate existing InfluxDB 1 (or 2) data to VictoriaMetrics?
  • I am using Grafana on top of InfluxDB 1. How easy is it to rebuild my dashboards for an underlying VictoriaMetrics database? Or would it mean starting from scratch.
1 Like

Thanks for checking this out!

The only difference between the 2 is that influxdb uses the “influxdb” optional metadata tag while this service uses “victoriametrics” so if you are using custom names or tags for persistence you will need to change that, nothing else. If you use text based items this sould be quick, otherwise you might need to spend some time on the UI or edit jsondb directly.

Yes it should be quite straightforward, you can use vmctl and do something like:

vmctl influx -influx-url http://localhost:8086 -influx-database openhab \
  -vm-url http://localhost:8428 \
  -retention-period=30d

This will import 30d data to influx, you can check docs for more options. Nice thing is that you can easily try this out safely without affecting anything.

Unfortunately Victoria Metrics supports the Prometheus and VictoriaMetrics data source plugins in Grafana. If your dashboards use InfluxQL you’ll have to rewrite queries using PromQL or MetricsQL, this is the hardest part.