Connect your Prometheus instance to Ankra to view metrics directly in the platform. This powers resource graphs, the AI Assistant’s metrics awareness, and cluster health indicators.
Why Connect Prometheus?
When you connect Prometheus to Ankra:- Resource Metrics - View CPU, memory, and network graphs on pods, deployments, and nodes
- AI-Powered Analysis - The AI Assistant can query your metrics to diagnose issues
- Cluster Overview - See aggregate metrics on the cluster dashboard
- Troubleshooting - Correlate metrics with logs and events in one place
Supported Endpoints
Ankra connects to any Prometheus-compatible endpoint:| Provider | Example Endpoint |
|---|---|
| Self-hosted Prometheus | http://prometheus.monitoring.svc.cluster.local:9090 |
| Prometheus via port-forward | http://localhost:9090 |
| Grafana Cloud | https://prometheus-prod-xx-xxx.grafana.net |
| Amazon Managed Prometheus | https://aps-workspaces.<region>.amazonaws.com/workspaces/<id> |
| Google Cloud Managed Prometheus | https://monitoring.googleapis.com/v1/projects/<project> |
| Thanos Query | http://thanos-query.monitoring.svc.cluster.local:9090 |
| Victoria Metrics | http://victoria-metrics.monitoring.svc.cluster.local:8428 |
Connecting Prometheus
1
Open Cluster Settings
Navigate to your cluster and go to Settings in the sidebar.
2
Find Metrics Data Source
Scroll to the Metrics Data Source section.
3
Select Prometheus
Choose Prometheus from the data source dropdown.
4
Enter the Endpoint
Enter your Prometheus endpoint URL.For in-cluster Prometheus, use the internal service URL:For kube-prometheus-stack:
5
Add Authentication (if required)
If your Prometheus requires authentication, add a credential:
- API Token - For bearer token authentication
- User Account - For basic auth (username/password)
6
Test Connection
Click Test Connection to verify Ankra can reach your Prometheus instance.
7
Save
Click Save to store the configuration.
Authentication Options
- No Authentication
- API Token
- Basic Auth
For Prometheus instances without authentication (common for in-cluster deployments):Simply enter the endpoint URL and save. No credentials needed.
In-Cluster vs External Prometheus
In-Cluster Prometheus
If Prometheus runs inside the same cluster:- Use the internal Kubernetes service URL
- No authentication is typically needed
- The Ankra agent forwards requests through the cluster network
External Prometheus
If Prometheus runs outside the cluster (cloud managed, separate infrastructure):- Use the external URL (must be reachable from your cluster)
- Configure authentication as required by your provider
- Ensure network connectivity and firewall rules allow access
Creating Credentials
If your Prometheus requires authentication:1
Go to Credentials
Navigate to Credentials in the main navigation (or use
⌘+K → “Credentials”).2
Create New Credential
Click Create Credential and select:
- API Token for bearer token auth
- User Account for basic auth
3
Enter Details
- Name - A descriptive name like “prometheus-prod”
- Token or Username/Password - Your authentication details
4
Save
The credential is now available in the Metrics Data Source dropdown.
Verifying the Connection
After connecting Prometheus:- Check the Settings Page - You should see a green “Connected” status
- View Resource Metrics - Go to any pod or deployment and check for metric graphs
- Ask the AI - Press
⌘+Jand ask “What’s the CPU usage of this pod?”
- Verify the endpoint URL is correct
- Check that Prometheus has data for your cluster
- Test the connection from the settings page
- Check network connectivity between your cluster and Prometheus
Troubleshooting
Connection Test Fails
Connection Test Fails
- Verify the URL is correct and includes the port
- For in-cluster Prometheus, ensure the service exists:
- Check if Prometheus is running:
- Test connectivity from within the cluster:
Authentication Errors
Authentication Errors
- Verify the credential is correctly configured
- For API tokens, ensure the token hasn’t expired
- For basic auth, verify the username and password are correct
- Check Prometheus logs for authentication failures
Metrics Not Appearing
Metrics Not Appearing
- Prometheus may not have metrics for the resource yet (wait for scrape interval)
- Verify Prometheus is scraping the correct targets
- Check the Prometheus UI targets page for scrape errors
- Ensure the metric names match what Ankra expects (standard Kubernetes metrics)
Slow Queries
Slow Queries
- Large time ranges can be slow. Try narrower ranges.
- Consider using recording rules for frequently-queried metrics
- Check Prometheus resource usage (may need more CPU/memory)
What Metrics Does Ankra Use?
Ankra queries standard Kubernetes and node metrics:| Metric | Source | Used For |
|---|---|---|
container_cpu_usage_seconds_total | cAdvisor | Pod/container CPU graphs |
container_memory_working_set_bytes | cAdvisor | Pod/container memory graphs |
node_cpu_seconds_total | node-exporter | Node CPU usage |
node_memory_MemAvailable_bytes | node-exporter | Node memory usage |
kube_pod_status_phase | kube-state-metrics | Pod status indicators |
kube_deployment_status_replicas | kube-state-metrics | Deployment health |