Prometheus and Grafana Integration
Meshery integrates with Prometheus and Grafana to provide comprehensive observability for your infrastructure and applications. Collect metrics, visualize performance data, and gain insights into the behavior of your service meshes, Kubernetes clusters, and workloads.Overview
Meshery’s observability integrations enable:- Metrics Collection: Connect to Prometheus for infrastructure and application metrics
- Dashboard Visualization: Import and view Grafana dashboards in Meshery
- Performance Testing: Correlate load test results with system metrics
- Historical Analysis: Track performance trends over time
- Multi-Cluster Monitoring: Aggregate metrics from multiple clusters
Prometheus
Time-series database for metrics collection and querying
Grafana
Visualization platform for creating and viewing dashboards
Prometheus Integration
Prometheus is an open-source monitoring system that collects and stores metrics as time-series data.Installation
Deploy Prometheus to Kubernetes
- Helm
- Kubernetes Manifests
- Meshery Service Mesh Add-on
Verify Prometheus Installation
http://localhost:9090.
Connect Prometheus to Meshery
Enter Prometheus URL
Provide the Prometheus server URL:
- In-cluster:
http://prometheus-server.monitoring:80 - Port-forwarded:
http://localhost:9090 - External:
https://prometheus.example.com
Auto-Discovery
Meshery’s MeshSync component automatically discovers Prometheus instances running in connected Kubernetes clusters. If Prometheus is detected, Meshery will attempt to register it for use. Verify auto-discovered Prometheus connections in Settings > Metrics.Prometheus Configuration
Scrape Kubernetes Metrics
Configure Prometheus to scrape metrics from Kubernetes services:Scrape Service Mesh Metrics
For Istio, Prometheus scrapes Envoy sidecar metrics:Prometheus Queries in Meshery
Meshery uses Prometheus queries to collect metrics during performance tests:Node Metrics
Pod Metrics
Service Mesh Metrics (Istio)
Performance Testing with Prometheus
When running performance tests, Meshery automatically queries Prometheus for system metrics:Collect Metrics
During the test, Meshery queries Prometheus for:
- Node CPU and memory usage
- Pod resource consumption
- Network I/O
- Service mesh metrics (if applicable)
Grafana Integration
Grafana is an open-source platform for visualizing metrics and creating dashboards.Installation
Deploy Grafana to Kubernetes
- Helm
- Kubernetes Manifests
- Service Mesh Add-on
Verify Grafana Installation
http://localhost:3000 (username: admin).
Connect Grafana to Meshery
Enter Grafana Details
Provide:
- Grafana URL:
http://grafana.monitoring:80orhttp://localhost:3000 - API Key: Generate in Grafana (Settings > API Keys)
Configure Prometheus as Grafana Data Source
In Grafana, add Prometheus as a data source:Import Dashboards
Grafana provides pre-built dashboards for Kubernetes and service meshes.Kubernetes Cluster Monitoring
- Kubernetes Cluster Monitoring (ID: 7249)
- Kubernetes Pod Metrics (ID: 6417)
- Node Exporter Full (ID: 1860)
Istio Service Mesh Dashboards
- Istio Control Plane Dashboard (ID: 7636)
- Istio Service Dashboard (ID: 7630)
- Istio Workload Dashboard (ID: 7630)
- Istio Mesh Dashboard (ID: 7639)
View Dashboards in Meshery
Meshery can display Grafana dashboards directly in the UI:- Navigate to Performance > Metrics
- Select a connected Grafana instance
- Choose a dashboard from the list
- View dashboard panels embedded in Meshery
Observability Stack Setup
Deploy a complete observability stack with Prometheus, Grafana, and additional tools.Kube-Prometheus Stack
The kube-prometheus-stack includes:- Prometheus Operator
- Prometheus
- Alertmanager
- Grafana
- Node Exporter
- Kube-State-Metrics
- Pre-configured dashboards and alerts
Installation
Access Components
Service Mesh Observability
For service meshes, deploy the full observability suite: Istio Add-ons:http://localhost:20001 to view Kiali’s service mesh visualization.
Metrics for Performance Testing
Meshery collects the following metrics during performance tests:Load Generator Metrics
- Request Latency: p50, p75, p90, p95, p99 percentiles
- Throughput: Requests per second (RPS)
- Error Rate: Percentage of failed requests
- Connection Time: Time to establish connections
- Response Size: Bytes sent/received
System Metrics (via Prometheus)
- CPU Usage: Per-node and per-pod CPU utilization
- Memory Usage: Working set, RSS, cache
- Network I/O: Bytes sent/received, packet rates
- Disk I/O: Read/write operations and throughput
Service Mesh Metrics
- Request Volume: Total requests per service
- Request Duration: Latency distribution
- Response Codes: 2xx, 3xx, 4xx, 5xx counts
- Circuit Breaker Status: Open/closed state
- Connection Pool: Active connections
Performance Profiles
Meshery allows you to save Performance Profiles that include:- Load test configuration (URL, duration, concurrency)
- Prometheus queries to collect
- Expected performance baselines
- Pass/fail criteria
Advanced Configuration
Custom Prometheus Queries
Define custom Prometheus queries in Meshery:- Go to Performance > Metrics
- Click Add Query
- Enter PromQL query:
- Save query with a descriptive name
- Query will be executed during performance tests
Alerting with Prometheus
Configure alerts based on performance thresholds:Grafana Dashboards for Meshery
Create custom Grafana dashboards for Meshery performance tests:- Load Test Results Panel: Display RPS and latency over time
- Resource Usage Panel: Show CPU/memory consumption during tests
- Service Mesh Panel: Visualize traffic flow and error rates
- Comparison Panel: Compare multiple test runs side-by-side
Troubleshooting
Prometheus Connection Failed
Prometheus Connection Failed
Problem: Meshery cannot connect to PrometheusSolutions:
- Verify Prometheus is running:
kubectl get pods -n monitoring - Check Prometheus URL is correct (include protocol:
http://) - Ensure Prometheus is accessible from Meshery (network policies, firewalls)
- Test manually:
curl http://prometheus-server.monitoring/api/v1/query?query=up
No Metrics During Performance Test
No Metrics During Performance Test
Problem: Performance test completes but no Prometheus metrics collectedSolutions:
- Verify Prometheus connection is active in Meshery settings
- Check Prometheus has data for the time range of the test
- Ensure PromQL queries are valid
- Review Meshery server logs for errors
Grafana Dashboards Not Loading
Grafana Dashboards Not Loading
Problem: Cannot view Grafana dashboards in MesherySolutions:
- Verify Grafana API key has correct permissions (Viewer or Editor)
- Check Grafana URL is accessible from Meshery
- Ensure Grafana version is compatible (v7.0+)
- Test API key manually:
curl -H "Authorization: Bearer API_KEY" http://grafana/api/dashboards/home
Missing Service Mesh Metrics
Missing Service Mesh Metrics
Problem: Prometheus not collecting service mesh metricsSolutions:
- Verify Prometheus scrape configuration includes service mesh jobs
- Check sidecar proxies are injected:
kubectl get pods -o jsonpath='{.items[*].spec.containers[*].name}' - Ensure Envoy metrics port is exposed (15090 for Istio)
- Review Prometheus targets:
http://prometheus:9090/targets
Best Practices
Retention and Storage
Retention and Storage
Configure Prometheus retention based on your needs:For long-term storage, use remote storage backends like Thanos or Cortex.
Resource Limits
Resource Limits
Set resource limits for Prometheus and Grafana:
Security
Security
- Enable authentication for Prometheus and Grafana
- Use RBAC to restrict access
- Configure TLS for encrypted communication
- Rotate Grafana API keys regularly
- Use network policies to limit access to monitoring namespace
Next Steps
Performance Testing
Learn how to run performance tests with Meshery
Service Mesh Monitoring
Monitor service mesh performance and health
Kubernetes Metrics
Collect and visualize Kubernetes cluster metrics
Cloud Native Performance
Learn about the Cloud Native Performance specification