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-
Open Grafana at http://localhost:3000.
-
Connect the datasource to a CLP API server:
- Navigate to Connections > Data sources > CLP.
- Enter the API server URL (e.g.,
http://<CLP_API_SERVER_HOST>:<PORT>). - Click Save & test to verify connectivity.
-
Build a dashboard:
- Add a visualization and choose CLP as the datasource.
- 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 Refresh to run the query.
- To view results in the Logs panel:
- Select the Logs visualization in the top right.
- Add an Extract fields transformation and choose JSON as the format.
- Add a Convert field type transformation to convert your timestamp field to the Time type.
-
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.