Jordan Haskel
08/27/2025, 6:54 PMQuery A is requesting aggregation interval 5 seconds, which is smaller than the minimum allowed interval of 60 seconds for selected time range. Using the minimum instead
The time frame is the smallest relative frame of "last 5 minutes"
Is there no way to view this data on a finer time scale?Jordan Haskel
08/27/2025, 7:16 PMEugene Malihins
08/28/2025, 7:58 AMSELECT
toStartOfInterval(
toDateTime(intDiv(unix_milli, 1000)),
CASE
WHEN {{.end_timestamp_ms}} - {{.start_timestamp_ms}} <= 300000 THEN toIntervalSecond(1) -- <= 5 min: 1s
WHEN {{.end_timestamp_ms}} - {{.start_timestamp_ms}} <= 900000 THEN toIntervalSecond(5) -- <= 15 min: 5s
WHEN {{.end_timestamp_ms}} - {{.start_timestamp_ms}} <= 3600000 THEN toIntervalSecond(15) -- <= 1 hour: 15s
WHEN {{.end_timestamp_ms}} - {{.start_timestamp_ms}} <= 21600000 THEN toIntervalSecond(60) -- <= 6 hours: 1m
WHEN {{.end_timestamp_ms}} - {{.start_timestamp_ms}} <= 86400000 THEN toIntervalSecond(300) -- <= 1 day: 5m
WHEN {{.end_timestamp_ms}} - {{.start_timestamp_ms}} <= 604800000 THEN toIntervalSecond(900) -- <= 1 week: 15m
ELSE toIntervalSecond(3600) -- > 1 week: 1h
END
) AS ts,
JSONExtractString(filtered_time_series.labels, 'process.command') AS process_command,
avg(value) AS value
FROM signoz_metrics.distributed_samples_v4
INNER JOIN
(
SELECT DISTINCT
fingerprint,
labels
FROM signoz_metrics.time_series_v4_1day
WHERE (metric_name = 'container.process.cpu.utilization')
) AS filtered_time_series USING (fingerprint)
WHERE (metric_name = 'container.process.cpu.utilization')
AND (unix_milli >= {{.start_timestamp_ms}})
AND (unix_milli < {{.end_timestamp_ms}})
GROUP BY ts, process_command
ORDER BY ts ASC, process_command ASC