-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds a local docker-compose env to test JMXFetch inside the agent
- Loading branch information
1 parent
68232f3
commit dcc085c
Showing
3 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
FROM eclipse-temurin:8u382-b05-jdk AS build | ||
|
||
WORKDIR /app | ||
|
||
# Copy the pom.xml and Maven files and install the dependencies | ||
COPY .mvn .mvn/ | ||
COPY pom.xml mvnw mvnw.cmd ./ | ||
|
||
# Use a maven cache to speed up iteration | ||
RUN --mount=type=cache,id=mavenCache,target=/root/.m2,sharing=locked \ | ||
set -eu && \ | ||
./mvnw dependency:resolve; | ||
|
||
# Copy the source code and build the JAR file | ||
COPY src/ src/ | ||
|
||
RUN --mount=type=cache,id=mavenCache,target=/root/.m2,sharing=locked \ | ||
set -eu && \ | ||
./mvnw -DskipTests clean package assembly:single; | ||
|
||
|
||
FROM datadog/agent:7-jmx AS final | ||
|
||
COPY --from=build /app/target/jmxfetch-*-jar-with-dependencies.jar /opt/datadog-agent/bin/agent/dist/jmx/jmxfetch.jar | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
version: "3.9" | ||
|
||
services: | ||
# The docker compose service name is used as the hostname for the misbehaving-jmx-server | ||
# Note it is in the entrypoint as the --rmi-host and in the AD label as the hostname | ||
# that the Agent should reach out to. | ||
jmx-test-server: | ||
build: | ||
context: ./tools/misbehaving-jmx-server/ | ||
# Override entrypoint to specify the docker-compose service name as the RMI host | ||
entrypoint: ["java", "-cp", "misbehavingjmxserver-1.0-SNAPSHOT-jar-with-dependencies.jar", "org.datadog.misbehavingjmxserver.App", "--rmi-host", "jmx-test-server"] | ||
ports: | ||
- "1099:1099" | ||
labels: | ||
com.datadoghq.ad.checks: '{"misbehaving":{"init_config":{"is_jmx":true},"instances":[{"host":"jmx-test-server","port":"1099","collect_default_jvm_metrics":false,"max_returned_metrics":300000,"conf":[{"include":{"domain":"Bohnanza"}}]}]}}' | ||
datadog: | ||
build: | ||
context: . | ||
dockerfile: ./Dockerfile.agentbase | ||
pid: host | ||
environment: | ||
- DD_API_KEY=000000001 | ||
- DD_JMX_TELEMETRY_ENABLED=true | ||
volumes: | ||
- /var/run/docker.sock:/var/run/docker.sock | ||
- /proc/:/host/proc/:ro | ||
- /sys/fs/cgroup:/host/sys/fs/cgroup:ro |