Skip to content

Commit ec15a77

Browse files
committed
fixing gate for jmx enabledment
1 parent 5804526 commit ec15a77

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/AwsJMXMetricsCustomizerProvider.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,16 @@
3434

3535
/**
3636
* You can control when these customizations are applied using both the properties -
37-
* otel.aws.jmx.enabled and otel.aws.jmx.exporter.metrics.endpoint or the environment variable
38-
* AWS_JMX_ENABLED_CONFIG and AWS_JMX_EXPORTER_ENDPOINT_CONFIG. These flags are disabled by default.
37+
* otel.jmx.enabled and otel.aws.jmx.exporter.metrics.endpoint or the environment variable
38+
* OTEL_JMX_ENABLED_CONFIG and AWS_JMX_EXPORTER_ENDPOINT_CONFIG. These flags are disabled by
39+
* default.
3940
*/
4041
public class AwsJMXMetricsCustomizerProvider implements AutoConfigurationCustomizerProvider {
4142
private static final Duration DEFAULT_METRIC_EXPORT_INTERVAL = Duration.ofMinutes(1);
4243
private static final Logger logger =
4344
Logger.getLogger(AwsJMXMetricsCustomizerProvider.class.getName());
4445

45-
private static final String AWS_JMX_ENABLED_CONFIG = "otel.aws.jmx.enabled";
46+
private static final String OTEL_JMX_ENABLED_CONFIG = "otel.jmx.enabled";
4647
private static final String AWS_JMX_EXPORTER_ENDPOINT_CONFIG =
4748
"otel.aws.jmx.exporter.metrics.endpoint";
4849

@@ -51,7 +52,7 @@ public void customize(AutoConfigurationCustomizer autoConfiguration) {
5152
}
5253

5354
private boolean isOtelJMXEnabled(ConfigProperties configProps) {
54-
return configProps.getBoolean(AWS_JMX_ENABLED_CONFIG, false)
55+
return configProps.getBoolean(OTEL_JMX_ENABLED_CONFIG, true)
5556
&& configProps.getString(AWS_JMX_EXPORTER_ENDPOINT_CONFIG, "") != "";
5657
}
5758

@@ -90,8 +91,7 @@ public MetricExporter createExporter(ConfigProperties configProps) {
9091

9192
String otelJMXEndpoint;
9293
if (protocol.equals(OtlpConfigUtil.PROTOCOL_HTTP_PROTOBUF)) {
93-
otelJMXEndpoint =
94-
configProps.getString(AWS_JMX_EXPORTER_ENDPOINT_CONFIG, "http://localhost:4314");
94+
otelJMXEndpoint = configProps.getString(AWS_JMX_EXPORTER_ENDPOINT_CONFIG);
9595
logger.log(
9696
Level.FINE, String.format("AWS JMX metrics export endpoint: %s", otelJMXEndpoint));
9797
return OtlpHttpMetricExporter.builder()

0 commit comments

Comments
 (0)