Skip to main content
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:
ProviderExample Endpoint
Self-hosted Prometheushttp://prometheus.monitoring.svc.cluster.local:9090
Prometheus via port-forwardhttp://localhost:9090
Grafana Cloudhttps://prometheus-prod-xx-xxx.grafana.net
Amazon Managed Prometheushttps://aps-workspaces.<region>.amazonaws.com/workspaces/<id>
Google Cloud Managed Prometheushttps://monitoring.googleapis.com/v1/projects/<project>
Thanos Queryhttp://thanos-query.monitoring.svc.cluster.local:9090
Victoria Metricshttp://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:
http://prometheus-server.monitoring.svc.cluster.local:9090
For kube-prometheus-stack:
http://prometheus-operated.monitoring.svc.cluster.local:9090
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

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:
  1. Use the internal Kubernetes service URL
  2. No authentication is typically needed
  3. The Ankra agent forwards requests through the cluster network
Common service URLs:
# Standard Prometheus
http://prometheus-server.monitoring.svc.cluster.local:9090

# kube-prometheus-stack
http://prometheus-operated.monitoring.svc.cluster.local:9090

# Prometheus Operator
http://prometheus-k8s.monitoring.svc.cluster.local:9090

External Prometheus

If Prometheus runs outside the cluster (cloud managed, separate infrastructure):
  1. Use the external URL (must be reachable from your cluster)
  2. Configure authentication as required by your provider
  3. 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:
  1. Check the Settings Page - You should see a green “Connected” status
  2. View Resource Metrics - Go to any pod or deployment and check for metric graphs
  3. Ask the AI - Press ⌘+J and ask “What’s the CPU usage of this pod?”
If metrics aren’t showing:
  • 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

  1. Verify the URL is correct and includes the port
  2. For in-cluster Prometheus, ensure the service exists:
    kubectl get svc -n monitoring
    
  3. Check if Prometheus is running:
    kubectl get pods -n monitoring -l app=prometheus
    
  4. Test connectivity from within the cluster:
    kubectl run curl --rm -it --image=curlimages/curl -- curl http://prometheus-server.monitoring:9090/api/v1/query?query=up
    
  1. Verify the credential is correctly configured
  2. For API tokens, ensure the token hasn’t expired
  3. For basic auth, verify the username and password are correct
  4. Check Prometheus logs for authentication failures
  1. Prometheus may not have metrics for the resource yet (wait for scrape interval)
  2. Verify Prometheus is scraping the correct targets
  3. Check the Prometheus UI targets page for scrape errors
  4. Ensure the metric names match what Ankra expects (standard Kubernetes metrics)
  1. Large time ranges can be slow. Try narrower ranges.
  2. Consider using recording rules for frequently-queried metrics
  3. Check Prometheus resource usage (may need more CPU/memory)

What Metrics Does Ankra Use?

Ankra queries standard Kubernetes and node metrics:
MetricSourceUsed For
container_cpu_usage_seconds_totalcAdvisorPod/container CPU graphs
container_memory_working_set_bytescAdvisorPod/container memory graphs
node_cpu_seconds_totalnode-exporterNode CPU usage
node_memory_MemAvailable_bytesnode-exporterNode memory usage
kube_pod_status_phasekube-state-metricsPod status indicators
kube_deployment_status_replicaskube-state-metricsDeployment health
If you’re using kube-prometheus-stack, all these metrics are included by default.

Next Steps