Collection of Grafana Dashboards for the Couchbase Query Service.
The dashboards leverage the Grafana plugin JSON API Datasource from Marcus Olsson by calling the Query Service REST API
Once the JSON API is installed, a datasource will need to be configured for each of the Couchbase Nodes running the Query Service.
- In Grafana, navigate to
Data Sources
and selectAdd data source
- From the list of data-sources select
JSON API
- Enter a name for the datasource, this can be whatever you prefer. A suggestion for multiple clusters might be
Name of Cluster - node hostname
- In the
URL
field enterhttp://HOSTNAME:8093
- If you are using SSL, enter
https://HOSTNAME:18093
- Replace
HOSTNAME
with the configured hostname or IP address
- In the "Auth" section check
Basic Auth
andWith Credentials
- If using SSL, check
Skip TLS Verify
- Enter an RBAC Username and Password. Note that the RBAC user must have access to
Query System Catalogs
- Select the
Save & Test
button, note that you will get an error that saysJSON API: Not Found
, this can be ignored as the datasource is saved. This is due to no endpoints being configured as they are configured in the dashboards themselves.
Repeat this process for each query node that you wish to configure. By default each of the dashboards is setup with variable for the $datasource
that will automatically show a list of each datasource configured using the JSON API Datasource plugin.
The dashboards can be imported into Grafana, by navigating to Manage Dashboards
and selecting the Import
option. The dashboard json can be copied and pasted directly into the UI or uploaded.
The slow queries dashboard will query and display information from the system:completed_requests
keyspace. Many of these queries are adapted from the Couchbase Connect Online: Identifying and Tuning Slow Queries Presentation. While the system:completed_requests
keyspace is global, the N1QL queries performed by the dashboard are limited in scope to a single query node for minimal impact and performance.
- Datasource
- User (default: All)
- Limit (default: 25)
- Count of Slow Queries
- Sum of Slow Query Fetches
- Sum of Slow Query Response Bytes
- Total Queries by User
- Query Selectivity Percentile Breakdown
- Elapsed Time Percentile Breakdown
- Count of Slow Queries using Primary Index
- Count of Slow Queries with Errors
- Recent Slow Queries
- Most Common Slow Queries
- Low Selectivity Queries
- Longest Running Queries
- Highest Cost Queries
- Primary Index Queries
- Queries with Errors
The prepared statements dashboard will query and display information from the system:prepareds
keyspace. While the system:prepareds
keyspace is global, the N1QL queries performed by the dashboard are limited in scope to a single query node for minimal impact and performance.
- Datasource
- Limit (default: 100)
- Count of Prepared Statements
- Count of Un-Used Prepared Statements
- Avg. # of Uses per Prepared
- Avg. Elapsed Time for Prepared Execution
- Slowest Prepared Statements
- Most Used Prepared Statements
- Most Recently Used Prepared Statements
- Un-Used Prepared Statements