---
title: Grafana plugin
description: Add Coralogix as an OpenSearch and Prometheus data source in an external Grafana to visualize your Frequent Search logs and query your metrics with PromQL.
url: https://coralogix.com/docs/user-guides/visualizations/grafana-plugin/
product: data-exploration
feature: Grafana
feature_id: grafana
feature_identifier: data-exploration/grafana
last_updated: '2026-10-26'
---

# Grafana plugin

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

* Grafana queries Coralogix through the OpenSearch data source (logs, queried with Lucene) and the Prometheus data source (metrics, queried with PromQL). DataPrime is not available in Grafana; to query with DataPrime, use [Explore](https://coralogix.com/docs/user-guides/data_exploration.md).
* The OpenSearch data source queries your Frequent Search data; it cannot query your Archive.
* Queries sent through the OpenSearch data source reach your data without passing through the Coralogix query engine, so the [`$l` and `$m` field aliases](https://coralogix.com/docs/dataprime/language-reference/access_mechanisms.md#canonical-names-and-accepted-aliases) aren't resolved there. Use the field names and match semantics of the underlying store.

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

* **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 the **DataQuerying** preset (or the specific query permissions listed in the steps below). The key is passed as a `Bearer` token in each data source's `Authorization` header.
* 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

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

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

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

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