Send MongoDB Atlas logs and metrics to Axiom
This page explains how to send MongoDB Atlas logs, Activity Feed events, and metrics to Axiom with the Atlas OpenTelemetry integrations.
MongoDB Atlas is a managed MongoDB database service. Atlas exports database logs and metrics to any OpenTelemetry (OTel) endpoint over OTLP/HTTP. Axiom accepts OTLP/HTTP natively, so Atlas sends data straight to Axiom without an OpenTelemetry Collector in between.
This page explains how to set up the following Atlas integrations:
- OpenTelemetry log export sends
mongodandmongosdiagnostic logs, audit logs, and Project Activity Feed events to an Axiom events dataset. - OpenTelemetry metrics sends Atlas metrics to an Axiom metrics dataset.
Prerequisites
- Create an Axiom account.
- Create a dataset in Axiom where you send your data.
- Create an API token in Axiom with permissions to ingest data to the dataset you have created.
- Create an Atlas account with the
Project Ownerrole on the project you want to monitor.
Send logs to Axiom
Atlas exports database logs from M10+ clusters running MongoDB 7.0 or later. Activity Feed events export from projects with clusters of any tier, including free clusters. Atlas sends logs every minute. For more information, see Export logs to OpenTelemetry in the Atlas documentation.
-
In Atlas, open your project, and then go to Project Settings > Integrations.
-
Click Configure on the OpenTelemetry Log Export card.
-
In the OTLP Endpoint field, enter
https://AXIOM_DOMAIN/v1/logs. -
In the OTLP Headers fields, add the following headers. Click Add Header to add the second header.
Header Value AuthorizationBearer API_TOKENX-Axiom-DatasetDATASET_NAME -
Under Log Type, select the logs to export:
- Mongod: Diagnostic logs from each
mongodprocess. - Mongos: Diagnostic logs from each
mongosrouter in a sharded cluster. - Mongod Audit: Audit logs from each
mongodprocess. - Mongos Audit: Audit logs from each
mongosrouter in a sharded cluster. - Activity Feed Events: Events from the Project Activity Feed.
- Mongod: Diagnostic logs from each
-
Click Test Integration. Atlas sends a test log event to Axiom and confirms that the request succeeded.
-
Click Save.
Configure log export with the Atlas Administration API
To create the same integration programmatically, send a request to the log integration endpoints of the Atlas Administration API:
Replace ATLAS_PROJECT_ID with the ID of your Atlas project, and ATLAS_ACCESS_TOKEN with an Atlas service account access token that has the Project Owner role.
Send organization events
Atlas also exports the Organization Activity Feed to OTel endpoints. To send organization events to Axiom, follow the same procedure in Organization Settings > Integrations. This requires the Organization Owner role. For more information, see Export organization Activity Feed events in the Atlas documentation.
Atlas sets the service.name resource attribute of Activity Feed events to mongodb-atlas-events and the log_type attribute to EVENTS, so you can tell events apart from database logs.
Send metrics to Axiom
Atlas sends metrics from M10+ clusters to OTel endpoints. For more information, see Integrate with OpenTelemetry in the Atlas documentation.
-
In Atlas, open your project, and then go to Project Settings > Integrations.
-
Click Configure on the OpenTelemetry (OTel) Metrics card.
-
In the Provider list, select Custom.
-
In the OTLP Endpoint field, enter
https://AXIOM_DOMAIN/v1/metrics. -
Under Authentication, select Header.
-
In the OTLP Headers fields, add the following headers. Click Add Header to add the second header.
Header Value AuthorizationBearer API_TOKENX-Axiom-Metrics-DatasetDATASET_NAME -
In the Aggregation Temporality list, select DELTA or CUMULATIVE. Axiom accepts both and stores the temporality with each metric.
-
Under Select Metrics to Send, select the metric categories to export, such as MongoDB Metrics and Hardware Metrics.
-
Click Test Integration. Atlas sends a test metric to Axiom and confirms that the request succeeded.
-
Click Save.
Configure metrics export with the Atlas Administration API
To create the same integration programmatically, send a request to the metric integration endpoints of the Atlas Administration API:
The metricSelection array accepts the metric categories listed in the API reference, such as MONGODB_METRICS, HARDWARE_METRICS, DB_STATS, SEARCH_METRICS, SHARDING_METRICS, QUERY_SHAPE_INSIGHTS, and ATLAS_STREAM_PROCESSING.
Explore your Atlas data
Atlas exports logs every minute. Open the Stream tab to watch log events arrive in real time and inspect their fields. The first event is the test event from Test Integration, with the service name mongodb-atlas.
In Axiom, the service.name resource attribute becomes a top-level field, other resource attributes appear under resource, and log record attributes appear under attributes. For example, the following query charts the volume of Atlas log events over time for each service. Activity Feed events appear with the service name mongodb-atlas-events.
The following query counts Activity Feed events by event type:
To list the metrics Atlas sends, open the metrics dataset in the Query tab. For more information about querying metrics, see Metrics.
Add queries like these to a dashboard to monitor your Atlas clusters. For example, the following dashboard shows log volume, slow queries, failed authentication attempts, Activity Feed events, and cluster metrics:

Limitations
- Each Atlas host produces about 1 GB of logs per day. Atlas charges data transfer costs for log export.
- Network issues or retries can cause duplicate log events in Axiom. To deduplicate Activity Feed events, use the
attributes.mongodb.event.idfield. - Logs can contain sensitive information. To have Atlas redact information before export, contact MongoDB Support.
- Atlas requires an HTTPS endpoint with a certificate from a public certificate authority. Axiom edge endpoints meet this requirement.
What’s next
- Create a dashboard for your Atlas clusters.
- Set up monitors to get alerts about slow queries or failed authentication attempts.
- Learn more about OpenTelemetry in Axiom.