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: enrich all queries with non materialized attributes (#4772)

Nityananda Gohain397da5857f20
diff --git a/pkg/query-service/app/logs/v3/enrich_query.go b/pkg/query-service/app/logs/v3/enrich_query.go
index c8a5a797b2..904b348999 100644
--- a/pkg/query-service/app/logs/v3/enrich_query.go
+++ b/pkg/query-service/app/logs/v3/enrich_query.go
@@ -74,6 +74,12 @@ func isEnriched(field v3.AttributeKey) bool {
if field.Type == v3.AttributeKeyTypeUnspecified || field.DataType == v3.AttributeKeyDataTypeUnspecified {
return false
}
+
+ // try to enrich all attributes which doesn't have isColumn = true
+ if !field.IsColumn {
+ return false
+ }
+
return true
}
diff --git a/pkg/query-service/app/logs/v3/enrich_query_test.go b/pkg/query-service/app/logs/v3/enrich_query_test.go
index 4903139610..3605fa5408 100644
--- a/pkg/query-service/app/logs/v3/enrich_query_test.go
+++ b/pkg/query-service/app/logs/v3/enrich_query_test.go
@@ -30,7 +30,7 @@ var testEnrichmentRequiredData = []struct {
},
},
},
- EnrichmentRequired: false,
+ EnrichmentRequired: true,
},
{
Name: "attribute enrichment required",
@@ -66,7 +66,7 @@ var testEnrichmentRequiredData = []struct {
},
},
},
- EnrichmentRequired: false,
+ EnrichmentRequired: true,
},
{
Name: "filter enrichment required",
@@ -118,7 +118,7 @@ var testEnrichmentRequiredData = []struct {
},
},
},
- EnrichmentRequired: false,
+ EnrichmentRequired: true,
},
{
Name: "groupBy enrichment required",
@@ -151,7 +151,7 @@ var testEnrichmentRequiredData = []struct {
},
},
},
- EnrichmentRequired: false,
+ EnrichmentRequired: true,
},
{
Name: "orderBy enrichment required",
@@ -200,7 +200,7 @@ var testEnrichmentRequiredData = []struct {
},
},
},
- EnrichmentRequired: false,
+ EnrichmentRequired: true,
},
}
@@ -255,6 +255,7 @@ var testEnrichParamsData = []struct {
Key: "response_time",
Type: v3.AttributeKeyTypeTag,
DataType: v3.AttributeKeyDataTypeInt64,
+ IsColumn: true,
},
},
Result: v3.QueryRangeParamsV3{
@@ -273,7 +274,7 @@ var testEnrichParamsData = []struct {
{Key: v3.AttributeKey{Key: "user_name", Type: v3.AttributeKeyTypeTag, DataType: v3.AttributeKeyDataTypeString}, Value: "john", Operator: "="},
}},
GroupBy: []v3.AttributeKey{{Key: "trace_id", Type: v3.AttributeKeyTypeUnspecified, DataType: v3.AttributeKeyDataTypeString, IsColumn: true}},
- OrderBy: []v3.OrderBy{{ColumnName: "response_time", Key: "response_time", Type: v3.AttributeKeyTypeTag, DataType: v3.AttributeKeyDataTypeInt64}},
+ OrderBy: []v3.OrderBy{{ColumnName: "response_time", Key: "response_time", Type: v3.AttributeKeyTypeTag, DataType: v3.AttributeKeyDataTypeInt64, IsColumn: true}},
},
},
},