Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[receiver/mongodbatlas] Support collection of MongoDBAtlas Access Logs #21406

Merged
merged 23 commits into from
May 10, 2023
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .chloggen/mongodbatlas-access-logs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: receiver/mongodbatlasreceiver

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Allow collection of MongoDB Atlas Access Logs as a new feature of the MongoDBAtlas receiver.

# One or more tracking issues related to the change
issues: [21182]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:
32 changes: 32 additions & 0 deletions receiver/mongodbatlasreceiver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,20 @@ MongoDB Atlas [Documentation](https://www.mongodb.com/docs/atlas/reference/api/l
- 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](https://www.mongodb.com/docs/atlas/reference/api/events-orgs-get-all/#event-type-values) that the receiver will request from the API. If specified, the receiver will collect only the indicated types of events.
- `access_logs`
djaglowski marked this conversation as resolved.
Show resolved Hide resolved
- `projects`
- `name`
- `include_clusters` (default empty, exclusive with `exclude_clusters`)
- `exclude_clusters` (default empty, exclusive with `include_clusters`)
- If both `include_clusters` and `exclude_clusters` are empty, then all clusters in the project will be included
- `poll_interval` (default `1m`)
dehaansa marked this conversation as resolved.
Show resolved Hide resolved
- How often the receiver will poll the Access History API for new access logs.
- `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` (default `20000`)
- 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` (default `10`)
- This will limit how many pages of access logs the receiver will request from the MongoDB Atlas API for each project.

Examples:

Expand Down Expand Up @@ -145,5 +159,23 @@ receivers:
storage: file_storage
```

Poll Access Logs from API:

```yaml
receivers:
mongodbatlas:
public_key: <redacted>
private_key: <redacted>
access_logs:
projects:
- name: Project 0
include_clusters: [Cluster0]
poll_interval: 1m
page_size: 20000
max_pages: 10
# use of a storage extension is recommended to reduce chance of duplicated access logs
storage: file_storage
```

[beta]:https://github.com/open-telemetry/opentelemetry-collector#beta
[contrib]:https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib
Loading