Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose jmxfetch "initial refresh beans period" config. #2659

Merged
merged 1 commit into from
Apr 26, 2021
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ private static void run(final StatsDClientManager statsDClientManager, final Con
final List<String> metricsConfigs = config.getJmxFetchMetricsConfigs();
final Integer checkPeriod = config.getJmxFetchCheckPeriod();
final Integer refreshBeansPeriod = config.getJmxFetchRefreshBeansPeriod();
final Integer initialRefreshBeansPeriod = config.getJmxFetchInitialRefreshBeansPeriod();
final Map<String, String> globalTags = config.getMergedJmxTags();

String host =
Expand All @@ -73,12 +74,13 @@ private static void run(final StatsDClientManager statsDClientManager, final Con

if (log.isDebugEnabled()) {
log.debug(
"JMXFetch config: {} {} {} {} {} {} {} {}",
"JMXFetch config: {} {} {} {} {} {} {} {} {}",
jmxFetchConfigDir,
jmxFetchConfigs,
internalMetricsConfigs,
metricsConfigs,
checkPeriod,
initialRefreshBeansPeriod,
refreshBeansPeriod,
globalTags,
"statsd:" + host + ":" + port);
Expand All @@ -98,6 +100,7 @@ private static void run(final StatsDClientManager statsDClientManager, final Con
.instanceConfigResources(DEFAULT_CONFIGS)
.metricConfigResources(internalMetricsConfigs)
.metricConfigFiles(metricsConfigs)
.initialRefreshBeansPeriod(initialRefreshBeansPeriod)
.refreshBeansPeriod(refreshBeansPeriod)
.globalTags(globalTags)
.reporter(new AgentStatsdReporter(statsd));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ public final class JmxFetchConfig {
public static final String JMX_FETCH_CONFIG = "jmxfetch.config";
@Deprecated public static final String JMX_FETCH_METRICS_CONFIGS = "jmxfetch.metrics-configs";
public static final String JMX_FETCH_CHECK_PERIOD = "jmxfetch.check-period";
public static final String JMX_FETCH_INITIAL_REFRESH_BEANS_PERIOD =
"jmxfetch.initial-refresh-beans-period";
public static final String JMX_FETCH_REFRESH_BEANS_PERIOD = "jmxfetch.refresh-beans-period";
public static final String JMX_FETCH_STATSD_HOST = "jmxfetch.statsd.host";
public static final String JMX_FETCH_STATSD_PORT = "jmxfetch.statsd.port";
Expand Down
10 changes: 10 additions & 0 deletions internal-api/src/main/java/datadog/trace/api/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
import static datadog.trace.api.config.JmxFetchConfig.JMX_FETCH_CONFIG;
import static datadog.trace.api.config.JmxFetchConfig.JMX_FETCH_CONFIG_DIR;
import static datadog.trace.api.config.JmxFetchConfig.JMX_FETCH_ENABLED;
import static datadog.trace.api.config.JmxFetchConfig.JMX_FETCH_INITIAL_REFRESH_BEANS_PERIOD;
import static datadog.trace.api.config.JmxFetchConfig.JMX_FETCH_METRICS_CONFIGS;
import static datadog.trace.api.config.JmxFetchConfig.JMX_FETCH_REFRESH_BEANS_PERIOD;
import static datadog.trace.api.config.JmxFetchConfig.JMX_FETCH_START_DELAY;
Expand Down Expand Up @@ -288,6 +289,7 @@ public class Config {
private final List<String> jmxFetchConfigs;
@Deprecated private final List<String> jmxFetchMetricsConfigs;
private final Integer jmxFetchCheckPeriod;
private final Integer jmxFetchInitialRefreshBeansPeriod;
private final Integer jmxFetchRefreshBeansPeriod;
private final String jmxFetchStatsdHost;
private final Integer jmxFetchStatsdPort;
Expand Down Expand Up @@ -584,6 +586,8 @@ private Config(final String runtimeId, final ConfigProvider configProvider) {
jmxFetchConfigs = configProvider.getList(JMX_FETCH_CONFIG);
jmxFetchMetricsConfigs = configProvider.getList(JMX_FETCH_METRICS_CONFIGS);
jmxFetchCheckPeriod = configProvider.getInteger(JMX_FETCH_CHECK_PERIOD);
jmxFetchInitialRefreshBeansPeriod =
configProvider.getInteger(JMX_FETCH_INITIAL_REFRESH_BEANS_PERIOD);
jmxFetchRefreshBeansPeriod = configProvider.getInteger(JMX_FETCH_REFRESH_BEANS_PERIOD);
jmxFetchStatsdHost = configProvider.getString(JMX_FETCH_STATSD_HOST);
jmxFetchStatsdPort =
Expand Down Expand Up @@ -928,6 +932,10 @@ public Integer getJmxFetchRefreshBeansPeriod() {
return jmxFetchRefreshBeansPeriod;
}

public Integer getJmxFetchInitialRefreshBeansPeriod() {
return jmxFetchInitialRefreshBeansPeriod;
}

public String getJmxFetchStatsdHost() {
return jmxFetchStatsdHost;
}
Expand Down Expand Up @@ -1693,6 +1701,8 @@ public String toString() {
+ jmxFetchMetricsConfigs
+ ", jmxFetchCheckPeriod="
+ jmxFetchCheckPeriod
+ ", jmxFetchInitialRefreshBeansPeriod="
+ jmxFetchInitialRefreshBeansPeriod
+ ", jmxFetchRefreshBeansPeriod="
+ jmxFetchRefreshBeansPeriod
+ ", jmxFetchStatsdHost='"
Expand Down