Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

fix: check if it's castable to string (#8517)

Nityananda Gohain1aa6c98822d2
diff --git a/pkg/query-service/model/v3/v3.go b/pkg/query-service/model/v3/v3.go
index 239e9acd72..7939401f98 100644
--- a/pkg/query-service/model/v3/v3.go
+++ b/pkg/query-service/model/v3/v3.go
@@ -1140,6 +1140,9 @@ func (b *BuilderQuery) Validate(panelType PanelType) error {
_, ok := function.Args[0].(float64)
if !ok {
// if string, attempt to convert to float
+ if _, ok := function.Args[0].(string); !ok {
+ return fmt.Errorf("threshold param should be a float")
+ }
threshold, err := strconv.ParseFloat(function.Args[0].(string), 64)
if err != nil {
return fmt.Errorf("threshold param should be a float")