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(tracefunnel): quote step names in slow and error trace queries (#12886)

Pandey8286e787b296
diff --git a/pkg/modules/tracefunnel/clickhouse_queries.go b/pkg/modules/tracefunnel/clickhouse_queries.go
index 1e5b756e59..f0f369fe69 100644
--- a/pkg/modules/tracefunnel/clickhouse_queries.go
+++ b/pkg/modules/tracefunnel/clickhouse_queries.go
@@ -495,8 +495,8 @@ WITH
toDateTime64(%[3]d/1e9, 9) AS start_ts,
toDateTime64(%[4]d/1e9, 9) AS end_ts,
- ('%[5]s','%[6]s') AS step1,
- ('%[7]s','%[8]s') AS step2
+ (%[5]s,%[6]s) AS step1,
+ (%[7]s,%[8]s) AS step2
SELECT
trace_id,
@@ -527,10 +527,10 @@ LIMIT 5;
containsErrorT2,
startTs,
endTs,
- serviceNameT1,
- spanNameT1,
- serviceNameT2,
- spanNameT2,
+ clickhousesql.StringLiteral(serviceNameT1),
+ clickhousesql.StringLiteral(spanNameT1),
+ clickhousesql.StringLiteral(serviceNameT2),
+ clickhousesql.StringLiteral(spanNameT2),
clauseStep1,
clauseStep2,
t1TimeExpr,
@@ -571,8 +571,8 @@ WITH
toDateTime64(%[3]d/1e9, 9) AS start_ts,
toDateTime64(%[4]d/1e9, 9) AS end_ts,
- ('%[5]s','%[6]s') AS step1,
- ('%[7]s','%[8]s') AS step2
+ (%[5]s,%[6]s) AS step1,
+ (%[7]s,%[8]s) AS step2
SELECT
trace_id,
@@ -607,10 +607,10 @@ LIMIT 5;
containsErrorT2,
startTs,
endTs,
- serviceNameT1,
- spanNameT1,
- serviceNameT2,
- spanNameT2,
+ clickhousesql.StringLiteral(serviceNameT1),
+ clickhousesql.StringLiteral(spanNameT1),
+ clickhousesql.StringLiteral(serviceNameT2),
+ clickhousesql.StringLiteral(spanNameT2),
clauseStep1,
clauseStep2,
t1TimeExpr,