Docs
DocumentationQuery ReferenceAPI Reference
Open Console→→
DocumentationQuery ReferenceAPI Reference

Platform overview

What is Axiom?QuickstartArchitectureFeatures
Fundamentals
Datasets
Edge deployments
Limits
Performance
Optimize usage
Requirements
Semantic conventions
Glossary
Tour
SecurityRoadmap

Send data

Reference architecturesMethods

Understand data

Console
Query
Builder
Editor
Query results
Visualize
Traces
Metrics
Correlations
Save queries
Stream
Dashboard
Create
Elements
Create
Configure
Element types
Gauge
Heatmap
Log stream
Monitor list
Note
Pie chart
Scatter plot
Statistic
Table
Time series
Sections
Configure
Filter
Monitor
Overview
View status
Configure
Examples
Monitor types
Anomaly
Match
New values
Threshold
Alerting
Overview
Configure
Notifier types
Amp
ChatGPT Workspace Agent
Claude Code
Cursor
Custom Webhook
Discord
Email
incident.io
Jira Service Management
Microsoft Teams
Opsgenie
PagerDuty
Slack
Annotations
Command Menu
Manage
Datasets
Overview
Views
Virtual fields
Access
RBAC
Tokens
CLI
Organization
Labels
Audit log
Settings
Usage and billing
Profile
Extend
Overview
AWS Lambda
AWS PrivateLink
Cloudflare Workers
Cloudflare Logpush
Convex
Grafana
Hex
Netlify
Supabase
Supabase metrics
Tailscale
Terraform
Unkey
Vercel
Intelligence
Overview
Spotlight
AI agents
Overview
MCP Server
Overview
Tools
Query cost limits
Agent-created orgs
Skills
Overview
Axiom alerting
Build dashboards
Control costs
SRE
Translate SPL to APL
Splunk
Overview
Splunk app
Install and configure
Commands
Traces
Examples
Portal
How it works
Set up standard mode
Set up transparent mode
Observability Cloud
OCSF data
OCSF as CIM
SPL command support
Examples
Monitor and troubleshoot

Use cases

ObservabilityProduct analytics
OCSF security data
Overview
Send data
Query data
LLM observability
Overview
Use Vercel AI SDK
Manual instrumentation
OpenAI Agents SDK
GenAI attributes
Redaction policies

Miscellaneous

LLMs
Overview
List of docs pages
Full docs
Query reference
FAQs
Legal
Acceptable use policy
Axiom for Startups terms
Committed use terms
Cookies
Data processing
HIPAA
Partner agreement
Partner program guide
Privacy policy
SLA
Terms of service
Terms of use

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 mongod and mongos diagnostic 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 Owner role on the project you want to monitor.
Info

Logs and metrics require separate datasets. Create one dataset with the Events type for logs, and one dataset with the Metrics type for metrics. Use an API token that can ingest into both. For more information, see Create dataset.

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.

  1. In Atlas, open your project, and then go to Project Settings > Integrations.

  2. Click Configure on the OpenTelemetry Log Export card.

  3. In the OTLP Endpoint field, enter https://AXIOM_DOMAIN/v1/logs.

  4. In the OTLP Headers fields, add the following headers. Click Add Header to add the second header.

    HeaderValue
    AuthorizationBearer API_TOKEN
    X-Axiom-DatasetDATASET_NAME
  5. Under Log Type, select the logs to export:

    • Mongod: Diagnostic logs from each mongod process.
    • Mongos: Diagnostic logs from each mongos router in a sharded cluster.
    • Mongod Audit: Audit logs from each mongod process.
    • Mongos Audit: Audit logs from each mongos router in a sharded cluster.
    • Activity Feed Events: Events from the Project Activity Feed.
  6. Click Test Integration. Atlas sends a test log event to Axiom and confirms that the request succeeded.

  7. Click Save.

Info

Replace AXIOM_DOMAIN with the base domain of your edge deployment. For more information, see Edge deployments.

