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.
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.
What you need
- Grafana version 7+, self-hosted or otherwise external to Coralogix.
- A Coralogix API key with data-querying permissions.
- Your Coralogix domain endpoints. Select your domain 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.
Go to Connection, then Data sources, and select Add data source.
Select OpenSearch.
Enter the following fields:
- Name: a name for your data source.
- URL: the https://api./data/os-api endpoint for your Coralogix domain.
- Skip TLS certificate verification: select to enable.
- HTTP headers: add a header
Authorizationwith the valueBearer <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 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.
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 guide:
Go to Connection, then Add new connection, and search for Prometheus data source.
Select Add new data source.
Enter the following fields:
Connection
- Prometheus server URL: the https://api./metrics endpoint for your Coralogix domain.
Authentication
- HTTP headers: add a header
Authorizationwith the valueBearer <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
- Prometheus type:
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"