Skip to content

Conversation

@memny
Copy link
Collaborator

@memny memny commented Oct 24, 2025

This change exposes jvm (plus other metrics available in jmx) in the prometheus format via an http endpoint. It is disabled by default. It's worth noting that the jar is not included on the class path and needs to be explicitly included/referenced.

I'm looking for feedback on how best to integrate this functionality.

  • is this the correct repository?
  • this probably needs to be incorporated with the assembly portion of the build. This is something I'm not familiar with so if this is the correct way forward guidance on where to start would be appreciated.

@memny memny self-assigned this Oct 24, 2025
Copy link
Collaborator

@dev-mlb dev-mlb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few observations:

% mvn clean package -Pdist
% cd target
% tar xvf emissary-8.36.0-SNAPSHOT-dist.tar.gz
% METRICS=true ./emissary server -a 1
Picked up JAVA_TOOL_OPTIONS: -javaagent:src/main/resources/metrics/jmx_prometheus_javaagent-1.5.0.jar=9100:src/main/resources/metrics/exporter.yaml
Error opening zip file or JAR manifest missing : src/main/resources/metrics/jmx_prometheus_javaagent-1.5.0.jar
Error occurred during initialization of VM
agent library failed to init: instrument

Also, do we want to check in this jar to our repo?? Wonder if we could use the dependency or exec plugin to pull this jar on build. We may need to pull this out of the resources dir and create a src/main/metrics (or agents) directory, similar to the config directory. Then we can copy it like the config dir, see the src/assembly/dist.xml.

@memny
Copy link
Collaborator Author

memny commented Oct 28, 2025

Error opening zip file or JAR manifest missing : src/main/resources/metrics/jmx_prometheus_javaagent-1.5.0.jar
Error occurred during initialization of VM

I expected this not to work.

Also, do we want to check in this jar to our repo?? Wonder if we could use the dependency or exec plugin to pull this jar on build.

The jar file doesn't live in the public maven repos currently (at least I couldn't find it) so I have an ick feeling about adding it to our private one.

We may need to pull this out of the resources dir and create a src/main/metrics (or agents) directory, similar to the config directory.

I like the idea of a src/main/agents directory as long as everyone else is on board with it.

Then we can copy it like the config dir, see the src/assembly/dist.xml.

I made the recommended updates and it seems to work.

@cfkoehler
Copy link
Collaborator

This looks good and makes sense to me. @jpdahlke do you have an opinion or feedback on including the jar in the repo?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants