diff --git a/.chloggen/branch-issue-32716.yaml b/.chloggen/branch-issue-32716.yaml new file mode 100644 index 0000000000000..500686dcf9df0 --- /dev/null +++ b/.chloggen/branch-issue-32716.yaml @@ -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'] diff --git a/receiver/mongodbreceiver/README.md b/receiver/mongodbreceiver/README.md index 5397aca56f2aa..8ce2e4e0c8887 100644 --- a/receiver/mongodbreceiver/README.md +++ b/receiver/mongodbreceiver/README.md @@ -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. diff --git a/receiver/mongodbreceiver/integration_test.go b/receiver/mongodbreceiver/integration_test.go index e6c52c2add6a9..1813abd4e21f2 100644 --- a/receiver/mongodbreceiver/integration_test.go +++ b/receiver/mongodbreceiver/integration_test.go @@ -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" diff --git a/receiver/mongodbreceiver/testdata/integration/Dockerfile.mongodb.6_0 b/receiver/mongodbreceiver/testdata/integration/Dockerfile.mongodb.6_0 new file mode 100644 index 0000000000000..2eb9c3a5e3716 --- /dev/null +++ b/receiver/mongodbreceiver/testdata/integration/Dockerfile.mongodb.6_0 @@ -0,0 +1,6 @@ +FROM mongo:6.0 + +COPY scripts/setup.sh /setup.sh +RUN chmod +x /setup.sh + +EXPOSE 27017 \ No newline at end of file diff --git a/receiver/mongodbreceiver/testdata/integration/Dockerfile.mongodb.7_0 b/receiver/mongodbreceiver/testdata/integration/Dockerfile.mongodb.7_0 new file mode 100644 index 0000000000000..5ee5b1464559c --- /dev/null +++ b/receiver/mongodbreceiver/testdata/integration/Dockerfile.mongodb.7_0 @@ -0,0 +1,6 @@ +FROM mongo:7.0 + +COPY scripts/setup.sh /setup.sh +RUN chmod +x /setup.sh + +EXPOSE 27017 \ No newline at end of file