Switched from influx to victoria metrics (more light weight for pi)

This commit is contained in:
2026-06-27 00:14:10 -04:00
parent ce332be419
commit 74c5e48d8a
3 changed files with 5 additions and 8 deletions

View File

@@ -1,7 +1,7 @@
import {cfg} from './config.mjs';
async function query(c, q, start, end) {
const url = new URL('/api/v1/query_range', c.VM_URL);
const url = new URL('/api/v1/query_range', c.DB_HOST);
url.searchParams.set('query', q);
url.searchParams.set('step', '60s');
if (start) url.searchParams.set('start', start);
@@ -12,7 +12,7 @@ async function query(c, q, start, end) {
}
async function queryInstant(c, q) {
const url = new URL('/api/v1/query', c.VM_URL);
const url = new URL('/api/v1/query', c.DB_HOST);
url.searchParams.set('query', q);
const res = await fetch(url);
const json = await res.json();