| 1 | plugin_name: go.d.plugin |
| 2 | modules: |
| 3 | - meta: |
| 4 | id: collector-go.d.plugin-couchbase |
| 5 | plugin_name: go.d.plugin |
| 6 | module_name: couchbase |
| 7 | monitored_instance: |
| 8 | name: Couchbase |
| 9 | link: https://www.couchbase.com/ |
| 10 | icon_filename: couchbase.svg |
| 11 | categories: |
| 12 | - data-collection.databases |
| 13 | keywords: |
| 14 | - couchbase |
| 15 | - databases |
| 16 | related_resources: |
| 17 | integrations: |
| 18 | list: [] |
| 19 | info_provided_to_referring_integrations: |
| 20 | description: "" |
| 21 | overview: |
| 22 | data_collection: |
| 23 | metrics_description: | |
| 24 | This collector monitors Couchbase servers. |
| 25 | method_description: "" |
| 26 | supported_platforms: |
| 27 | include: [] |
| 28 | exclude: [] |
| 29 | multi_instance: true |
| 30 | additional_permissions: |
| 31 | description: "" |
| 32 | default_behavior: |
| 33 | auto_detection: |
| 34 | description: "" |
| 35 | limits: |
| 36 | description: "" |
| 37 | performance_impact: |
| 38 | description: "" |
| 39 | setup: |
| 40 | prerequisites: |
| 41 | list: [] |
| 42 | configuration: |
| 43 | file: |
| 44 | name: go.d/couchbase.conf |
| 45 | options: |
| 46 | description: | |
| 47 | The following options can be defined globally: update_every, autodetection_retry. |
| 48 | folding: |
| 49 | title: All options |
| 50 | enabled: true |
| 51 | list: |
| 52 | - name: update_every |
| 53 | description: Data collection interval (seconds). |
| 54 | default_value: 5 |
| 55 | required: false |
| 56 | group: Collection |
| 57 | - name: autodetection_retry |
| 58 | description: Autodetection retry interval (seconds). Set 0 to disable. |
| 59 | default_value: 0 |
| 60 | required: false |
| 61 | group: Collection |
| 62 | |
| 63 | - name: url |
| 64 | description: Target endpoint URL. |
| 65 | default_value: http://127.0.0.1:8091 |
| 66 | required: true |
| 67 | group: Target |
| 68 | - name: timeout |
| 69 | description: HTTP request timeout (seconds). |
| 70 | default_value: 1 |
| 71 | required: false |
| 72 | group: Target |
| 73 | |
| 74 | - name: username |
| 75 | description: Username for Basic HTTP authentication. |
| 76 | default_value: "" |
| 77 | required: false |
| 78 | group: HTTP Auth |
| 79 | - name: password |
| 80 | description: Password for Basic HTTP authentication. |
| 81 | default_value: "" |
| 82 | required: false |
| 83 | group: HTTP Auth |
| 84 | - name: bearer_token_file |
| 85 | description: "Path to a file containing a bearer token (used for `Authorization: Bearer`)." |
| 86 | default_value: "" |
| 87 | required: false |
| 88 | group: HTTP Auth |
| 89 | |
| 90 | - name: tls_skip_verify |
| 91 | description: Skip TLS certificate and hostname verification (insecure). |
| 92 | default_value: no |
| 93 | required: false |
| 94 | group: TLS |
| 95 | - name: tls_ca |
| 96 | description: Path to CA bundle used to validate the server certificate. |
| 97 | default_value: "" |
| 98 | required: false |
| 99 | group: TLS |
| 100 | - name: tls_cert |
| 101 | description: Path to client TLS certificate (for mTLS). |
| 102 | default_value: "" |
| 103 | required: false |
| 104 | group: TLS |
| 105 | - name: tls_key |
| 106 | description: Path to client TLS private key (for mTLS). |
| 107 | default_value: "" |
| 108 | required: false |
| 109 | group: TLS |
| 110 | |
| 111 | - name: proxy_url |
| 112 | description: HTTP proxy URL. |
| 113 | default_value: "" |
| 114 | required: false |
| 115 | group: Proxy |
| 116 | - name: proxy_username |
| 117 | description: Username for proxy Basic HTTP authentication. |
| 118 | default_value: "" |
| 119 | required: false |
| 120 | group: Proxy |
| 121 | - name: proxy_password |
| 122 | description: Password for proxy Basic HTTP authentication. |
| 123 | default_value: "" |
| 124 | required: false |
| 125 | group: Proxy |
| 126 | |
| 127 | - name: method |
| 128 | description: HTTP method to use. |
| 129 | default_value: "GET" |
| 130 | required: false |
| 131 | group: Request |
| 132 | - name: body |
| 133 | description: Request body (e.g., for POST/PUT). |
| 134 | default_value: "" |
| 135 | required: false |
| 136 | group: Request |
| 137 | - name: headers |
| 138 | description: "Additional HTTP headers (one per line as key: value)." |
| 139 | default_value: "" |
| 140 | required: false |
| 141 | group: Request |
| 142 | - name: not_follow_redirects |
| 143 | description: Do not follow HTTP redirects. |
| 144 | default_value: no |
| 145 | required: false |
| 146 | group: Request |
| 147 | - name: force_http2 |
| 148 | description: Force HTTP/2 (including h2c over TCP). |
| 149 | default_value: no |
| 150 | required: false |
| 151 | group: Request |
| 152 | |
| 153 | - name: functions.top_queries.disabled |
| 154 | description: Disable the [top-queries](#top-queries) function. |
| 155 | default_value: false |
| 156 | required: false |
| 157 | group: Functions |
| 158 | - name: functions.top_queries.timeout |
| 159 | description: Query timeout (seconds). Uses collector timeout if not set. |
| 160 | default_value: "" |
| 161 | required: false |
| 162 | group: Functions |
| 163 | - name: functions.top_queries.limit |
| 164 | description: Maximum number of queries to return. |
| 165 | default_value: 500 |
| 166 | required: false |
| 167 | group: Functions |
| 168 | |
| 169 | - name: vnode |
| 170 | description: Associates this data collection job with a [Virtual Node](https://learn.netdata.cloud/docs/netdata-agent/configuration/organize-systems-metrics-and-alerts#virtual-nodes). |
| 171 | default_value: "" |
| 172 | required: false |
| 173 | group: Virtual Node |
| 174 | examples: |
| 175 | folding: |
| 176 | title: Config |
| 177 | enabled: true |
| 178 | list: |
| 179 | - name: Basic |
| 180 | description: An example configuration. |
| 181 | config: | |
| 182 | jobs: |
| 183 | - name: local |
| 184 | url: http://127.0.0.1:8091 |
| 185 | - name: Basic HTTP auth |
| 186 | description: Local server with basic HTTP authentication. |
| 187 | config: | |
| 188 | jobs: |
| 189 | - name: local |
| 190 | url: http://127.0.0.1:8091 |
| 191 | username: foo |
| 192 | password: bar |
| 193 | - name: Multi-instance |
| 194 | description: | |
| 195 | > **Note**: When you define multiple jobs, their names must be unique. |
| 196 | |
| 197 | Collecting metrics from local and remote instances. |
| 198 | config: | |
| 199 | jobs: |
| 200 | - name: local |
| 201 | url: http://127.0.0.1:8091 |
| 202 | |
| 203 | - name: remote |
| 204 | url: http://203.0.113.0:8091 |
| 205 | troubleshooting: |
| 206 | problems: |
| 207 | list: [] |
| 208 | alerts: [] |
| 209 | functions: |
| 210 | description: | |
| 211 | This collector exposes real-time functions for interactive troubleshooting in the Live tab. |
| 212 | list: |
| 213 | - id: top-queries |
| 214 | name: Top Queries |
| 215 | description: | |
| 216 | Retrieves completed N1QL query statistics from Couchbase [system:completed_requests](https://docs.couchbase.com/server/current/manage/monitor/monitoring-n1ql-query.html#sys-completed-req) keyspace. |
| 217 | |
| 218 | This function queries the `system:completed_requests` keyspace which stores information about recently completed N1QL requests. It provides timing metrics, result statistics, and error/warning counts for each completed query. |
| 219 | |
| 220 | Use cases: |
| 221 | - Identify slow N1QL queries consuming the most elapsed time |
| 222 | - Find queries with high error or warning counts |
| 223 | - Analyze query patterns by user to understand workload distribution |
| 224 | |
| 225 | Statement text is truncated at 4096 characters for display purposes. |
| 226 | parameters: |
| 227 | - id: __sort |
| 228 | name: Filter By |
| 229 | description: Select the primary sort column. Options include elapsed time, service time, request time, and result count. Defaults to elapsed time to focus on slowest queries. |
| 230 | type: select |
| 231 | required: true |
| 232 | default: elapsedTime |
| 233 | options: [] |
| 234 | returns: |
| 235 | description: Completed N1QL request statistics. Each row represents a single completed query with its timing and result metrics. |
| 236 | columns: |
| 237 | - name: Request ID |
| 238 | type: string |
| 239 | unit: "" |
| 240 | visibility: hidden |
| 241 | description: "Unique identifier for the N1QL request. Can be used for correlation with Couchbase logs." |
| 242 | - name: Request Time |
| 243 | type: timestamp |
| 244 | unit: "" |
| 245 | description: "Timestamp when the request was received by the query service." |
| 246 | - name: Statement |
| 247 | type: string |
| 248 | unit: "" |
| 249 | description: "The N1QL statement that was executed. Truncated to 4096 characters." |
| 250 | - name: Elapsed Time |
| 251 | type: duration |
| 252 | unit: "milliseconds" |
| 253 | description: "Total time from request receipt to response completion, including queue time, planning, execution, and result streaming." |
| 254 | - name: Service Time |
| 255 | type: duration |
| 256 | unit: "milliseconds" |
| 257 | description: "Time spent actively processing the request, excluding network latency and queue wait time. Compare with elapsed time to identify network or queueing delays." |
| 258 | - name: Result Count |
| 259 | type: integer |
| 260 | unit: "" |
| 261 | description: "Number of documents/rows returned by the query. High values may indicate queries returning excessive data." |
| 262 | - name: Result Size |
| 263 | type: integer |
| 264 | unit: "" |
| 265 | visibility: hidden |
| 266 | description: "Total size of the result set in bytes. Large result sizes may indicate inefficient queries or missing projections." |
| 267 | - name: Error Count |
| 268 | type: integer |
| 269 | unit: "" |
| 270 | visibility: hidden |
| 271 | description: "Number of errors encountered during query execution. Non-zero values require investigation." |
| 272 | - name: Warning Count |
| 273 | type: integer |
| 274 | unit: "" |
| 275 | visibility: hidden |
| 276 | description: "Number of warnings generated during query execution. Warnings may indicate suboptimal query patterns or index usage." |
| 277 | - name: User |
| 278 | type: string |
| 279 | unit: "" |
| 280 | description: "Couchbase user who executed the query. Useful for identifying workload by user or application." |
| 281 | - name: Client Context ID |
| 282 | type: string |
| 283 | unit: "" |
| 284 | visibility: hidden |
| 285 | description: "Client-provided context identifier for request tracking and correlation." |
| 286 | performance: | |
| 287 | Queries `system:completed_requests` via the N1QL query service:<br/>• The `completed_requests` keyspace has a configurable size limit (`completed-limit` setting)<br/>• Default limit of 500 rows balances usefulness with performance |
| 288 | security: | |
| 289 | Query text may contain unmasked literal values including potentially sensitive data:<br/>• Personal information in WHERE clauses or INSERT values<br/>• Business data embedded in queries<br/>• Access should be restricted to authorized personnel only |
| 290 | prerequisites: |
| 291 | list: |
| 292 | - title: Grant access to `system:completed_requests` |
| 293 | description: | |
| 294 | The user must have appropriate privileges to query system keyspaces and the N1QL service must be available. |
| 295 | |
| 296 | 1. Ensure the N1QL (Query) service is running on the cluster |
| 297 | |
| 298 | 2. Grant query system catalog privileges to the monitoring user: |
| 299 | |
| 300 | ```sql |
| 301 | GRANT QUERY_SYSTEM_CATALOG TO netdata_user; |
| 302 | ``` |
| 303 | |
| 304 | 3. Verify access to `completed_requests`: |
| 305 | |
| 306 | ```sql |
| 307 | SELECT * FROM system:completed_requests LIMIT 1; |
| 308 | ``` |
| 309 | |
| 310 | :::info |
| 311 | |
| 312 | - The `system:completed_requests` keyspace stores recently completed queries based on Couchbase server settings `completed-limit` and `completed-threshold` |
| 313 | - Only queries exceeding `completed-threshold` (default 1000ms) are logged to `completed_requests` |
| 314 | - Adjust `completed-threshold` in Couchbase Query Settings to capture faster queries if needed |
| 315 | |
| 316 | ::: |
| 317 | availability: | |
| 318 | Available when:<br/>• The collector has successfully connected to Couchbase<br/>• The N1QL (Query) service is running<br/>• Returns HTTP 503 if collector is still initializing<br/>• Returns HTTP 500 if the query fails<br/>• Returns HTTP 504 if the query times out |
| 319 | require_cloud: true |
| 320 | metrics: |
| 321 | folding: |
| 322 | title: Metrics |
| 323 | enabled: false |
| 324 | description: "" |
| 325 | availability: [] |
| 326 | scopes: |
| 327 | - name: global |
| 328 | description: These metrics refer to the entire monitored application. |
| 329 | labels: [] |
| 330 | metrics: |
| 331 | - name: couchbase.bucket_quota_percent_used |
| 332 | description: Quota Percent Used Per Bucket |
| 333 | unit: percentage |
| 334 | chart_type: line |
| 335 | dimensions: |
| 336 | - name: a dimension per bucket |
| 337 | - name: couchbase.bucket_ops_per_sec |
| 338 | description: Operations Per Second Per Bucket |
| 339 | unit: ops/s |
| 340 | chart_type: stacked |
| 341 | dimensions: |
| 342 | - name: a dimension per bucket |
| 343 | - name: couchbase.bucket_disk_fetches |
| 344 | description: Disk Fetches Per Bucket |
| 345 | unit: fetches |
| 346 | chart_type: stacked |
| 347 | dimensions: |
| 348 | - name: a dimension per bucket |
| 349 | - name: couchbase.bucket_item_count |
| 350 | description: Item Count Per Bucket |
| 351 | unit: items |
| 352 | chart_type: stacked |
| 353 | dimensions: |
| 354 | - name: a dimension per bucket |
| 355 | - name: couchbase.bucket_disk_used_stats |
| 356 | description: Disk Used Per Bucket |
| 357 | unit: bytes |
| 358 | chart_type: stacked |
| 359 | dimensions: |
| 360 | - name: a dimension per bucket |
| 361 | - name: couchbase.bucket_data_used |
| 362 | description: Data Used Per Bucket |
| 363 | unit: bytes |
| 364 | chart_type: stacked |
| 365 | dimensions: |
| 366 | - name: a dimension per bucket |
| 367 | - name: couchbase.bucket_mem_used |
| 368 | description: Memory Used Per Bucket |
| 369 | unit: bytes |
| 370 | chart_type: stacked |
| 371 | dimensions: |
| 372 | - name: a dimension per bucket |
| 373 | - name: couchbase.bucket_vb_active_num_non_resident |
| 374 | description: Number Of Non-Resident Items Per Bucket |
| 375 | unit: items |
| 376 | chart_type: stacked |
| 377 | dimensions: |
| 378 | - name: a dimension per bucket |