This is a simple community-supported Grafana datasource plugin that allows querying time series and log data from Couchbase Clusters, inclding Capella clusters.
Please consult with the ./run.sh
script that is used to launch Grafana with the plugin in a Docker container for the latest instructions on building the plugin.
- Clone this repository
- In
couchbase-datasource
directory, runyarn install && yarn build
- Copy
couchbase-datasource
directory into your Grafanaplugins
directory. - Set the following environment variables (or edit grafana configuration file according to documentation):
- "GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS=couchbase-datasource"
- "GF_PLUGIN_APP_TLS_SKIP_VERIFY_INSECURE=true"
- Restart grafana
- Add a new datasource in configuration and configure it with your cluster information.
The datasource plugin provides two functions for time range filtering:
str_time_range(<fieldname>)
for filtering on RFC3339 datestime_range(<fieldname>)
for filtering on millisecond timestamps
Both functions take the name of the field to be used for filtering. Examples:
select count, time_string from test where str_time_range(time_string)
select count, timestamp from test where time_range(timestamp)
These are pseudo-functions, references to them are replaced with a set of WHERE
filters on provided field by the plugin before the query is sent to the cluster.
Add datasources/couchbase.yaml
with your datasource configuration:
apiVersion: 1
datasources:
- name: Couchbase
type: couchbase-datasource
access: proxy
jsonData:
host: <...>
username: <...>
secureJsonData:
password: <...>
Use ./run.sh
to start grafana in docker container with following mounts:
volumes:
- ./couchbase:/var/lib/grafana/plugins/couchbase
- ./datasources:/etc/grafana/provisioning/datasources
Open grafana at http://localhost:3000, use admin
as both login and password.
You don't need to setup a new password after you login despite grafana asking you to do that -- just reload the page.