Skip to content

Commit c0c6d43

Browse files
committed
updated mongodb atlas collection docs
1 parent dd1e5b6 commit c0c6d43

File tree

5 files changed

+59
-114
lines changed

5 files changed

+59
-114
lines changed

docs/integrations/databases/mongodb-atlas.md

Lines changed: 59 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -161,38 +161,34 @@ CACHE_USED_BYTES
161161
CONNECTIONS
162162
CURSORS_TOTAL_OPEN
163163
CURSORS_TOTAL_TIMED_OUT
164-
DATABASE_AVERAGE_OBJECT_SIZE
165-
DB_STORAGE_TOTAL
166164
DB_DATA_SIZE_TOTAL
165+
DB_STORAGE_TOTAL
167166
EXTRA_INFO_PAGE_FAULTS
168167
GLOBAL_LOCK_CURRENT_QUEUE_TOTAL
169168
MEMORY_RESIDENT
170169
MEMORY_VIRTUAL
171-
MEMORY_MAPPED
172170
NETWORK_BYTES_IN
173171
NETWORK_BYTES_OUT
174172
NETWORK_NUM_REQUESTS
173+
OP_EXECUTION_TIME_COMMANDS
174+
OP_EXECUTION_TIME_READS
175+
OP_EXECUTION_TIME_WRITES
175176
OPCOUNTER_CMD
176-
OPCOUNTER_QUERY
177-
OPCOUNTER_UPDATE
178177
OPCOUNTER_DELETE
179178
OPCOUNTER_GETMORE
180179
OPCOUNTER_INSERT
181-
OP_EXECUTION_TIME_READS
182-
OP_EXECUTION_TIME_WRITES
183-
OP_EXECUTION_TIME_COMMANDS
184-
OPLOG_MASTER_LAG_TIME_DIFF
185-
OPLOG_SLAVE_LAG_MASTER_TIME
180+
OPCOUNTER_QUERY
181+
OPCOUNTER_UPDATE
182+
PROCESS_CPU_KERNEL
183+
PROCESS_CPU_USER
186184
QUERY_EXECUTOR_SCANNED
187185
QUERY_EXECUTOR_SCANNED_OBJECTS
188-
QUERY_TARGETING_SCANNED_PER_RETURNED
189186
QUERY_TARGETING_SCANNED_OBJECTS_PER_RETURNED
190-
SYSTEM_NORMALIZED_CPU_USER
191-
SYSTEM_NORMALIZED_CPU_KERNEL
187+
QUERY_TARGETING_SCANNED_PER_RETURNED
192188
SYSTEM_NORMALIZED_CPU_IOWAIT
193-
PROCESS_CPU_USER
194-
PROCESS_CPU_KERNEL
189+
SYSTEM_NORMALIZED_CPU_KERNEL
195190
SYSTEM_NORMALIZED_CPU_STEAL
191+
SYSTEM_NORMALIZED_CPU_USER
196192
```
197193

198194
```txt title="Sample metric"
@@ -246,9 +242,11 @@ By default, the collection starts from the current date and time, but this setti
246242
### Step 1: Acquire Authentication Info from MongoDB Atlas Portal
247243

