Skip to main content
Version: Preview

Couchbase

Experimental
Creates:
AssetsLineage

Configure in the UI

This plugin can be configured directly in the Marmot UI with a step-by-step wizard.

View Guide

The Couchbase plugin discovers buckets, scopes and collections from Couchbase Server and Capella clusters. Each bucket becomes a Bucket asset and each collection a Collection asset named bucket.scope.collection, linked by CONTAINS lineage. The plugin infers a document schema by sampling each collection, records query indexes and collects document counts and bucket sizes.

Required Permissions

Discovery needs a user that can list buckets, scopes and collections, run read-only N1QL queries (SELECT, INFER, system:indexes) and read bucket statistics from the management API on port 8091 (18091 for couchbases://).

On Community Edition, bucket_full_access on the buckets to catalog is enough:

couchbase-cli user-manage -c localhost -u Administrator -p password --set \
--rbac-username marmot_reader --rbac-password your-password \
--roles 'bucket_full_access[*]' --auth-domain local

On Enterprise Edition and Capella, grant query_select on those buckets, query_system_catalog for the index listing, and a role that can read bucket settings and statistics, such as ro_admin.

Indexes and Sampling

Sampling reads documents through the query service, which needs a primary index or, on Couchbase Server 7.6 and later, a sequential scan. Collections without one fall back to INFER, which samples through the data service and needs no index. Document counts are skipped when no index can answer them; on a bucket with a single collection the bucket's item count stands in. Data previews always need a primary index on the collection.

Example Configuration


connection_string: "couchbases://cb.abc123.cloud.couchbase.com"
username: "marmot_reader"
password: "couchbase_pass_789"
bucket: "travel-sample"
include_columns: true
sample_size: 100
include_indexes: true
include_statistics: true
tags:
- "couchbase"
- "travel"

Configuration

The following configuration options are available:

PropertyTypeRequiredDescription
bucketstringfalseOnly discover this bucket (all buckets when empty)
connect_timeout_secondsintfalseSeconds to wait for the cluster connection
connection_stringstringtrueCluster connection string: couchbase://host, or couchbases://host for TLS (Capella)
exclude_buckets[]stringfalseBucket names to skip
external_links[]ExternalLinkfalseExternal links to show on all assets
filterFilterfalseFilter discovered assets by name (regex)
include_columnsboolfalseWhether to infer a document schema by sampling each collection
include_indexesboolfalseWhether to include query index information
include_statisticsboolfalseWhether to collect document counts and bucket sizes
include_system_scopesboolfalseWhether to include the _system scope
passwordstringtruePassword for authentication
sample_sizeintfalseNumber of documents to sample per collection for schema inference
ssl_skip_verifyboolfalseSkip TLS certificate verification for couchbases:// connections
tagsTagsConfigfalseTags to apply to discovered assets
usernamestringtrueUsername for authentication

Available Metadata

The following metadata fields are available:

FieldTypeDescription
bucketstringBucket name
bucket_typestringBucket type (couchbase, ephemeral, memcached)
cluster_versionstringCouchbase Server version
collectionstringCollection name
collection_countintNumber of discovered collections
column_namestringField name, with nested fields as parent.child
conflict_resolutionstringXDCR conflict resolution type (seqno, lww, custom)
data_typestringObserved JSON type, joined with | when mixed
data_used_bytesint64Size of the bucket's data in bytes
disk_used_bytesint64Disk space used by the bucket in bytes
document_countint64Number of documents in the collection
durability_min_levelstringMinimum durability level for writes
eviction_policystringEviction policy (valueOnly, fullEviction, noEviction, nruEviction)
flush_enabledboolWhether the bucket can be flushed
historyboolWhether change history retention is enabled
index_countintNumber of query indexes on the collection
indexes[]stringQuery index names
is_nullableboolWhether the field is absent from some sampled documents
item_countint64Number of documents in the bucket
max_ttlint64Maximum document expiry in seconds, when set
mem_used_bytesint64Memory used by the bucket in bytes
occurrencefloat64Fraction of sampled documents holding the field
primary_indexboolWhether the collection has a primary index
ram_quota_mbint64Memory quota per node in MB
replicasintNumber of replica copies
scopestringScope name
scope_countintNumber of discovered scopes
storage_backendstringStorage backend (couchstore, magma)