Skip to content

Commit

Permalink
[receiver/mongodb] Ensure support of the latest mongodb versions (#33644
Browse files Browse the repository at this point in the history
)

**Description:** Validated new versions of mongodb ( 6.0, 7.0)
**Link to tracking Issue:** #32716 

**Testing:** Manually newer versions and added/updated integration
tests.
  • Loading branch information
samiura committed Jun 19, 2024
1 parent 8e75855 commit 3cf65b6
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .chloggen/branch-issue-32716.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Use this changelog template to create an entry for release notes.

# 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/mongodb'

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: 'Ensure support of 6.0 and 7.0 MongoDB versions with integration tests'

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [32716]

# (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:

# If your change doesn't affect end users or the exported elements of any package,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: ['user']
2 changes: 2 additions & 0 deletions receiver/mongodbreceiver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ This receiver supports MongoDB versions:

- 4.0+
- 5.0
- 6.0
- 7.0

Mongodb recommends to set up a least privilege user (LPU) with a [`clusterMonitor` role](https://www.mongodb.com/docs/v5.0/reference/built-in-roles/#mongodb-authrole-clusterMonitor) in order to collect metrics. Please refer to [lpu.sh](./testdata/integration/scripts/lpu.sh) for an example of how to configure these permissions.

Expand Down
2 changes: 2 additions & 0 deletions receiver/mongodbreceiver/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ const mongoPort = "27017"
func TestIntegration(t *testing.T) {
t.Run("4.0", integrationTest("4_0", []string{"/setup.sh"}, func(*Config) {}))
t.Run("5.0", integrationTest("5_0", []string{"/setup.sh"}, func(*Config) {}))
t.Run("6.0", integrationTest("5_0", []string{"/setup.sh"}, func(*Config) {}))
t.Run("7.0", integrationTest("5_0", []string{"/setup.sh"}, func(*Config) {}))
t.Run("4.4lpu", integrationTest("4_4lpu", []string{"/lpu.sh"}, func(cfg *Config) {
cfg.Username = "otelu"
cfg.Password = "otelp"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM mongo:6.0

COPY scripts/setup.sh /setup.sh
RUN chmod +x /setup.sh

EXPOSE 27017
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM mongo:7.0

COPY scripts/setup.sh /setup.sh
RUN chmod +x /setup.sh

EXPOSE 27017

0 comments on commit 3cf65b6

Please sign in to comment.