Mentions légales du service

Skip to content
Snippets Groups Projects
Commit c7870728 authored by Simon Delamare's avatar Simon Delamare
Browse files

db: Fix summarized aggregation for counters metrics

parent 562f2eb5
No related branches found
No related tags found
No related merge requests found
......@@ -139,7 +139,7 @@ CREATE MATERIALIZED VIEW IF NOT EXISTS metrics_summary
SELECT time_bucket(INTERVAL '5 minute', timestamp) AS timestamp,
device_id,
metric_id,
AVG(value) AS value,
CASE WHEN metrics.metric_id ~ '_total$' THEN MAX(value) ELSE AVG(value) END AS value,
labels - '_metric_scrape_time' AS labels
FROM metrics
GROUP BY time_bucket(INTERVAL '5 minute', timestamp), device_id, metric_id, labels - '_metric_scrape_time'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment