MongoDB Configuration
Configuring A MongoDB Data Source In Coordimap
This page explains how to configure the Coordimap agent to crawl a MongoDB deployment. Once configured, Coordimap can discover databases, collections, indexes, and related structure from the target MongoDB environment.
For MongoDB, scope_id should be a replica set or cluster identity when one is available. If the deployment does not expose an immutable identifier, the replica set name is an acceptable but weaker fallback.
Prerequisites
Before you begin, make sure you have:
- Installed the Coordimap agent in an environment that can reach the MongoDB deployment.
- Added the MongoDB data source in the Coordimap UI so you have a
data_source_id. - Prepared MongoDB credentials for a user with read access to the databases you want to crawl.
Find The Correct scope_id
Useful commands when working with replica sets include:
rs.conf()
rs.status()Recommended guidance:
- Prefer a true replica set or cluster identifier if your deployment exposes one.
- Use the replica set name only as a fallback when no immutable ID is available.
- For standalone MongoDB deployments, choose an explicitly configured stable
scope_idand keep reusing it.
Configuration File
coordimap:
api_key: ${COORDIMAP_API_KEY}
data_sources:
- type: mongodb
data_source_id: <YOUR_DATASOURCE_ID_FROM_UI>
config:
- name: scope_id
value: "<MONGODB_REPLICA_SET_OR_CLUSTER_ID>"
- name: db_name
value: "*"
- name: db_host
value: "hostname"
- name: db_user
value: "user"
- name: db_pass
value: ${MONGODB_PASSWORD}
- name: crawl_interval
value: "10m"Configuration Options
| Attribute Name | Required | Description |
|---|---|---|
type | Yes | The data source type. For MongoDB this must be mongodb. |
data_source_id | Yes | The Coordimap data source identifier created in the UI. It identifies the connector record, not the MongoDB deployment identity. |
config.name: scope_id | Yes | Stable upstream identity for the MongoDB deployment. Prefer a replica set or cluster identity. |
config.name: db_name | Yes | The MongoDB database name to connect to. Use * to crawl all available databases when supported. |
config.name: db_host | Yes | Hostname or IP address of the MongoDB deployment. |
config.name: db_user | Yes | MongoDB user used by the agent. |
config.name: db_pass | Yes | Password for the MongoDB user. Prefer an environment variable. |
config.name: crawl_interval | No | How often the agent refreshes the MongoDB inventory. See Shared Configuration Options. |
Why scope_id Matters For MongoDB
MongoDB deployments are often reconfigured, moved, or reconnected through new crawler instances. Reusing the same stable scope_id ensures Coordimap keeps the discovered MongoDB objects attached to the same logical deployment instead of creating duplicates.
Kubernetes Retina Configuration
Install and configure Microsoft Retina in Kubernetes to capture network flow telemetry that powers Coordimap service communication diagrams.
PostgreSQL Configuration
Configure PostgreSQL as a Coordimap data source with the right scope_id, read-only credentials, connection settings, and crawl intervals for stable schema visualization.