fix: prometheus

This commit is contained in:
icey-yu 2025-09-26 15:55:33 +08:00
parent 95d383d656
commit fd479c15b4

View File

@ -3,6 +3,7 @@ package api
import ( import (
"encoding/json" "encoding/json"
"errors" "errors"
"fmt"
"net/http" "net/http"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
@ -50,6 +51,7 @@ func (p *PrometheusDiscoveryApi) discovery(c *gin.Context, key string) {
c.JSON(http.StatusOK, []*prommetrics.RespTarget{}) c.JSON(http.StatusOK, []*prommetrics.RespTarget{})
return return
} }
fmt.Println(len(value))
var resp prommetrics.RespTarget var resp prommetrics.RespTarget
for i := range value { for i := range value {
var tmp prommetrics.Target var tmp prommetrics.Target