diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc
index c4cb4af190c..bee7a123c96 100644
--- a/CHANGELOG.next.asciidoc
+++ b/CHANGELOG.next.asciidoc
@@ -233,6 +233,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Add collecting AuroraDB metrics in rds metricset. {issue}14142[14142] {pull}16004[16004]
- Reuse connections in SQL module. {pull}16001[16001]
- Improve the `logstash` module (when `xpack.enabled` is set to `true`) to use the override `cluster_uuid` returned by Logstash APIs. {issue}15772[15772] {pull}15795[15795]
+- Add support for Dropwizard metrics 4.1. {pull}16332[16332]
- Add support for NATS 2.1. {pull}16317[16317]
*Packetbeat*
diff --git a/metricbeat/docs/modules/dropwizard.asciidoc b/metricbeat/docs/modules/dropwizard.asciidoc
index de8d439fde0..03b5a863f2d 100644
--- a/metricbeat/docs/modules/dropwizard.asciidoc
+++ b/metricbeat/docs/modules/dropwizard.asciidoc
@@ -10,7 +10,7 @@ This is the http://dropwizard.io[Dropwizard] module. The default metricset is `c
[float]
=== Compatibility
-The Dropwizard module is tested with dropwizard metrics 3.1.0.
+The Dropwizard module is tested with dropwizard metrics 3.2.6, 4.0.0 and 4.1.2.
[float]
diff --git a/metricbeat/module/dropwizard/_meta/Dockerfile b/metricbeat/module/dropwizard/_meta/Dockerfile
index 668844b9ef7..3098a420da1 100644
--- a/metricbeat/module/dropwizard/_meta/Dockerfile
+++ b/metricbeat/module/dropwizard/_meta/Dockerfile
@@ -1,9 +1,16 @@
-ARG MAVEN_VERSION
-FROM maven:${MAVEN_VERSION}
+FROM maven:3.6-jdk-8
+
+# Variables used in pom.xml
+ARG DROPWIZARD_VERSION
+
+# Build the deployable war
COPY test /test
+WORKDIR /test
+RUN mvn verify
+
+# Build the final image
+FROM jetty:9.4.26-jre8
+COPY --from=0 /test/target/test-1.0-SNAPSHOT.war /var/lib/jetty/webapps/test.war
HEALTHCHECK --interval=1s --retries=90 CMD curl -f http://localhost:8080/test/helloworld
EXPOSE 8080
-
-WORKDIR /test
-CMD mvn jetty:run
diff --git a/metricbeat/module/dropwizard/_meta/docs.asciidoc b/metricbeat/module/dropwizard/_meta/docs.asciidoc
index 6f9f28bc8cc..5f20730bc41 100644
--- a/metricbeat/module/dropwizard/_meta/docs.asciidoc
+++ b/metricbeat/module/dropwizard/_meta/docs.asciidoc
@@ -3,4 +3,4 @@ This is the http://dropwizard.io[Dropwizard] module. The default metricset is `c
[float]
=== Compatibility
-The Dropwizard module is tested with dropwizard metrics 3.1.0.
+The Dropwizard module is tested with dropwizard metrics 3.2.6, 4.0.0 and 4.1.2.
diff --git a/metricbeat/module/dropwizard/_meta/supported-versions.yml b/metricbeat/module/dropwizard/_meta/supported-versions.yml
new file mode 100644
index 00000000000..0888fc679e7
--- /dev/null
+++ b/metricbeat/module/dropwizard/_meta/supported-versions.yml
@@ -0,0 +1,4 @@
+variants:
+ - DROPWIZARD_VERSION: 4.1.2
+ - DROPWIZARD_VERSION: 4.0.0
+ - DROPWIZARD_VERSION: 3.2.6
diff --git a/metricbeat/module/dropwizard/_meta/test/pom.xml b/metricbeat/module/dropwizard/_meta/test/pom.xml
index 5efba5fb613..e8d4dfb6c81 100644
--- a/metricbeat/module/dropwizard/_meta/test/pom.xml
+++ b/metricbeat/module/dropwizard/_meta/test/pom.xml
@@ -17,24 +17,7 @@
io.dropwizard.metrics
metrics-servlets
- 4.0.0
+ ${env.DROPWIZARD_VERSION}
-
-
-
- org.apache.maven.plugins
- maven-compiler-plugin
- 2.3.2
-
-
- 1.6
-
-
-
- org.mortbay.jetty
- maven-jetty-plugin
-
-
-
diff --git a/metricbeat/module/dropwizard/docker-compose.yml b/metricbeat/module/dropwizard/docker-compose.yml
index 28347ef8ba2..4cb6fbd13f0 100644
--- a/metricbeat/module/dropwizard/docker-compose.yml
+++ b/metricbeat/module/dropwizard/docker-compose.yml
@@ -2,10 +2,10 @@ version: '2.3'
services:
dropwizard:
- image: docker.elastic.co/integrations-ci/beats-dropwizard:${MAVEN_VERSION:-3.3-jdk-8}-1
+ image: docker.elastic.co/integrations-ci/beats-dropwizard:${DROPWIZARD_VERSION:-4.1.2}-1
build:
context: ./_meta
args:
- MAVEN_VERSION: ${MAVEN_VERSION:-3.3-jdk-8}
+ DROPWIZARD_VERSION: ${DROPWIZARD_VERSION:-4.1.2}
ports:
- 8080
diff --git a/metricbeat/module/dropwizard/test_dropwizard.py b/metricbeat/module/dropwizard/test_dropwizard.py
index 767fe4e32c7..8e771c511c2 100644
--- a/metricbeat/module/dropwizard/test_dropwizard.py
+++ b/metricbeat/module/dropwizard/test_dropwizard.py
@@ -6,6 +6,7 @@
import metricbeat
+@metricbeat.parameterized_with_supported_versions
class Test(metricbeat.BaseTest):
COMPOSE_SERVICES = ['dropwizard']