A Grafana datasource plugin for querying and visualizing log data from a CLP API server.
- Node.js >= 22
- Docker (for running the local Grafana instance)
- A running CLP instance
Install the dependencies:
npm clean-installBuild the plugin and start the server:
npm run build
npm run server-
By default, Grafana listens to
0.0.0.0:3000. Openhttp://<GRAFANA_IP>:3000in the browser. -
Connect the datasource to a CLP API server:
- Navigate to Connections > Data sources > CLP on the left side panel.
- Enter the API server URL (e.g.,
http://<CLP_API_SERVER_HOST>:<PORT>). - Click Save & test to verify connectivity.
-
Explore log data:
- Click Explore on the left side panel.
- Configure your query in the query editor:
- Dataset: the dataset to search (defaults to
default). - Query Text: the search query string.
- Ignore Case: whether to perform a case-insensitive search.
- Max Results: the maximum number of results to return.
- Dataset: the dataset to search (defaults to
- Set the desired time range and click Run query in the top right.
- The results will be displayed.
-
Build a dashboard:
- Add a visualization and choose CLP as the datasource.
- Configure your query in the query editor.
- Set the desired time range and click Refresh to run the query.
- To view results in the Logs panel, select the Logs visualization in the top right.
- To enable Grafana log level detection:
- Add an Extract fields transformation and choose JSON as the format.
- Extract the JSON field path for the log level into a field named
severity.
-
Clone the repo into the Grafana plugins directory (usually
/usr/share/grafana/public/app/plugins/datasource/). -
Restart Grafana. You should then be able to set up a new CLP datasource.