Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions emissary
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,20 @@ if [ "${DEBUG}" == "true" ]; then
DEBUG_OPTS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=${DEBUG_PORT}"
fi

# Turn on metrics by prepending either of the
# following to the command line before ./emissary:
# METRICS_PORT=someport
# or
# METRICS=true
if [ "${METRICS_PORT}x" != "x" ]; then
METRICS=true
else
METRICS_PORT=9100
fi
if [ "${METRICS}" == "true" ]; then
export JAVA_TOOL_OPTIONS="-javaagent:src/main/agents/jmx_prometheus_javaagent-1.5.0.jar=${METRICS_PORT}:src/main/agents/jmx_prometheus_javaagent.yaml"
fi

# Turn on picocli argument parsing debugging and an echo of the command line
# CMD_DEBUG=true ./emissary <command> <args>
# see Emissary.java for where it is used
Expand Down
8 changes: 8 additions & 0 deletions src/assembly/dist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,13 @@
<include>emissary-knight.png</include>
</includes>
</fileSet>
<fileSet>
<directory>${project.basedir}</directory>
<outputDirectory></outputDirectory>
<includes>
<include>src/main/agents/jmx_prometheus_javaagent.yaml</include>
<include>src/main/agents/jmx_prometheus_javaagent-1.5.0.jar</include>
</includes>
</fileSet>
</fileSets>
</assembly>
Binary file not shown.
3 changes: 3 additions & 0 deletions src/main/agents/jmx_prometheus_javaagent.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# https://prometheus.github.io/jmx_exporter/1.5.0/java-agent/http-mode/#basic-yaml-configuration
rules:
- pattern: ".*"