Mongodbatlas Receiver
contrib
Maintainers: @justinianvoss22, @dyl10s, @ishleenk17
Source: opentelemetry-collector-contrib
Supported Telemetry
Overview
Getting Started
The MongoDB Atlas receiver takes the following parameters.public_key and
private_key are the only two required values to receive metrics and logs and are obtained via the
“API Keys” tab of the MongoDB Atlas Project Access Manager. In the example
below both values are being pulled from the environment.
In order to collect logs, at least one project must be specified. By default, logs for all clusters within a project will be collected. Clusters can be limited using either the include_clusters or exclude_clusters setting.
In order to collect project events, the requesting API key needs the appropriate permission which at minimum is the Project Read Only role. Project events are specific to a single project.
In order to collect organization events, the requesting API key needs the appropriate permission which at minimum is the Organization Member role. Organization events are collected across all the projects hosted on Atlas within the organization. These events are not associated with a project.
In order to collect access logs, the requesting API key needs the appropriate permission which requires either the Project Owner or Organization Owner role. Access logs are specific to each cluster.
MongoDB Atlas Documentation recommends a polling interval of 5 minutes.
base_url(default https://cloud.mongodb.com/) set the base URL to connect to Atlas Cloudpublic_key(required for metrics, logs, or alerts inpollmode)private_key(required for metrics, logs, or alerts inpollmode)granularity(defaultPT1M- See MongoDB Atlas Documentation)collection_interval(default3m) This receiver collects metrics on an interval. Valid time units arens,us(orµs),ms,s,m,h.storage(optional) The component ID of a storage extension which can be used when polling foralertsorevents. The storage extension prevents duplication of data after a collector restart by remembering which data were previously collected.projects(optional for metrics) a slice of projects this receiver collects metrics from instead of all projects in an organizationnameName of the project to discover metrics frominclude_clusters(default empty, exclusive withexclude_clusters)exclude_clusters(default empty, exclusive withinclude_clusters)- If both
include_clustersandexclude_clustersare empty, then all clusters in the project will be included
- If both
retry_on_failureenabled(default true)initial_interval(default 5s)max_interval(default 30s)max_elapsed_time(default 5m)
alertsenabled(default false)mode(defaultlisten. Options arepollorlisten)secret(required if usinglistenmode)endpoint(required if usinglistenmode)poll_interval(default5m, only relevant usingpollmode)page_size(default100)- When in
pollmode, this is the number of alerts that will be processed per request to the MongoDB Atlas API.
- When in
max_pages(default10)- When in
pollmode, this will limit how many pages of alerts the receiver will request for each project.
- When in
projects(required if usingpollmode)name(required if usingpoll mode)include_clusters(default empty, exclusive withexclude_clusters)exclude_clusters(default empty, exclusive withinclude_clusters)- If both
include_clustersandexclude_clustersare empty, then all clusters in the project will be included
- If both
tls(relevant only forlistenmode)key_filecert_file
logsenabled(default false)projects(required if enabled)name(required if enabled)collect_host_logs(default true)collect_audit_logs(default false)- Audit logging must be enabled for your MongoDB Atlas project in order to scrape audit logs.
access_logsenabled(default true, if theaccess_logsparameter is defined)auth_result- If specified, will limit the access logs queried to successful accesses (true) or failed accesses (false). If not specified, all will be collected
page_size(default20000)- This is the number of access logs that will be processed per request to the MongoDB Atlas API. The maximum value is 20000.
max_pages(default10)- This will limit how many pages of access logs the receiver will request from the MongoDB Atlas API for a project.
poll_interval(default5m)- This will define how frequently the MongoDB Atlas API is queried for Access Logs for the given project.
include_clusters(default empty)exclude_clusters(default empty)
eventsprojectsnameName of the Project to discover events from.
organizationsidID of the Organization to discover events from.
poll_interval(default1m)- How often the receiver will poll the Events API for new events.
page_size(default100)- This is the number of events that will be processed per request to the MongoDB Atlas API.
max_pages(default25)- This will limit how many pages of events the receiver will request from the MongoDB Atlas API for each project.
types(defaults to all types of events)- This is a list of event types that the receiver will request from the API. If specified, the receiver will collect only the indicated types of events.
Metrics
| Metric Name | Description | Unit | Type | Attributes |
|---|---|---|---|---|
✅ mongodbatlas.db.counts | Database feature size | {objects} | Gauge | object_type |
✅ mongodbatlas.db.size | Database feature size | By | Gauge | object_type |
✅ mongodbatlas.disk.partition.iops.average | Disk partition iops | {ops}/s | Gauge | disk_direction |
✅ mongodbatlas.disk.partition.iops.max | Disk partition iops | {ops}/s | Gauge | disk_direction |
✅ mongodbatlas.disk.partition.latency.average | Disk partition latency | ms | Gauge | disk_direction |
✅ mongodbatlas.disk.partition.latency.max | Disk partition latency | ms | Gauge | disk_direction |
❌ mongodbatlas.disk.partition.queue.depth | Disk queue depth | 1 | Gauge | |
✅ mongodbatlas.disk.partition.space.average | Disk partition space | By | Gauge | disk_status |
✅ mongodbatlas.disk.partition.space.max | Disk partition space | By | Gauge | disk_status |
❌ mongodbatlas.disk.partition.throughput | Disk throughput | By/s | Gauge | disk_direction |
✅ mongodbatlas.disk.partition.usage.average | Disk partition usage (%) | 1 | Gauge | disk_status |
✅ mongodbatlas.disk.partition.usage.max | Disk partition usage (%) | 1 | Gauge | disk_status |
✅ mongodbatlas.disk.partition.utilization.average | The percentage of time during which requests are being issued to and serviced by the partition. | 1 | Gauge | |
✅ mongodbatlas.disk.partition.utilization.max | The maximum percentage of time during which requests are being issued to and serviced by the partition. | 1 | Gauge | |
✅ mongodbatlas.process.asserts | Number of assertions per second | {assertions}/s | Gauge | assert_type |
✅ mongodbatlas.process.background_flush | Amount of data flushed in the background | 1 | Gauge | |
✅ mongodbatlas.process.cache.io | Cache throughput (per second) | By | Gauge | cache_direction |
❌ mongodbatlas.process.cache.ratio | Cache ratios represented as (%) | % | Gauge | cache_ratio_type |
✅ mongodbatlas.process.cache.size | Cache sizes | By | UpDownCounter | cache_status |
✅ mongodbatlas.process.connections | Number of current connections | {connections} | UpDownCounter | |
✅ mongodbatlas.process.cpu.children.normalized.usage.average | CPU Usage for child processes, normalized to pct | 1 | Gauge | cpu_state |
✅ mongodbatlas.process.cpu.children.normalized.usage.max | CPU Usage for child processes, normalized to pct | 1 | Gauge | cpu_state |
✅ mongodbatlas.process.cpu.children.usage.average | CPU Usage for child processes (%) | 1 | Gauge | cpu_state |
✅ mongodbatlas.process.cpu.children.usage.max | CPU Usage for child processes (%) | 1 | Gauge | cpu_state |
✅ mongodbatlas.process.cpu.normalized.usage.average | CPU Usage, normalized to pct | 1 | Gauge | cpu_state |
✅ mongodbatlas.process.cpu.normalized.usage.max | CPU Usage, normalized to pct | 1 | Gauge | cpu_state |
✅ mongodbatlas.process.cpu.usage.average | CPU Usage (%) | 1 | Gauge | cpu_state |
✅ mongodbatlas.process.cpu.usage.max | CPU Usage (%) | 1 | Gauge | cpu_state |
✅ mongodbatlas.process.cursors | Number of cursors | {cursors} | Gauge | cursor_state |
✅ mongodbatlas.process.db.document.rate | Document access rates | {documents}/s | Gauge | document_status |
✅ mongodbatlas.process.db.operations.rate | DB Operation Rates | {operations}/s | Gauge | operation, cluster_role |
✅ mongodbatlas.process.db.operations.time | DB Operation Times | ms | Counter | execution_type |
✅ mongodbatlas.process.db.query_executor.scanned | Scanned objects | {objects}/s | Gauge | scanned_type |
✅ mongodbatlas.process.db.query_targeting.scanned_per_returned | Scanned objects per returned | {scanned}/{returned} | Gauge | scanned_type |
✅ mongodbatlas.process.db.storage | Storage used by the database | By | Gauge | storage_status |
✅ mongodbatlas.process.global_lock | Number and status of locks | {locks} | Gauge | global_lock_state |
✅ mongodbatlas.process.index.btree_miss_ratio | Index miss ratio (%) | 1 | Gauge | |
✅ mongodbatlas.process.index.counters | Indexes | {indexes} | Gauge | btree_counter_type |
✅ mongodbatlas.process.journaling.commits | Journaling commits | {commits} | Gauge | |
✅ mongodbatlas.process.journaling.data_files | Data file sizes | MiBy | Gauge | |
✅ mongodbatlas.process.journaling.written | Journals written | MiBy | Gauge | |
✅ mongodbatlas.process.memory.usage | Memory Usage | By | Gauge | memory_state |
✅ mongodbatlas.process.network.io | Network IO | By/s | Gauge | direction |
✅ mongodbatlas.process.network.requests | Network requests | {requests} | Counter | |
✅ mongodbatlas.process.oplog.rate | Execution rate by operation | GiBy/h | Gauge | |
✅ mongodbatlas.process.oplog.time | Execution time by operation | s | Gauge | oplog_type |
✅ mongodbatlas.process.page_faults | Page faults | {faults}/s | Gauge | memory_issue_type |
✅ mongodbatlas.process.restarts | Restarts in last hour | {restarts}/h | Gauge | |
✅ mongodbatlas.process.tickets | Tickets | {tickets} | Gauge | ticket_type |
✅ mongodbatlas.system.cpu.normalized.usage.average | System CPU Normalized to pct | 1 | Gauge | cpu_state |
✅ mongodbatlas.system.cpu.normalized.usage.max | System CPU Normalized to pct | 1 | Gauge | cpu_state |
✅ mongodbatlas.system.cpu.usage.average | System CPU Usage (%) | 1 | Gauge | cpu_state |
✅ mongodbatlas.system.cpu.usage.max | System CPU Usage (%) | 1 | Gauge | cpu_state |
✅ mongodbatlas.system.fts.cpu.normalized.usage | Full text search disk usage (%) | 1 | Gauge | cpu_state |
✅ mongodbatlas.system.fts.cpu.usage | Full-text search (%) | 1 | Gauge | cpu_state |
✅ mongodbatlas.system.fts.disk.used | Full text search disk usage | By | Gauge | |
✅ mongodbatlas.system.fts.memory.usage | Full-text search | MiBy | Counter | memory_state |
✅ mongodbatlas.system.memory.usage.average | System Memory Usage | KiBy | Gauge | memory_status |
✅ mongodbatlas.system.memory.usage.max | System Memory Usage | KiBy | Gauge | memory_status |
✅ mongodbatlas.system.network.io.average | System Network IO | By/s | Gauge | direction |
✅ mongodbatlas.system.network.io.max | System Network IO | By/s | Gauge | direction |
✅ mongodbatlas.system.paging.io.average | Swap IO | {pages}/s | Gauge | direction |
✅ mongodbatlas.system.paging.io.max | Swap IO | {pages}/s | Gauge | direction |
✅ mongodbatlas.system.paging.usage.average | Swap usage | KiBy | Gauge | memory_state |
✅ mongodbatlas.system.paging.usage.max | Swap usage | KiBy | Gauge | memory_state |
Attributes
| Attribute Name | Description | Type | Values |
|---|---|---|---|
assert_type | MongoDB assertion type | string | regular, warning, msg, user |
btree_counter_type | Database index effectiveness | string | accesses, hits, misses |
cache_direction | Whether read into or written from | string | read_into, written_from |
cache_ratio_type | Cache ratio type | string | cache_fill, dirty_fill |
cache_status | Cache status | string | dirty, used |
cluster_role | Whether process is acting as replica or primary | string | primary, replica |
cpu_state | CPU state | string | kernel, user, nice, iowait, irq, softirq, guest, steal |
cursor_state | Whether cursor is open or timed out | string | timed_out, open |
direction | Network traffic direction | string | receive, transmit |
disk_direction | Measurement type for disk operation | string | read, write, total |
disk_status | Disk measurement type | string | free, used |
document_status | Status of documents in the database | string | returned, inserted, updated, deleted |
execution_type | Type of command | string | reads, writes, commands |
global_lock_state | Which queue is locked | string | current_queue_total, current_queue_readers, current_queue_writers |
memory_issue_type | Type of memory issue encountered | string | extra_info, global_accesses_not_in_memory, exceptions_thrown |
memory_state | Memory usage type | string | resident, virtual, mapped, computed, shared, free, used |
memory_status | Memory measurement type | string | available, buffers, cached, free, shared, used |
object_type | MongoDB object type | string | collection, index, extent, object, view, storage, data |
operation | Type of database operation | string | cmd, query, update, delete, getmore, insert, scan_and_order, ttl_deleted |
oplog_type | Oplog type | string | slave_lag_master_time, master_time, master_lag_time_diff |
scanned_type | Objects or indexes scanned during query | string | index_items, objects |
storage_status | Views on database size | string | total, data_size, index_size, data_size_wo_system |
ticket_type | Type of ticket available | string | available_reads, available_writes |
Resource Attributes
| Attribute Name | Description | Type | Enabled |
|---|---|---|---|
mongodb_atlas.cluster.name | Cluster Name | string | ❌ |
mongodb_atlas.db.name | Name of the Database | string | ✅ |
mongodb_atlas.disk.partition | Name of a disk partition | string | ✅ |
mongodb_atlas.host.name | Hostname of the process | string | ✅ |
mongodb_atlas.org_name | Organization Name | string | ✅ |
mongodb_atlas.process.id | ID of the process | string | ✅ |
mongodb_atlas.process.port | Port process is bound to | string | ✅ |
mongodb_atlas.process.type_name | Process type | string | ✅ |
mongodb_atlas.project.id | Project ID | string | ✅ |
mongodb_atlas.project.name | Project Name | string | ✅ |
mongodb_atlas.provider.name | Provider Name | string | ❌ |
mongodb_atlas.region.name | Region Name | string | ❌ |
mongodb_atlas.user.alias | User-friendly hostname of the cluster node | string | ❌ |
Configuration
Example Configuration
Last generated: 2026-04-13