Resource Utilization
Avg CPU Utilization
Avg Memory Usage
Container Count
Services with Metrics
CPU Utilization by Service
SQL
SELECT
time_bucket('{{rollup_interval}}', timestamp) as timestamp,
COALESCE(resource___service___name, resource___container___name, 'unknown') as series,
ROUND(AVG(value::numeric * 100), 2) as value
FROM otel_metrics
WHERE project_id='{{project_id}}'
AND metric_name IN ('container.cpu.utilization', 'jvm.cpu.recent_utilization', 'process.cpu.utilization')
{{time_filter}}
GROUP BY time_bucket('{{rollup_interval}}', timestamp), series
ORDER BY timestamp DESC
LIMIT 2000
No data in this time range
Try a wider time range or adjust the filters.
Memory Usage by Service
SQL
SELECT
time_bucket('{{rollup_interval}}', timestamp) as timestamp,
COALESCE(resource___service___name, resource___container___name, 'unknown') as series,
ROUND(AVG(value::numeric), 2) as value
FROM otel_metrics
WHERE project_id='{{project_id}}'
AND metric_name = 'container.memory.percent'
{{time_filter}}
GROUP BY time_bucket('{{rollup_interval}}', timestamp), series
ORDER BY timestamp DESC
LIMIT 2000
No data in this time range
Try a wider time range or adjust the filters.
Service Resource Usage
SQL
WITH cpu_metrics AS (
SELECT
COALESCE(resource___service___name, resource___container___name, 'unknown') as service,
value::numeric * 100 as value
FROM otel_metrics
WHERE project_id='{{project_id}}'
AND metric_name IN ('container.cpu.utilization', 'jvm.cpu.recent_utilization', 'process.cpu.utilization')
{{time_filter}}
),
mem_metrics AS (
SELECT
COALESCE(resource___service___name, resource___container___name, 'unknown') as service,
value::numeric as value
FROM otel_metrics
WHERE project_id='{{project_id}}'
AND metric_name = 'container.memory.percent'
{{time_filter}}
)
SELECT
COALESCE(c.service, m.service) as service,
ROUND(AVG(c.value)::numeric, 1) as cpu_avg,
ROUND(MAX(c.value)::numeric, 1) as cpu_max,
ROUND(AVG(m.value)::numeric, 1) as mem_avg,
ROUND(MAX(m.value)::numeric, 1) as mem_max,
(COUNT(c.*) + COUNT(m.*)) as data_points
FROM cpu_metrics c
FULL OUTER JOIN mem_metrics m ON c.service = m.service
GROUP BY COALESCE(c.service, m.service)
ORDER BY {{table_sort}}
LIMIT 20
Kafka Consumer Lag
SQL
SELECT
time_bucket('{{rollup_interval}}', timestamp) as timestamp,
COALESCE(resource___service___name, 'kafka') as series,
AVG(value) as value
FROM otel_metrics
WHERE project_id='{{project_id}}'
AND metric_name = 'kafka.consumer.assigned_partitions'
{{time_filter}}
GROUP BY time_bucket('{{rollup_interval}}', timestamp), series
ORDER BY timestamp DESC
LIMIT 1000
No data in this time range
Try a wider time range or adjust the filters.
System Load Average
SQL
SELECT
time_bucket('{{rollup_interval}}', timestamp) as timestamp,
CASE
WHEN metric_name = 'system.cpu.load_average.1m' THEN '1 min'
WHEN metric_name = 'system.cpu.load_average.5m' THEN '5 min'
WHEN metric_name = 'system.cpu.load_average.15m' THEN '15 min'
END as series,
AVG(value) as value
FROM otel_metrics
WHERE project_id='{{project_id}}'
AND metric_name IN ('system.cpu.load_average.1m', 'system.cpu.load_average.5m', 'system.cpu.load_average.15m')
{{time_filter}}
GROUP BY time_bucket('{{rollup_interval}}', timestamp), metric_name
ORDER BY timestamp DESC
LIMIT 3000
No data in this time range
Try a wider time range or adjust the filters.
Redis Memory Usage
SQL
SELECT
time_bucket('{{rollup_interval}}', timestamp) as timestamp,
metric_name as series,
AVG(value) / 1048576 as value
FROM otel_metrics
WHERE project_id='{{project_id}}'
AND metric_name IN ('redis.memory.used', 'redis.memory.rss', 'redis.memory.peak')
{{time_filter}}
GROUP BY time_bucket('{{rollup_interval}}', timestamp), metric_name
ORDER BY timestamp DESC
LIMIT 3000
No data in this time range
Try a wider time range or adjust the filters.
Available Metrics
SQL
SELECT
metric_name,
COUNT(*) as data_points,
COALESCE(MAX(metric_unit), '-') as unit
FROM otel_metrics
WHERE project_id='{{project_id}}'
{{time_filter}}
GROUP BY metric_name
ORDER BY {{table_sort}}
LIMIT 20