> ## Documentation Index
> Fetch the complete documentation index at: https://docs.streamnative.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Monitor Private Cloud

Private Cloud components expose metrics that can be scraped by Prometheus. This page will guide you how to monitor the Private Cloud components with Prometheus and Grafana community chart.

## Provision the Pulsar cluster

Follow the [Quick Start](/private-cloud/v2/quick-start/private-cloud-quickstart) to install the `sn-operator` and provision the Pulsar cluster.

<Note title="Note">
  Make sure that use the same `metadata.name` for each component because this will be used for the label `cloud_streamnative_io_cluster`. For example, if you want to create a cluster called the `pulsar-cluster`, you should use the `pulsar-cluster` as the name for all components and specify at the `metadata.name`.
</Note>

## Install monitoring stacks

### Add helm repo

* Create a namespace for monitoring stacks

```
kubectl create ns monitor
```

* Add prometheus and grafana helm repos

```
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
```

```
helm repo add grafana https://grafana.github.io/helm-charts
```

### Install the Prometheus community chart

```
helm install prometheus prometheus-community/prometheus -n monitor --set alertmanager.enabled=false --set kube-state-metrics.enabled=false --set prometheus-pushgateway.enabled=false
```

<Note title="Note">
  Fow detailed prometheus-community chart configurations, can refer the [configuration](https://github.com/prometheus-community/helm-charts/tree/main/charts/prometheus#configuration).
</Note>

### Install the Grafana chart

```
helm install grafana grafana/grafana -n monitor --set image.repository=streamnative/private-cloud-grafana --set image.tag=0.1.1
```

<Note title="Note">
  Fow detailed Grafana chart configurations, can refer the [configuration](https://github.com/grafana/helm-charts/tree/main/charts/grafana#configuration).
</Note>

### Access the Grafana dashboards

* Expose the Grafana service

```
kubectl expose svc grafana --name grafana-external -n monitor --port 3000 --target-port 3000 --type LoadBalancer
```

* Get the Grafana password

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

* Access the Grafana

```
kubectl get svc -n monitor --field-selector metadata.name=grafana-external
```
