> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/self-managed-enterprise-edition/troubleshooting-and-resources/monitoring/install-grafana.md).

# Install Grafana

### View Metrics on the Grafana Dashboard <a href="#view-metrics-on-the-grafana-dashboard" id="view-metrics-on-the-grafana-dashboard"></a>

To visualize metrics from various sources, you can import and configure Grafana dashboards.

#### Step 1: Configure Grafana Override Values <a href="#step-1-configure-grafana-override-values" id="step-1-configure-grafana-override-values"></a>

Create a file named `override-grafana.yaml` with the following content:

```yaml
grafana:
  resourcesPreset: "small"
image:
  repository: bitnamilegacy/grafana
volumePermissions:
  repository: bitnamilegacy/os-shell
  resourcesPreset: "small"
```

#### Step 2: Install Grafana using Helm <a href="#step-2-install-grafana-using-helm" id="step-2-install-grafana-using-helm"></a>

````
```bash
    helm repo add bitnami https://charts.bitnami.com/bitnami
    helm repo update bitnami
    helm install grafana bitnami/grafana -n grafana --create-namespace -f override-grafana.yaml
```
````

### Open the Grafana Dashboard <a href="#open-the-grafana-dashboard" id="open-the-grafana-dashboard"></a>

Follow these steps to access and set up the Grafana dashboard:

#### Step 1: Decode the Grafana Admin Password <a href="#step-1-decode-the-grafana-admin-password" id="step-1-decode-the-grafana-admin-password"></a>

````
```bash
kubectl get secret --namespace grafana grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo
```

The login username is `admin` by default.
````

#### Step 2: Port-forward the Grafana Service <a href="#step-2-port-forward-the-grafana-service" id="step-2-port-forward-the-grafana-service"></a>

````
```bash
kubectl port-forward svc/grafana -n grafana 8080:3000
```

Once port-forwarded, open [http://localhost:8080](http://localhost:8080) in your browser.
````

#### Step 3: Sign In and Add Prometheus as a Data Source <a href="#step-3-sign-in-and-add-prometheus-as-a-data-source" id="step-3-sign-in-and-add-prometheus-as-a-data-source"></a>

1. Go to **Settings > Data Sources**.
2. Click **Add data source**.

![Add Data Source](/files/VOrt0vnqDD6Empff5nY2)

3. Select **Prometheus** as the data source type.

#### Step 4: Configure Prometheus Connection <a href="#step-4-configure-prometheus-connection" id="step-4-configure-prometheus-connection"></a>

To connect to Prometheus deployed in the same Kubernetes cluster, use kubeDNS to define the Prometheus service address. The format for an incluster prometheus setup is:

```
http://<prometheus-service-name>.<namespace>.svc.cluster.local:<port>
```

For example:

```
http://my-release-kube-prometheus-prometheus.default.svc.cluster.local:9090/
```

{% hint style="warning" %}
Ensure the URL does not have trailing spaces or incorrect characters. Malformed URLs will cause the data source connection test to fail.
{% endhint %}

#### Step 5: Finalize Data Source Setup <a href="#step-5-finalize-data-source-setup" id="step-5-finalize-data-source-setup"></a>

* Set **Prometheus type** and **Prometheus version** as applicable.
* Click **Save & test**. You should see a success message confirming the connection.
