@@ -6,7 +6,7 @@ use stackable_operator::{
66
77use crate :: crd:: {
88 JVM_SECURITY_PROPERTIES_FILE , LOG4J_CONFIG_FILE , LOGBACK_CONFIG_FILE , LoggingFramework ,
9- STACKABLE_CONFIG_DIR , STACKABLE_LOG_CONFIG_DIR ,
9+ METRICS_PORT , STACKABLE_CONFIG_DIR , STACKABLE_LOG_CONFIG_DIR ,
1010 v1alpha1:: { ZookeeperCluster , ZookeeperConfig , ZookeeperConfigFragment } ,
1111} ;
1212
@@ -36,6 +36,9 @@ fn construct_jvm_args(
3636
3737 let jvm_args = vec ! [
3838 format!( "-Djava.security.properties={STACKABLE_CONFIG_DIR}/{JVM_SECURITY_PROPERTIES_FILE}" ) ,
39+ format!(
40+ "-javaagent:/stackable/jmx/jmx_prometheus_javaagent.jar={METRICS_PORT}:/stackable/jmx/server.yaml"
41+ ) ,
3942 match logging_framework {
4043 LoggingFramework :: LOG4J => {
4144 format!( "-Dlog4j.configuration=file:{STACKABLE_LOG_CONFIG_DIR}/{LOG4J_CONFIG_FILE}" )
@@ -120,6 +123,7 @@ mod tests {
120123 assert_eq ! (
121124 non_heap_jvm_args,
122125 "-Djava.security.properties=/stackable/config/security.properties \
126+ -javaagent:/stackable/jmx/jmx_prometheus_javaagent.jar=9505:/stackable/jmx/server.yaml \
123127 -Dlogback.configurationFile=/stackable/log_config/logback.xml"
124128 ) ;
125129 assert_eq ! ( zk_server_heap_env, "409" ) ;
@@ -164,6 +168,7 @@ mod tests {
164168 assert_eq ! (
165169 non_heap_jvm_args,
166170 "-Djava.security.properties=/stackable/config/security.properties \
171+ -javaagent:/stackable/jmx/jmx_prometheus_javaagent.jar=9505:/stackable/jmx/server.yaml \
167172 -Dlogback.configurationFile=/stackable/log_config/logback.xml \
168173 -Dhttps.proxyHost=proxy.my.corp \
169174 -Djava.net.preferIPv4Stack=true \
0 commit comments