---
title: Charmhub | Deploy Opensearch Dashboards using Charmhub - The Open Operator
  Collection
description: Deploy the latest version of Opensearch Dashboards as a Kubernetes Operator
  on any cloud.
url: https://charmhub.io/opensearch-dashboards-k8s/docs/h-monitoring-enable
---

# Opensearch Dashboards

[Canonical](https://charmhub.io/publisher/canonical "View all packages from Canonical")

* [Canonical](https://charmhub.io/publisher/canonical "View all packages from Canonical")

Platform:

2/edge 11

```
juju deploy opensearch-dashboards-k8s --channel 2/edge
```

[Learn to deploy on juju >](https://juju.is/docs/juju/manage-applications)

---

#### Contacts

##### Maintainers

+ [Canonical Data Platform Team](mailto:data-platform@lists.launchpad.net)

* [Submit a bug](https://github.com/canonical/opensearch-dashboards-operator/issues)

---

Share your thoughts on this charm with the community on discourse.

[Join the discussion](https://discourse.charmhub.io/)

# How to enable monitoring (COS)

All commands are written for juju >= v.3.1.7

## [Prerequisites](https://charmhub.io/opensearch-dashboards-k8s/docs/h-monitoring-enable#p-32774-prerequisites)

* A deployed [Charmed OpenSearch operator with a Charmed Opensearch Dashboards operator](https://charmhub.io/opensearch-dashboards-k8s/docs/t-deploy)
* A deployed [`cos-lite` bundle in a Kubernetes environment](https://charmhub.io/topics/canonical-observability-stack/tutorials/install-microk8s)

## [Summary](https://charmhub.io/opensearch-dashboards-k8s/docs/h-monitoring-enable#p-32774-summary)

* [Offer interfaces via the COS controller](https://charmhub.io/opensearch-dashboards-k8s/docs/h-monitoring-enable#offer-interfaces-via-the-cos-controller)
* [Consume offers via the OpenSearch model](https://charmhub.io/opensearch-dashboards-k8s/docs/h-monitoring-enable#consume-offers-via-the-opensearch-model)
* [Deploy and integrate Grafana](https://charmhub.io/opensearch-dashboards-k8s/docs/h-monitoring-enable#deploy-and-integrate-grafana)
* [Connect to the Grafana web interface](https://charmhub.io/opensearch-dashboards-k8s/docs/h-monitoring-enable#connect-to-the-grafana-web-interface)

---

## [Offer interfaces via the COS controller](https://charmhub.io/opensearch-dashboards-k8s/docs/h-monitoring-enable#p-32774-offer-interfaces-via-the-cos-controller)

First, we will switch to the COS K8s environment and offer COS interfaces to be cross-model integrated with the Charmed OpenSearch model.

To switch to the Kubernetes controller for the COS model, run

```
juju switch <k8s_cos_controller>:<cos_model_name>
```

To offer the COS interfaces, run

```
juju offer grafana:grafana-dashboard
juju offer loki:logging
juju offer prometheus:receive-remote-write
```

## [Consume offers via the OpenSearch Dashboards model](https://charmhub.io/opensearch-dashboards-k8s/docs/h-monitoring-enable#p-32774-consume-offers-via-the-opensearch-dashboards-model)

Next, we will switch to the Charmed OpenSearch Dashboards model, find offers, and consume them.

We are currently on the Kubernetes controller for the COS model. To switch to the OpenSearch Dashboards model, run

```
juju switch <db_controller>:<opensearch_dashboards_model_name>
```

To consume offers to be reachable in the current model, run

```
juju consume <k8s_cos_controller>:admin/cos.grafana
juju consume <k8s_cos_controller>:admin/cos.loki
juju consume <k8s_cos_controller>:admin/cos.prometheus
```

## [Deploy and integrate Grafana](https://charmhub.io/opensearch-dashboards-k8s/docs/h-monitoring-enable#p-32774-deploy-and-integrate-grafana)

First, deploy [grafana-agent](https://charmhub.io/grafana-agent):

```
juju deploy grafana-agent
```

Then integrate `grafana-agent` with consumed COS offers:

```
juju integrate grafana-agent grafana
juju integrate grafana-agent loki
juju integrate grafana-agent prometheus
```

Finally integrate (previously known as “[relate](https://juju.is/docs/juju/integration)”) it with Charmed OpenSearch Dashboards:

```
juju integrate grafana-agent-k8s opensearch-dashboards
```

After the integration is complete, Grafana will show the new dashboard `Charmed OpenSearch Dashboards` and will allow access to Charmed OpenSearch Dashboards logs on Loki.

## [Connect to the Grafana web interface](https://charmhub.io/opensearch-dashboards-k8s/docs/h-monitoring-enable#p-32774-connect-to-the-grafana-web-interface)

To connect to the Grafana web interface, follow the [Browse dashboards](https://charmhub.io/topics/canonical-observability-stack/tutorials/install-microk8s?_ga=2.201254254.1948444620.1704703837-757109492.1701777558#heading--browse-dashboards) section of the MicroK8s “Getting started” guide.

You can obtain the admin password as follows:

```
juju run grafana/leader get-admin-password --model <k8s_cos_controller>:<cos_model_name>
```

---
