Couchbase
Official · maintained by Marmotmarmotdata/couchbase Discover buckets, scopes and collections from Couchbase clusters
The Couchbase plugin discovers buckets, scopes and collections from Couchbase Server and Capella clusters. It 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 (SELECT COUNT(*)) 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.
In the UI
Point-and-click, no config file needed.
- 1 Open Runs Create pipeline
- 2 Pick Couchbase from the plugin list.
- 3 Fill in the wizard, set a schedule, save.
With the CLI
Save a YAML config, then run marmot ingest.
name: my-couchbase-pipeline
runs:
- couchbase:
connection_string: "<connection_string>"
username: "<username>"
password: "***"$ marmot ingest -c ingest.yamlNot using plugins? Other ways to populate Marmot
Configuration
15 top-level fields. * marks required fields.
tags multiselect Tags to apply to discovered assets
external_links object[] External links to show on all assets
name string Display name for the link
icon string Icon identifier for the link
url string URL to the external resource
filter object Filter discovered assets by name (regex)
include multiselect Include patterns for resource names (regex)
exclude multiselect Exclude patterns for resource names (regex)
connection_string string Cluster connection string: couchbase://host, or couchbases://host for TLS (Capella)
username string Username for authentication
password password Password for authentication
bucket string Only discover this bucket (all buckets when empty)
exclude_buckets multiselect Bucket names to skip
- default
- []
include_system_scopes bool Whether to include the _system scope
- default
- false
include_columns bool Whether to infer a document schema by sampling each collection
- default
- true
sample_size int Number of documents to sample per collection for schema inference
- default
- 100
include_indexes bool Whether to include query index information
- default
- true
include_statistics bool Whether to collect document counts and bucket sizes
- default
- true
connect_timeout_seconds int Seconds to wait for the cluster connection
- default
- 10
ssl_skip_verify bool Skip TLS certificate verification for couchbases:// connections
- default
- false
Assets emitted
Metadata this plugin attaches to each discovered asset.
Bucket
CouchbaseBucketFieldsThe metadata fields the Couchbase plugin emits for bucket assets.
bucket_type stringBucket type (couchbase, ephemeral, memcached)
storage_backend stringStorage backend (couchstore, magma)
ram_quota_mb intMemory quota per node in MB
replicas intNumber of replica copies
eviction_policy stringEviction policy (valueOnly, fullEviction, noEviction, nruEviction)
conflict_resolution stringXDCR conflict resolution type (seqno, lww, custom)
max_ttl intMaximum document expiry in seconds, when set
durability_min_level stringMinimum durability level for writes
flush_enabled boolWhether the bucket can be flushed
scope_count intNumber of discovered scopes
collection_count intNumber of discovered collections
item_count intNumber of documents in the bucket
disk_used_bytes intDisk space used by the bucket in bytes
data_used_bytes intSize of the bucket's data in bytes
mem_used_bytes intMemory used by the bucket in bytes
cluster_version stringCouchbase Server version
Collection
CouchbaseCollectionFieldsThe metadata fields the Couchbase plugin emits for collection assets.
bucket stringBucket name
scope stringScope name
collection stringCollection name
max_ttl intMaximum document expiry in seconds, when set
history boolWhether change history retention is enabled
index_count intNumber of query indexes on the collection
indexes string[]Query index names
primary_index boolWhether the collection has a primary index
document_count intNumber of documents in the collection
Column
CouchbaseColumnFieldsThe per-field entries embedded in a collection asset's schema, inferred from sampled documents.
column_name stringField name, with nested fields as parent.child
data_type stringObserved JSON type, joined with | when mixed
is_nullable boolWhether the field is absent from some sampled documents
occurrence floatFraction of sampled documents holding the field