Skip to main content
Gå til innhold

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:

  1. Instrument your app with OpenTelemetry
  2. Configure the OTLP exporter (see PaaS Full Observability)
  3. Access metrics in Grafana via your Mimir data source

Viewing Metrics

  1. Go to Grafana
  2. Open Explore
  3. Select your Mimir data source
  4. 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