This commit is contained in:
Michael Quigley 2025-06-16 13:43:38 -04:00
parent 3d69987970
commit 272b588a1e
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62

View File

@ -3,8 +3,9 @@ package controller
import ( import (
"context" "context"
"fmt" "fmt"
"github.com/sirupsen/logrus"
"net/http" "net/http"
"github.com/sirupsen/logrus"
) )
func HealthCheckHTTP(w http.ResponseWriter, _ *http.Request) { func HealthCheckHTTP(w http.ResponseWriter, _ *http.Request) {
@ -42,7 +43,7 @@ func healthCheckMetrics(w http.ResponseWriter) error {
if cfg.Metrics != nil && cfg.Metrics.Influx != nil { if cfg.Metrics != nil && cfg.Metrics.Influx != nil {
queryApi := idb.QueryAPI(cfg.Metrics.Influx.Org) queryApi := idb.QueryAPI(cfg.Metrics.Influx.Org)
query := fmt.Sprintf("from(bucket: \"%v\")\n", cfg.Metrics.Influx.Bucket) + query := fmt.Sprintf("from(bucket: \"%v\")\n", cfg.Metrics.Influx.Bucket) +
fmt.Sprintf("|> range(start: -5s)\n") + "|> range(start: -5s)\n" +
"|> filter(fn: (r) => r[\"_measurement\"] == \"xfer\")\n" + "|> filter(fn: (r) => r[\"_measurement\"] == \"xfer\")\n" +
"|> filter(fn: (r) => r[\"_field\"] == \"rx\" or r[\"_field\"] == \"tx\")\n" + "|> filter(fn: (r) => r[\"_field\"] == \"rx\" or r[\"_field\"] == \"tx\")\n" +
"|> filter(fn: (r) => r[\"namespace\"] == \"backend\")\n" + "|> filter(fn: (r) => r[\"namespace\"] == \"backend\")\n" +