Package jmx prometheus exporter to be run as a Java Agent#10
Open
sidps wants to merge 1 commit intoStreamingMicroservicesPlatform:masterfrom
Open
Package jmx prometheus exporter to be run as a Java Agent#10sidps wants to merge 1 commit intoStreamingMicroservicesPlatform:masterfrom
sidps wants to merge 1 commit intoStreamingMicroservicesPlatform:masterfrom
Conversation
Author
|
I've tested that this works with docker-compose, by copying over the jar and sample config into the kafka container. The docker-compose.yaml looks something like this: ---
version: "3.7"
services:
jmx-jar-init:
image: <image-we-just-built>
entrypoint:
- /bin/bash
- -c
- |
cp jmx_prometheus_javaagent.jar /jmx-jar/;
cp example_configs/kafka-2_0_0.yml /jmx-jar/
volumes:
- type: volume
source: jmx-jar
target: /jmx-jar
kafka:
image: solsson/kafka:2.3.0@sha256:b59603a8c0645f792fb54e9571500e975206352a021d6a116b110945ca6c3a1d
entrypoint:
- /bin/bash
- -c
- |
until test -f "/jmx-jar/jmx_prometheus_javaagent.jar"; do
sleep 3;
done;
until test -f "/jmx-jar/kafka-2_0_0.yml"; do
sleep 3;
done;
./bin/kafka-server-start.sh /etc/kafka/server.properties
environment:
- EXTRA_ARGS=-javaagent:/jmx-jar/jmx_prometheus_javaagent.jar=8080:/jmx-jar/kafka-2_0_0.yml
volumes:
- type: volume
source: jmx-jar
target: /jmx-jar
network_mode: host
depends_on:
- zookeeper
- jmx-jar-init
zookeeper:
image: solsson/kafka:2.3.0@sha256:b59603a8c0645f792fb54e9571500e975206352a021d6a116b110945ca6c3a1d
network_mode: host
entrypoint:
- ./bin/zookeeper-server-start.sh
- /etc/kafka/zookeeper.properties
volumes:
jmx-jar:And then metrics were exposed at localhost:8080 |
Author
|
This would imply a mutation on the tag for the existing jmx exporter image, because a new layer has been introduced. Would it make sense to bump the version? We're currently pointing at 0.12 of the jmx exporter, while 0.13 has been released. |
sidps
commented
Jun 25, 2020
| \ | ||
| apt-get purge -y --auto-remove $buildDeps; \ | ||
| rm -rf /var/lib/apt/lists/*; \ | ||
| rm -rf /var/log/dpkg.log /var/log/alternatives.log /var/log/apt |
Author
There was a problem hiding this comment.
This isn't exactly a diff, just copy-pasta from above with the appropriate selection in find.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is part of addressing Yolean/kubernetes-kafka#322 (comment)
This solution involves building the javaagent jar and stashing it in a separate docker image, and may be built with
docker build --target javaagent.The image that's used for the exporter sidecar can be built with
docker build --target httpserver.