Skip to content

Commit

Permalink
Enable Prometheus metrics for all versions
Browse files Browse the repository at this point in the history
  • Loading branch information
sbernauer committed Dec 3, 2024
1 parent 2c5bf71 commit d87e8cd
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions rust/operator-binary/src/config/jvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,6 @@ pub fn jvm_config(
-Djavax.net.ssl.trustStorePassword={STACKABLE_TLS_STORE_PASSWORD}
-Djavax.net.ssl.trustStoreType=pkcs12
-Djava.security.properties={RW_CONFIG_DIR_NAME}/{JVM_SECURITY_PROPERTIES}
-javaagent:/stackable/jmx/jmx_prometheus_javaagent.jar={METRICS_PORT}:/stackable/jmx/config.yaml
",
)),
_ => TrinoVersionNotSupportedSnafu {
Expand All @@ -125,6 +123,13 @@ pub fn jvm_config(
.fail(),
}?;

operator_generated.push_str(&formatdoc!("
# Enable the export of Prometheus metrics on port {METRICS_PORT}
-javaagent:/stackable/jmx/jmx_prometheus_javaagent.jar={METRICS_PORT}:/stackable/jmx/config.yaml
"
));

let additional_jvm_arguments = &merged_config.experimental_additional_jvm_arguments;
if !additional_jvm_arguments.is_empty() {
operator_generated.push_str("\n# Additional JVM arguments specified on Custom Resource");
Expand Down Expand Up @@ -213,6 +218,7 @@ mod tests {
-Djavax.net.ssl.trustStoreType=pkcs12
-Djava.security.properties=/stackable/rwconfig/security.properties
# Enable the export of Prometheus metrics on port 8081
-javaagent:/stackable/jmx/jmx_prometheus_javaagent.jar=8081:/stackable/jmx/config.yaml
# Additional JVM arguments specified on Custom Resource
Expand Down

0 comments on commit d87e8cd

Please sign in to comment.