Adding a Prometheus data source in Grafana lets dashboards, Explore queries, and alert rules read metrics from a Prometheus API endpoint. Use a manual data source when the connection belongs to one Grafana organization and does not need to be managed from provisioning files.
Grafana sends Prometheus requests from the Grafana server, container, or pod, not from the browser that opens the settings page. The Prometheus server URL must therefore be reachable from that runtime, and localhost usually points at Grafana itself when Grafana runs in a separate container.
The user saving the connection needs permission to create or edit data sources. Save & test confirms that Grafana can query the Prometheus API, and an Explore query such as up confirms that the saved source can return metrics for later dashboards and alerts.
$ curl http://prometheus.example.internal:9090/-/ready Prometheus Server is Ready.
Use the address Grafana will use as the data source URL. In separate containers, localhost inside Grafana does not point at the Prometheus container.



Use a stable internal DNS name or service name where possible. In Docker or Kubernetes deployments, the service name is usually safer than a workstation-only address. Select the matching authentication, TLS, or managed-service settings when the Prometheus endpoint requires them.
Grafana reports Successfully queried the Prometheus API. when the URL and connection settings work.
The query up should return a series with value 1 for a scraped target when Prometheus has collected recent samples.
Related: How to use Grafana query inspector