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: update TestListTsRange to return all range (#6470)

Nityananda Gohain98a350692b83
diff --git a/pkg/query-service/utils/logs.go b/pkg/query-service/utils/logs.go
index 81f275fa5f..5d26df6fb0 100644
--- a/pkg/query-service/utils/logs.go
+++ b/pkg/query-service/utils/logs.go
@@ -35,6 +35,8 @@ func GetListTsRanges(start, end int64) []LogsListTsRange {
tStartNano = startNano
}
}
+ } else {
+ result = append(result, LogsListTsRange{Start: start, End: end})
}
return result
}
diff --git a/pkg/query-service/utils/logs_test.go b/pkg/query-service/utils/logs_test.go
index 2747102e56..1e95f98fca 100644
--- a/pkg/query-service/utils/logs_test.go
+++ b/pkg/query-service/utils/logs_test.go
@@ -18,7 +18,7 @@ func TestListTsRange(t *testing.T) {
name: "testing for less then one hour",
start: 1722262800000000000, // July 29, 2024 7:50:00 PM
end: 1722263800000000000, // July 29, 2024 8:06:40 PM
- res: []LogsListTsRange{},
+ res: []LogsListTsRange{{1722262800000000000, 1722263800000000000}},
},
{
name: "testing for more than one hour",