Metrics
Metrics are numerical measurements collected over time. They're efficient for monitoring trends, setting up alerts, and building dashboards.
When to Use Metrics
Metrics are ideal for:
- Monitoring: Track request rates, error rates, latencies
- Alerting: Trigger notifications when thresholds are exceeded
- Dashboards: Visualize system health at a glance
- Capacity planning: Understand resource usage trends
For detailed debugging of specific issues, use logs instead.
Automatic Metrics in PaaS
If you run on Platon PaaS, you automatically get Kubernetes metrics with no setup required:
- Container CPU usage
- Container memory usage
- Network traffic
- Pod restarts
These metrics are available in your Grafana organization through the Kubernetes metrics data source.
Custom Metrics with OTLP
To send your own application metrics:
- Instrument your app with OpenTelemetry
- Configure the OTLP exporter (see PaaS Full Observability)
- Access metrics in Grafana via your Mimir data source
Viewing Metrics
- Go to Grafana
- Open Explore
- Select your Mimir data source
- Write a PromQL query
Example Queries
Current value of a metric:
http_requests_total{namespace="my-namespace"}
Rate of requests per second:
rate(http_requests_total{namespace="my-namespace"}[5m])
Error rate percentage:
sum(rate(http_requests_total{status=~"5.."}[5m]))
/ sum(rate(http_requests_total[5m])) * 100
Query Language
Mimir uses PromQL (Prometheus Query Language). Learn more:
Next Steps
- Dashboards - Visualize metrics over time
- Alerting - Get notified when metrics cross thresholds