Replace API_TOKEN with the Axiom API token you have generated. For added security, store the API token in an environment variable.

Replace DATASET_NAME with the name of the Axiom dataset where you send your data.

Use the name of the events dataset for DATASET_NAME.

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:

shell
curl --request POST "https://cloud.mongodb.com/api/atlas/v2/groups/ATLAS_PROJECT_ID/logIntegrations" \
  --header "Authorization: Bearer ATLAS_ACCESS_TOKEN" \
  --header "Content-Type: application/json" \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  --data '{
    "type": "OTEL_LOG_EXPORT",
    "logTypes": ["MONGOD", "MONGOS", "MONGOD_AUDIT", "MONGOS_AUDIT", "EVENTS"],
    "otelEndpoint": "https://AXIOM_DOMAIN/v1/logs",
    "otelSuppliedHeaders": [
      { "name": "Authorization", "value": "Bearer API_TOKEN" },
      { "name": "X-Axiom-Dataset", "value": "DATASET_NAME" }
    ]
  }'

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.

  1. In Atlas, open your project, and then go to Project Settings > Integrations.

  2. Click Configure on the OpenTelemetry (OTel) Metrics card.

  3. In the Provider list, select Custom.

  4. In the OTLP Endpoint field, enter https://AXIOM_DOMAIN/v1/metrics.

  5. Under Authentication, select Header.

  6. In the OTLP Headers fields, add the following headers. Click Add Header to add the second header.

    HeaderValue
    AuthorizationBearer API_TOKEN
    X-Axiom-Metrics-DatasetDATASET_NAME
  7. In the Aggregation Temporality list, select DELTA or CUMULATIVE. Axiom accepts both and stores the temporality with each metric.

  8. Under Select Metrics to Send, select the metric categories to export, such as MongoDB Metrics and Hardware Metrics.

  9. Click Test Integration. Atlas sends a test metric to Axiom and confirms that the request succeeded.

  10. Click Save.

Info

Replace AXIOM_DOMAIN with the base domain of your edge deployment. For more information, see Edge deployments.

Replace API_TOKEN with the Axiom API token you have generated. For added security, store the API token in an environment variable.

Replace DATASET_NAME with the name of the Axiom dataset where you send your data.

Use the name of the metrics dataset for DATASET_NAME. For metrics, use the X-Axiom-Metrics-Dataset header instead of X-Axiom-Dataset.

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:

shell
curl --request POST "https://cloud.mongodb.com/api/atlas/v2/groups/ATLAS_PROJECT_ID/metricIntegrations" \
  --header "Authorization: Bearer ATLAS_ACCESS_TOKEN" \
  --header "Content-Type: application/vnd.atlas.2025-03-12+json" \
  --header "Accept: application/vnd.atlas.2025-03-12+json" \
  --data '{
    "integrationType": "OTEL",
    "providerType": "CUSTOM",
    "endpoint": "https://AXIOM_DOMAIN/v1/metrics",
    "authType": "HEADER",
    "headers": [
      { "name": "Authorization", "value": "Bearer API_TOKEN" },
      { "name": "X-Axiom-Metrics-Dataset", "value": "DATASET_NAME" }
    ],
    "aggregationTemporality": "DELTA",
    "metricSelection": ["MONGODB_METRICS", "HARDWARE_METRICS"]
  }'

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.

APL
['DATASET_NAME']
| summarize count() by bin_auto(_time), ['service.name']

The following query counts Activity Feed events by event type:

APL
['DATASET_NAME']
| where ['service.name'] == 'mongodb-atlas-events'
| summarize count() by ['attributes.mongodb.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:

Dashboard of MongoDB Atlas logs and metrics in Axiom
└Dashboard of MongoDB Atlas logs and metrics in Axiom

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.id field.
  • 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.
Was this page helpful?
Suggest edits on GitHub
On this page
Send logs to AxiomConfigure log export with the Atlas Administration APISend organization eventsSend metrics to AxiomConfigure metrics export with the Atlas Administration APIExplore your Atlas dataLimitationsWhat’s next