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.
TypeScript apmapplication-monitoringdistributed-tracinggogood-first-issuejaegerloglogsmetricsmonitoringnextjsobservabilityopen-sourceopentelemetryprometheusreactreactjsself-hostedtracingtypescript
fix: don't fetch all attributes during build and run query (#8589)
Nityananda Gohainc9e8114b5eaa
diff --git a/pkg/query-service/rules/threshold_rule.go b/pkg/query-service/rules/threshold_rule.goindex 329fdd2b76..6b9ba4d860 100644--- a/pkg/query-service/rules/threshold_rule.go+++ b/pkg/query-service/rules/threshold_rule.go@@ -283,7 +283,7 @@ func (r *ThresholdRule) buildAndRunQuery(ctx context.Context, orgID valuer.UUID,if hasLogsQuery {// check if any enrichment is required for logs if yes then enrich themif logsv3.EnrichmentRequired(params) {- logsFields, err := r.reader.GetLogFields(ctx)+ logsFields, err := r.reader.GetLogFieldsFromNames(ctx, logsv3.GetFieldNames(params.CompositeQuery))if err != nil {return nil, err}diff --git a/pkg/query-service/rules/threshold_rule_test.go b/pkg/query-service/rules/threshold_rule_test.goindex fdfc0321bb..068edda15f 100644--- a/pkg/query-service/rules/threshold_rule_test.go+++ b/pkg/query-service/rules/threshold_rule_test.go@@ -1320,7 +1320,6 @@ func TestThresholdRuleNoData(t *testing.T) {for idx, c := range cases {rows := cmock.NewRows(cols, c.values)-// We are testing the eval logic after the query is run// so we don't care about the query string herequeryString := "SELECT any"@@ -1514,11 +1513,11 @@ func TestThresholdRuleLogsLink(t *testing.T) {attrMetaCols := make([]cmock.ColumnType, 0)attrMetaCols = append(attrMetaCols, cmock.ColumnType{Name: "name", Type: "String"})- attrMetaCols = append(attrMetaCols, cmock.ColumnType{Name: "dataType", Type: "String"})+ attrMetaCols = append(attrMetaCols, cmock.ColumnType{Name: "datatype", Type: "String"})resourceMetaCols := make([]cmock.ColumnType, 0)resourceMetaCols = append(resourceMetaCols, cmock.ColumnType{Name: "name", Type: "String"})- resourceMetaCols = append(resourceMetaCols, cmock.ColumnType{Name: "dataType", Type: "String"})+ resourceMetaCols = append(resourceMetaCols, cmock.ColumnType{Name: "datatype", Type: "String"})createTableCols := make([]cmock.ColumnType, 0)createTableCols = append(createTableCols, cmock.ColumnType{Name: "statement", Type: "String"})@@ -1531,12 +1530,12 @@ func TestThresholdRuleLogsLink(t *testing.T) {for idx, c := range testCases {attrMetaRows := cmock.NewRows(attrMetaCols, c.attrMetaValues)telemetryStore.Mock().- ExpectSelect("SELECT DISTINCT name, datatype from signoz_logs.distributed_logs_attribute_keys group by name, datatype").+ ExpectSelect("SELECT DISTINCT name, datatype from signoz_logs.distributed_logs_attribute_keys where name in ('component','k8s.container.name') group by name, datatype").WillReturnRows(attrMetaRows)resourceMetaRows := cmock.NewRows(resourceMetaCols, c.resourceMetaValues)telemetryStore.Mock().- ExpectSelect("SELECT DISTINCT name, datatype from signoz_logs.distributed_logs_resource_keys group by name, datatype").+ ExpectSelect("SELECT DISTINCT name, datatype from signoz_logs.distributed_logs_resource_keys where name in ('component','k8s.container.name') group by name, datatype").WillReturnRows(resourceMetaRows)createTableRows := cmock.NewRows(createTableCols, c.createTableValues)