We use cookies or similar technologies to personalize your online experience and tailor marketing to you. Many of our product features require cookies to function properly. Your use of this site and online product constitutes your consent to these personalization technologies. Read our Privacy Policy to find out more.

X

Using the Honeycomb Atlas Agent

If you are using MongoDB’s Atlas service to host your MongoDB instance(s), you can use the Honeycomb Atlas Agent to poll the Atlas Logs API for log events and submit them to Honeycomb.

To do this, you’ll need:

Installation

go get github.com/honeycombio/atlas

Preparing MongoDB logging

Atlas does not currently allow you to set the log verbosity level. To enable logging, you will need to configure profiling on each DB that you are interested in collecting from. To do this, run the following in your Mongo shell:

dbnames = db.getMongo().getDBNames()
for (var k in dbnames) { adb = db.getMongo().getDB(dbnames[k]); adb.setProfilingLevel(2, -1); }

Atlas Permissions

Your user will need ownership permissions on the cluster to pull the logs. See Atlas Logs API for more information.

Running the Atlas integration

# Your Atlas API Key, configured at:
# https://cloud.mongodb.com/v2#/account/publicApi
API_KEY=abcd1234-ab12-ab12-1234567890ab
# Your Atlas Username
USERNAME=myuser@example.com
# This is the Atlas Group ID/Project ID
# You can find this in your Atlass "Project Settings" page
GROUP_ID=abc1def2abc1def2ab9999
# Your Honeycomb API Key
API_KEY=abcdef1234567890999999999
# Target Honeycomb Dataset
DATASET=atlas-logs
atlas \
  --api_key=${API_KEY} \
  --username=${USERNAME} \
  --group_id=${GROUP_ID} \
  --cluster=Cluster0 \
  --writekey=${API_KEY} \
  --dataset=${DATASET}

You can specify more clusters by providing the --cluster parameter multiple times.

Kubernetes

Atlas runs well inside Kubernetes. You can modify our example spec file with the required arguments (USERNAME, API_KEY, WRITE_KEY, etc) and install with kubectl apply:

kubectl apply -f kubernetes/atlas.example.yml

Troubleshooting

If you have a problem or question, or would just like to leave feedback, please open a Github issue on our Atlas repository.