Skip to content

Commit

Permalink
Disable jmx metrics if APM_METRICS_FILTER_DENY_ALL is set to true, me…
Browse files Browse the repository at this point in the history
…thod 1
  • Loading branch information
ekremsekerci committed Feb 5, 2025
1 parent bb6afc5 commit 1a5c56d
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions buildpack/telemetry/datadog.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,9 @@ def _set_up_dd_java_agent(m2ee, model_version, runtime_version, jmx_config_files

# Extend with JMX options
dd_jmxfetch_enabled = "true"
if deny_all_apm_metrics:
if deny_all_apm_metrics():
logging.error("####### deny all is set, disabling jmx") ## todo: remove this
dd_jmxfetch_enabled = "true" ## todo: update to false
dd_jmxfetch_enabled = "false" ## todo: update to false

util.upsert_javaopts(
m2ee,
Expand Down Expand Up @@ -499,9 +499,9 @@ def update_config(
},
)

if not deny_all_apm_metrics():
logging.error(
"####### deny all is NOT set, enabling extra jmx") ## todo: remove this
if 1==1:
#if not deny_all_apm_metrics():
#logging.error("####### deny all is NOT set, enabling extra jmx") ## todo: remove this
# Set up runtime JMX configuration
with open(_get_jmx_conf_file(), "w") as file_handler:
file_handler.write(
Expand All @@ -513,8 +513,7 @@ def update_config(
)
jmx_config_files.append(_get_jmx_conf_file())
else:
logging.error(
"####### deny all is set, disabling extra jmx") ## todo: remove this else block
logging.error("####### deny all is set, disabling extra jmx") ## todo: remove this else block

# Set up Datadog Java Trace Agent
_set_up_dd_java_agent(
Expand Down

0 comments on commit 1a5c56d

Please sign in to comment.