248244
This section shows you how to acquire MongoDB Atlas portal authentication information. Generate programmatic API Keys with project owner permissions using the instructions in the Atlas [documentation](https://docs.atlas.mongodb.com/configure-api-access/#create-an-api-key-for-a-project). Then, copy the public key and private key. These serve the same function as a username and API Key, respectively.
249-
1. Generate programmatic API Keys with project owner permissions using the instructions in the Atlas [documentation](https://docs.atlas.mongodb.com/configure-api-access/#create-an-api-key-for-a-project). Then, copy the public key and private key. These serve the same function as a username and API Key respectively.
245+
1. Generate programmatic API Keys with project owner permissions using the instructions in the Atlas [documentation](https://docs.atlas.mongodb.com/configure-api-access/#create-an-api-key-for-a-project). Then, copy the public key and private key. These serve the same function as a username and API Key respectively. You may also have to configure [ip access list](https://www.mongodb.com/docs/atlas/configure-api-access-org/#edit-the-api-access-list) for the host from which you want Atlas to accept API requests.
246+
<img src={useBaseUrl('img/integrations/databases/mongodbatlas/createapikey.png')} alt="MongoDB Atlas create api key" />
250247
2. Specify the API key **Organization Member** permissions, under **Organization > Access Manager > API Keys**, as shown in the following example.
251248
3. Go to **Project Settings** > **Access Manager** > **API Keys** and then click on **Invite To Project** to add the API key created above for this project as shown in the following example.
249+
<img src={useBaseUrl('img/integrations/databases/mongodbatlas/invitetoproject.png')} alt="MongoDB Atlas invite to project" />
252250
4. Specify **Project Data Access Read Only** permission, under **Project Settings > Access Manager > API Keys**, as shown in the following example.
253251
5. Go to your project, click **Settings**, and copy the **Project ID**, as shown in the following example.
254252
6. Go to your organization by using context dropdown at the top, click **Settings**, and copy the **Organization ID**.
@@ -281,7 +279,7 @@ In this section, we explore various mechanisms to collect database logs, events,
281279
A single instance of the collector is responsible for collecting logs from a single project. Refer to [Configure Collection for Multiple Projects](#step-3b-configure-collection-for-multiple-projects-optional) if you have multiple projects.
282280

283281

284-
#### Step 3A: Deploy the Sumo Logic MongoDB Atlas SAM application
282+
#### Deploy the Sumo Logic MongoDB Atlas SAM application
285283

286284
In this section, you deploy the SAM application, which creates the necessary resources in your AWS account. To deploy the Sumo Logic MongoDB Atlas SAM application, do the following:
287285
1. Go to [https://serverlessrepo.aws.amazon.com/applications](https://serverlessrepo.aws.amazon.com/applications).
@@ -323,18 +321,21 @@ In this section, you deploy the SAM application, which creates the necessary res
323321

324322
The lambda function should be working now in sending logs to Sumo. You can check the CloudWatch logs in **Monitor** > **Logs** to see the logs of the function.
325323

326-
#### Step 3B: Configure Collection for Multiple Projects (optional)
327-
328-
This section shows you how to configure collection for multiple projects, assuming you are already collecting Atlas data for one project. This task requires that you do the following:
329-
* Stop the collection of OrgEvents in the second SAM app deployment, because these events are global and are already captured by first collector.
330-
* Change the `DBNAME` so that state (keys) maintained (bookkeeping) in the database (key value store) are not in conflict.
324+
13. Configuring collection for multiple projects (assuming you are already collecting Atlas data for one project). This task requires that you do the following:
331325

332-
To configure collection for multiple projects, do the following:
333326
1. [Deploy the MongoDB Atlas SAM application](#step-3a-deploy-the-sumo-logic-mongodb-atlas-sam-application) with the configuration for a new project.
334-
2. After the deployment is complete, change the database name by adding environment variable (`DBNAME`) in [AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/env_variables.html), as shown in the following example.
335-
3. From the Lambda console, go to the **mongodbatlas.yaml** file and comment out `EVENTS_ORG`, as shown in the following example. This prevents the collection of org events, because they are already being collected by the first collector.
327+
2. From the Lambda console, go to the **mongodbatlas.yaml** file and comment out `EVENTS_ORG`, as shown in the following example. This prevents the collection of `Organisation Events` in the second SAM app deployment, because these events are global and are already captured by first collector.
336328

337-
#### Step 3C: Configure Script-Based Collection for MongoDB Atlas
329+
14. By default the solution collects all log types & metrics for all the clusters, if you to filter based on cluster alias, do the following
330+
1. After the deployment is complete, go to the Lambda console, and open the **mongodbatlas.yaml** file and uncomment `Clusters` parameter under `Collection` section, as shown in the following example. Add your cluster names for which you want to collect logs & metrics. Cluster name should be same as what you have specified during [cluster creation](https://www.mongodb.com/docs/atlas/tutorial/create-new-cluster/#specify-a-name-for-the-cluster-in-the-name-box).
331+
332+
<img src={useBaseUrl('img/integrations/databases/mongodbatlas/changecluster.png')} alt="MongoDB Atlas filter by cluster" />
333+
334+
1. By default the solution collects logs types and metrics which are used in the app, if you want to collect specific log types and metric types uncomment to collect the respective log type or metric name as shown below.
335+
336+
<img src={useBaseUrl('img/integrations/databases/mongodbatlas/updatemetricslogs.png')} alt="MongoDB Atlas filter by log and metric type" />
337+
338+
#### Configure Script-Based Collection for MongoDB Atlas
338339

339340
This section shows you how to configure script-based log collection for the Sumo Logic MongoDB Atlas app. The _sumologic-mongodb-atlas_ script is compatible with python 3.11 and python 2.7, and has been tested on Ubuntu 18.04 LTS.
340341

@@ -365,7 +366,7 @@ This task makes the following assumptions:
365366
```bash
366367
pip3 install sumologic-mongodb-atlas
367368
```
368-
3. Create a `mongodbatlas.yaml` configuration file in the home directory and fill in the parameters as shown in the following example.
369+
3. Create a `mongodbatlas.yaml` configuration file in the home directory by downloading the [sample file](https://github.com/SumoLogic/sumologic-mongodb-atlas/blob/master/mongodbatlas_sample.yaml) and fill in the following mandatory parameters as shown in the following example.
369370
```bash title="mongodbatlas.yaml"
370371
SumoLogic:
371372
HTTP_LOGS_ENDPOINT: <Paste the HTTP Logs source URL from step 2.>
@@ -387,88 +388,24 @@ This task makes the following assumptions:
387388
*/5 * * * * /usr/bin/python3 -m sumomongodbatlascollector.main > /dev/null 2>&1
388389
```
389390
5. Configuring collection for multiple projects (assuming you are already collecting Atlas data for one project). This task requires that you do the following:
390-
* Stop the collection of OrgEvents in the second SAM app deployment because these events are global and are already captured by first collector.
391-
* Change the `DBNAME` so that state (keys) maintained (bookkeeping) in the database (key value store) are not in conflict.
391+
* Create a new **mongodbatlas.yaml** file similar to previous step and comment out `EVENTS_ORG`, as shown in the following example. This prevents the collection of `Organisation Events` in the second collector deployment, because these events are global and are already captured by first collector.
392+
* State is maintained per project, change the `DBNAME` so that state (keys for bookkeeping) maintained in the database (key value store) are not in conflict.
392393
* Configure the script on a Linux machine, then go to your configuration file.
393-
* Change the `DB_NAME` and comment out `EVENTS_ORG` as shown in the following example.
394-
```
395-
SumoLogic:
396-
LOGS_SUMO_ENDPOINT: <Paste the URL for the HTTP Logs source from step 2.>
397-
METRICS_SUMO_ENDPOINT: <Paste the URL for the HTTP Metrics source from step 2.>
398-
399-
MongoDBAtlas:
400-
ORGANIZATION_ID: <Paste the Organization ID from step 1.>
401-
PROJECT_ID: <Paste the Project ID from step 1.>
402-
PRIVATE_API_KEY: <Paste the Private Key from step 1.>
403-
PUBLIC_API_KEY: <Paste the Public Key from step 1.>
404-
LOG_TYPES:
405-
DATABASE
406-
AUDIT
407-
EVENTS_PROJECT
408-
EVENTS_ORG
409-
ALERTS
410-
411-
METRIC_TYPES:
412-
PROCESS_METRICS:
413-
CACHE_DIRTY_BYTES
414-
CACHE_USED_BYTES
415-
CONNECTIONS
416-
CURSORS_TOTAL_OPEN
417-
CURSORS_TOTAL_TIMED_OUT
418-
DATABASE_AVERAGE_OBJECT_SIZE
419-
DB_STORAGE_TOTAL
420-
DB_DATA_SIZE_TOTAL
421-
EXTRA_INFO_PAGE_FAULTS
422-
GLOBAL_LOCK_CURRENT_QUEUE_TOTAL
423-
MEMORY_RESIDENT
424-
MEMORY_VIRTUAL
425-
MEMORY_MAPPED
426-
NETWORK_BYTES_IN
427-
NETWORK_BYTES_OUT
428-
NETWORK_NUM_REQUESTS
429-
OPCOUNTER_CMD
430-
OPCOUNTER_QUERY
431-
OPCOUNTER_UPDATE
432-
OPCOUNTER_DELETE
433-
OPCOUNTER_GETMORE
434-
OPCOUNTER_INSERT
435-
OP_EXECUTION_TIME_READS
436-
OP_EXECUTION_TIME_WRITES
437-
OP_EXECUTION_TIME_COMMANDS
438-
OPLOG_MASTER_LAG_TIME_DIFF
439-
OPLOG_SLAVE_LAG_MASTER_TIME
440-
QUERY_EXECUTOR_SCANNED
441-
QUERY_EXECUTOR_SCANNED_OBJECTS
442-
QUERY_TARGETING_SCANNED_PER_RETURNED
443-
QUERY_TARGETING_SCANNED_OBJECTS_PER_RETURNED
444-
SYSTEM_NORMALIZED_CPU_USER
445-
SYSTEM_NORMALIZED_CPU_KERNEL
446-
SYSTEM_NORMALIZED_CPU_IOWAIT
447-
PROCESS_CPU_USER
448-
PROCESS_CPU_KERNEL
449-
SYSTEM_NORMALIZED_CPU_STEAL
450-
451-
DISK_METRICS:
452-
DISK_PARTITION_IOPS_READ
453-
DISK_PARTITION_IOPS_WRITE
454-
DISK_PARTITION_LATENCY_READ
455-
DISK_PARTITION_LATENCY_WRITE
456-
DISK_PARTITION_SPACE_PERCENT_FREE
457-
DISK_PARTITION_SPACE_PERCENT_USED
458-
459-
Collection:
460-
DBNAME: "newmongodbatlas"
461-
MIN_REQUEST_WINDOW_LENGTH: 60
462-
MAX_REQUEST_WINDOW_LENGTH: 900
463-
Clusters:
464-
- "clusters1.mongodb.net"
465-
- "clusters2.mongodb.net"
466-
```
394+
395+
6. By default the solution collects all log types & metrics for all the clusters, if you to filter based on cluster alias, do the following
396+
1. After the deployment is complete, go to the Lambda console, and open the **mongodbatlas.yaml** file and uncomment `Clusters` parameter under `Collection` section, as shown in the following example. Add your cluster names for which you want to collect logs & metrics. Cluster name should be same as what you have specified during [cluster creation](https://www.mongodb.com/docs/atlas/tutorial/create-new-cluster/#specify-a-name-for-the-cluster-in-the-name-box).
397+
398+
<img src={useBaseUrl('img/integrations/databases/mongodbatlas/changecluster.png')} alt="MongoDB Atlas filter by cluster" />
399+
400+
1. By default the solution collects logs types and metrics which are used in the app, if you want to collect specific log types and metric types uncomment to collect the respective log type or metric name as shown below.
401+
402+
<img src={useBaseUrl('img/integrations/databases/mongodbatlas/updatemetricslogs.png')} alt="MongoDB Atlas filter by log and metric type" />
467403

468404
```sh title="Example execution of second yaml file"
469405
/usr/bin/python3 -m sumomongodbatlascollector.main <path-of-second-yaml-file>
470406
```
471407

408+
472409
### Step 4: Configure Webhooks for Alerts Collection
473410

474411
You configure Webhooks for real-time alerts. This section explains how to configure alert collection using Webhooks.
@@ -496,7 +433,7 @@ in MongoDBAtlas Section </td>
496433
<br/>EVENTS_PROJECT
497434
<br/>EVENTS_ORG
498435
<br/>ALERTS
499-
<br/>Remove any one of the lines if you do not want to collect metric of that type.</td>
436+
<br/>Remove or comment any one of the lines if you do not want to collect metric of that type.</td>
500437
</tr>
501438
<tr>
502439
<td>PROCESS_METRICS<br/>in MongoDBAtlas Section</td>
@@ -534,7 +471,7 @@ SYSTEM_NORMALIZED_CPU_KERNEL<br/>
534471
SYSTEM_NORMALIZED_CPU_IOWAIT<br/>
535472
PROCESS_CPU_USER<br/>
536473
PROCESS_CPU_KERNEL<br/>
537-
SYSTEM_NORMALIZED_CPU_STEAL<br/>Remove any one of the lines if you do not want to collect metric of that type. </td>
474+
SYSTEM_NORMALIZED_CPU_STEAL<br/>Remove or comment any one of the lines if you do not want to collect metric of that type. </td>
538475
</tr>
539476
<tr>
540477
<td>DISK_METRICS<br/>in MongoDBAtlas Section</td>
@@ -545,12 +482,7 @@ DISK_PARTITION_LATENCY_READ<br/>
545482
DISK_PARTITION_LATENCY_WRITE<br/>
546483
DISK_PARTITION_SPACE_FREE<br/>
547484
DISK_PARTITION_SPACE_USED<br/>
548-
Remove any one of the lines if you do not want to collect metric of that type.</td>
549-
</tr>
550-
<tr>
551-
<td>BACKFILL_DAYS<br/>in Collection Section</td>
552-
<td>Number of days before the event collection will start. If the value is 1,
553-
then events are fetched from yesterday to today.</td>
485+
Remove or comment any one of the lines if you do not want to collect metric of that type.</td>
554486
</tr>
555487
<tr>
556488
<td>PAGINATION_LIMIT<br/>in Collection Section</td>
@@ -585,6 +517,11 @@ then events are fetched from yesterday to today.</td>
585517
<td>A backoff factor to apply between attempts after the second try. If the
586518
backoff_factor is 0.1, then sleep() will sleep for [0.0s, 0.2s, 0.4s, ...]
587519
between retries. </td>
520+
</tr>
521+
<tr>
522+
<td>BACKFILL_DAYS<br/>in Collection Section</td>
523+
<td>Number of days before the event collection will start. If the value is 1,
524+
then events are fetched from yesterday to today.</td>
588525
</tr>
589526
<tr>
590527
<td>TIMEOUT<br/>in Collection Section </td>
@@ -599,8 +536,8 @@ between retries. </td>
599536
<td>Maximum window length for the request window. The default is 900 seconds. </td>
600537
</tr>
601538
<tr>
602-
<td>Clusters<br/>in Collection Section </td>
603-
<td>User provided list of clusters for selecting specific clusters. By default, it selects all the clusters. </td>
539+
<td>MAX_PAYLOAD_BYTESIZE<br/>in Collection Section </td>
540+
<td> Maximum size of the chunk to be sent to sumo logic. Default is 4MB. </td>
604541
</tr>
605542
<tr>
606543
<td>LOGS_SUMO_ENDPOINT<br/>in MongoDBAtlas section </td>
@@ -646,6 +583,14 @@ Traceback (most recent call last):
646583
Exception: Invalid config
647584
```
648585

586+
4. Common Error codes
587+
588+
**TENANT_CLUSTER_LOGS_FOR_HOST_NOT_SUPPORTED** - This means that logs are not supported for that tier.
589+
590+
**IP_ADDRESS_NOT_ON_ACCESS_LIST** - This means that you may also have to configure [ip access list](https://www.mongodb.com/docs/atlas/configure-api-access-org/#edit-the-api-access-list) for the host from which you want Atlas to accept API requests.
591+
592+
**METRIC_TYPE_UNSUPPORTED** - This means that some metric type has been deprecated, refer the logs and remove that particular metric type from mongodbatlas.yaml file.
593+
649594
## Installing the MongoDB Atlas app
650595

651596
import AppInstall from '../../reuse/apps/app-install-v2.md';
@@ -796,4 +741,4 @@ import AppUpdate from '../../reuse/apps/app-update.md';
796741

797742
import AppUninstall from '../../reuse/apps/app-uninstall.md';
798743

799-
<AppUninstall/>
744+
<AppUninstall/>
50 KB
Loading
711 KB
Loading
621 KB
Loading
172 KB
Loading

0 commit comments

Comments
 (0)