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: double encode composite query for explorer links (#5777)

Srikanth Chekuri8468cc863e8e
diff --git a/pkg/query-service/common/query_range.go b/pkg/query-service/common/query_range.go
index 6e96b5897a..e0c675c50a 100644
--- a/pkg/query-service/common/query_range.go
+++ b/pkg/query-service/common/query_range.go
@@ -126,7 +126,7 @@ func PrepareLinksToTraces(ts time.Time, filterItems []v3.FilterItem) string {
}
data, _ := json.Marshal(urlData)
- compositeQuery := url.QueryEscape(string(data))
+ compositeQuery := url.QueryEscape(url.QueryEscape(string(data)))
optionsData, _ := json.Marshal(options)
urlEncodedOptions := url.QueryEscape(string(optionsData))
@@ -185,7 +185,7 @@ func PrepareLinksToLogs(ts time.Time, filterItems []v3.FilterItem) string {
}
data, _ := json.Marshal(urlData)
- compositeQuery := url.QueryEscape(string(data))
+ compositeQuery := url.QueryEscape(url.QueryEscape(string(data)))
optionsData, _ := json.Marshal(options)
urlEncodedOptions := url.QueryEscape(string(optionsData))
diff --git a/pkg/query-service/rules/threshold_rule.go b/pkg/query-service/rules/threshold_rule.go
index 6ada0e7844..5093e407dc 100644
--- a/pkg/query-service/rules/threshold_rule.go
+++ b/pkg/query-service/rules/threshold_rule.go
@@ -671,7 +671,7 @@ func (r *ThresholdRule) prepareLinksToLogs(ts time.Time, lbls labels.Labels) str
}
data, _ := json.Marshal(urlData)
- compositeQuery := url.QueryEscape(string(data))
+ compositeQuery := url.QueryEscape(url.QueryEscape(string(data)))
optionsData, _ := json.Marshal(options)
urlEncodedOptions := url.QueryEscape(string(optionsData))
@@ -735,7 +735,7 @@ func (r *ThresholdRule) prepareLinksToTraces(ts time.Time, lbls labels.Labels) s
}
data, _ := json.Marshal(urlData)
- compositeQuery := url.QueryEscape(string(data))
+ compositeQuery := url.QueryEscape(url.QueryEscape(string(data)))
optionsData, _ := json.Marshal(options)
urlEncodedOptions := url.QueryEscape(string(optionsData))