{"id":52,"date":"2024-06-25T13:34:24","date_gmt":"2024-06-25T13:34:24","guid":{"rendered":"http:\/\/blog.ltzs.us\/?p=52"},"modified":"2024-07-22T14:13:01","modified_gmt":"2024-07-22T14:13:01","slug":"use-victoria-metrics-for-data-aggregation-instead-of-influxdb","status":"publish","type":"post","link":"http:\/\/blog.ltzs.us\/?p=52","title":{"rendered":"Use Victoria Metrics for data aggregation instead of Influxdb"},"content":{"rendered":"\n<p>I&#8217;ve been using InfluxDB 1.8.X for a few years, but it has issues. On x86 64-bit, Debian 12 virtual host, I am running into a &#8220;no space left on device&#8221; error when trying to write to .wal files. Inodes are fine, disk space is fine but the only current solution for me is to restart the service. Then it works fine for 6-24 hours and the problem happens again. <\/p>\n\n\n\n<p>Screw influxdb 1.8. If 3.0 ever comes out, I&#8217;ll give that a try.<\/p>\n\n\n\n<p>So Victoria Metrics, which purports to be faster and more efficient than Influx in every way, can be used as a drop-in replacement. Querying the data can be done using PromQL, which I am not too familiar with, but Grafana makes it pretty easy.<\/p>\n\n\n\n<p>I used <a href=\"https:\/\/docs.vultr.com\/install-and-configure-victoriametrics-on-debian\">this<\/a> guide to install VM. I changed the download URL to match the latest version of VM.<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-\">curl -L https:\/\/github.com\/VictoriaMetrics\/VictoriaMetrics\/releases\/download\/v1.102.0-rc1\/victoria-metrics-linux-amd64-v1.102.0-rc1.tar.gz --output victoria-metrics-linux-amd64-v1.102.0-rc1.tar.gz<\/code><\/pre>\n\n\n\n<p>The nice part about VM is that Tasmota can integrate directly using the InfluxDB driver, just need to change the port to 8428. Also can use http post within rules like so:<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-\">rule2\non SHT3X#Temperature!=%var1% do var1 %value% endon\non SHT3X#Humidity!=%var2% do var2 %value% endon\non time#minute do WebQuery http:\/\/192.168.5.9:8428\/write POST crawl_space_temperature,Parameter=Data temperature=%var1%,humidity=%var2% endon<\/code><\/pre>\n\n\n\n<p>Only downside is that I have a few queries at the farm that use Flux (to integrate energy usage) so I&#8217;ll need to figure out how to do something similar in PromQL.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been using InfluxDB 1.8.X for a few years, but it has issues. On x86 64-bit, Debian 12 virtual host, I am running into a &#8220;no space left on device&#8221; error when trying to write to .wal files. Inodes are fine, disk space is fine but the only current solution for me is to restart&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-52","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/blog.ltzs.us\/index.php?rest_route=\/wp\/v2\/posts\/52","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.ltzs.us\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.ltzs.us\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.ltzs.us\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.ltzs.us\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=52"}],"version-history":[{"count":5,"href":"http:\/\/blog.ltzs.us\/index.php?rest_route=\/wp\/v2\/posts\/52\/revisions"}],"predecessor-version":[{"id":89,"href":"http:\/\/blog.ltzs.us\/index.php?rest_route=\/wp\/v2\/posts\/52\/revisions\/89"}],"wp:attachment":[{"href":"http:\/\/blog.ltzs.us\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=52"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.ltzs.us\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=52"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.ltzs.us\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=52"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}