Hi am trying to visualize some metrics (gauge type...
# support
j
Hi am trying to visualize some metrics (gauge type) that are collected at 1Hz, however i am running into the following
Copy code
Query 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?
@Vishal Sharma @Eugene Malihins for viz
e
came across this issue https://github.com/SigNoz/signoz/issues/7248#issuecomment-3229639666 figured out that this is is a current limitation of the Query Builder, in the meantime achieved 1-sec resolution with clickhouse query:
Copy code
SELECT
    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
👍 1