Overview
Dashboard uses the dashboard-metrics-scraper sidecar to collect and store metrics data, providing:- CPU and memory usage graphs
- Historical sparklines in list views
- Resource utilization trends
- Per-pod and per-node metrics
Metrics collection requires metrics-server to be running in your cluster. The metrics-scraper is deployed by default with Kubernetes Dashboard.
Prerequisites
Installing metrics-server
Verify metrics-server is running:Dashboard Metrics Scraper
The metrics scraper is automatically deployed with Dashboard. It:- Queries the Metrics API every 60 seconds
- Stores data points in a SQLite database
- Serves metrics to the Dashboard frontend
- Maintains historical data for sparklines and graphs
Metrics Architecture
The metrics flow:Metrics Data Structure
The scraper stores metrics in a structured format (modules/metrics-scraper/pkg/api/dashboard/types.go:28-75):
Database Schema
Metrics are stored in two tables: Pods Table:Viewing Node Metrics
Access node metrics at Cluster → Nodes.Node Metrics Display
CPU Usage
Shows CPU utilization in millicores and percentage
Memory Usage
Displays memory consumption in bytes and percentage
Pod Count
Number of pods running on the node
Allocation
Resource requests vs. capacity
Node Detail Metrics
Click on a node to view detailed metrics:- CPU Chart: Historical CPU usage over time
- Memory Chart: Historical memory consumption
- Resource Allocation: Visual breakdown of allocated resources
- Capacity: Total node capacity vs. requests vs. limits
Viewing Pod Metrics
Access pod metrics at Workloads → Pods.List View Sparklines
The pod list displays mini sparkline graphs showing:- Recent CPU usage trend
- Recent memory usage trend
- Visual indication of resource consumption patterns
Pod Detail Metrics
The pod detail page shows:- CPU Metrics
- Memory Metrics
- Current Usage: Millicores currently consumed
- Requested: CPU requests defined in pod spec
- Limited: CPU limits defined in pod spec
- Usage Graph: Historical CPU consumption
Metrics API Endpoints
The metrics scraper exposes REST endpoints (modules/metrics-scraper/pkg/api/dashboard/dashboard.go:33-36):
Node Metrics
Pod Metrics
Deployment Metrics
View aggregated metrics for deployments at Workloads → Deployments. The deployment view shows (modules/api/pkg/resource/deployment/list.go:31-44):
- Aggregate CPU usage across all pods
- Aggregate memory usage across all pods
- Per-deployment sparklines
- Resource utilization trends
Metrics Configuration
Customize metrics behavior with Dashboard flags:API Container Flags
Metrics Scraper Flags
The
--metric-client-check-period flag controls health check frequency. Dashboard disables metrics if the scraper becomes unavailable.Understanding Metrics Data
CPU Metrics
CPU is measured in millicores:- 1000m = 1 full CPU core
- 500m = 0.5 CPU cores
- 100m = 10% of one CPU core
Memory Metrics
Memory is measured in bytes:- 1024 bytes = 1 KiB
- 1048576 bytes = 1 MiB
- 1073741824 bytes = 1 GiB
Time Windows
Default retention:- Scrape Interval: 60 seconds
- Retention Period: 15 minutes
- Database Size: Automatically managed
Troubleshooting
Metrics not displayed
Metrics not displayed
Check metrics-server installation:Verify metrics-scraper is running:
Metrics lag or outdated
Metrics lag or outdated
Check the scrape interval and database health:Restart the metrics scraper:
High memory usage by scraper
High memory usage by scraper
Reduce retention period or scrape interval:
Metrics Integration
Dashboard integrates with the metrics ecosystem:Supported Metrics Providers
metrics-server
Default metrics provider using the Metrics API
Custom Providers
Extend via the integration framework
Integration Framework
The integration framework (modules/api/pkg/integration/manager.go) supports:
- Multiple metric providers
- Health checking and failover
- Provider registration and discovery
Dashboard currently integrates metrics-server by default. The integration framework allows for future expansion to providers like Prometheus or custom metrics APIs.
Best Practices
Monitor resource utilization regularly
Monitor resource utilization regularly
Check metrics weekly to identify resource bottlenecks and optimize allocations.
Set appropriate resource limits
Set appropriate resource limits
Use metrics data to determine realistic CPU and memory limits for your workloads.
Alert on anomalies
Alert on anomalies
Integrate external monitoring systems for alerting on unusual metric patterns.
Scale based on metrics
Scale based on metrics
Use HorizontalPodAutoscaler (HPA) to automatically scale based on CPU/memory metrics.
Next Steps
Viewing Logs
Access container logs for debugging
Integrations
Learn about third-party monitoring integrations