# Grafana plugin

Copy as Markdown[Open in ChatGPT](https://chatgpt.com/?q=Read%20https%3A%2F%2Fcoralogix.com%2Fdocs%2Fuser-guides%2Fvisualizations%2Fgrafana-plugin.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)[Open in Claude](https://claude.ai/new?q=Read%20https%3A%2F%2Fcoralogix.com%2Fdocs%2Fuser-guides%2Fvisualizations%2Fgrafana-plugin.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)

Connect an external Grafana to Coralogix to visualize your logs and metrics with familiar Grafana functions. Add Coralogix as an **OpenSearch** data source for logs, and as a **Prometheus** data source for metrics using PromQL.

Note

The OpenSearch data source queries your Frequent Search data. It cannot query data in your Archive.

For a Coralogix-managed Grafana that needs no data source setup, see [Hosted Grafana](https://coralogix.com/docs/user-guides/visualizations/hosted-grafana-view.md).

## What you need[​](#what-you-need "Direct link to What you need")

* **Grafana version 7+**, self-hosted or otherwise external to Coralogix.
* A Coralogix [API key](https://coralogix.com/docs/user-guides/account-management/api-keys/api-keys.md) with data-querying permissions.
* Your Coralogix domain endpoints. Select your [domain](https://coralogix.com/docs/user-guides/account-management/account-settings/coralogix-domain.md) in the selector at the top of this page to populate the endpoints in the steps below.

## Connect your logs[​](#connect-your-logs "Direct link to Connect your logs")

Add Coralogix as an OpenSearch data source to query your Frequent Search logs.

1

<!-- -->

.

Go to **Connection**, then **Data sources**, and select **Add data source**.

2

<!-- -->

.

Select **OpenSearch**.

3

<!-- -->

.

Enter the following fields:

* **Name**: a name for your data source.
* **URL**: the
  <!-- -->
  https\://api./data/os-api
  <!-- -->
  endpoint for your Coralogix [domain](https://coralogix.com/docs/user-guides/account-management/account-settings/coralogix-domain.md).
* **Skip TLS certificate verification**: select to enable.
* **HTTP headers**: add a header `Authorization` with the value `Bearer <cx_api_key>`.
* **Index name**: `*`
* **Pattern**: `No pattern`
* **Time field name**: `coralogix.timestamp`

The OpenSearch data source needs the **Query frequent-search logs** permission (`LOGS.DATA-API#HIGH:READDATA`). You can add this [permission](https://coralogix.com/docs/user-guides/account-management/api-keys/api-keys.md) on its own, or apply the **DataQuerying** preset, which includes it and stays current automatically. The preset also grants archive, metrics, and span query permissions that this data source does not use.

4

<!-- -->

.

Select **Save & test** to confirm the connection.

## Connect your metrics[​](#connect-your-metrics "Direct link to Connect your metrics")

Query your metric data with PromQL, a widely used time-series query language. Add Coralogix as a Prometheus data source to use Coralogix as your metrics backend and keep your existing dashboards and queries unchanged.

Follow Grafana's [Configure a Prometheus data source](https://grafana.com/docs/grafana/latest/datasources/prometheus/) guide:

1

<!-- -->

.

Go to **Connection**, then **Add new connection**, and search for **Prometheus data source**.

2

<!-- -->

.

Select **Add new data source**.

3

<!-- -->

.

Enter the following fields:

**Connection**

* **Prometheus server URL**: the
  <!-- -->
  https\://api./metrics
  <!-- -->
  endpoint for your Coralogix [domain](https://coralogix.com/docs/user-guides/account-management/account-settings/coralogix-domain.md).

**Authentication**

* **HTTP headers**: add a header `Authorization` with the value `Bearer <cx_api_key>`. This key needs the **Query metrics** permission (`METRICS.DATA-API#HIGH:READDATA`).

**Advanced settings**

* **Performance**:

  <!-- -->

  * **Prometheus type**: `Prometheus`
  * **Prometheus version**: `2.24.x`

4

<!-- -->

.

Select **Save & test** to confirm the connection.

## Manage Grafana in Docker[​](#manage-grafana-in-docker "Direct link to Manage Grafana in Docker")

If you run Grafana in a Docker container, use these commands:

* List all containers:

```
docker ps -a
```

* Open a shell in your Grafana container:

```
sudo docker exec -it "Grafana container ID" /bin/bash
```

* Restart Grafana:

```
docker restart "Grafana container ID"
```

## Related resources[​](#related-resources "Direct link to Related resources")

* [Coralogix endpoints](https://coralogix.com/docs/integrations/coralogix-endpoints.md)
