Skip to content

Commit 61460af

Browse files
authored
Rename AppSignals configs with backward compatibility (#744)
* Rename AppSignals configs with backwards compatibility * update config name in contract tests * fixing related javadoc
1 parent 757e2ef commit 61460af

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

appsignals-tests/contract-tests/src/test/java/software/amazon/opentelemetry/appsignals/test/base/ContractTestBase.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@ public abstract class ContractTestBase {
7878
.waitingFor(getApplicationWaitCondition())
7979
.withEnv("JAVA_TOOL_OPTIONS", "-javaagent:/opentelemetry-javaagent-all.jar")
8080
.withEnv("OTEL_METRIC_EXPORT_INTERVAL", "100") // 100 ms
81-
.withEnv("OTEL_SMP_ENABLED", "true")
81+
.withEnv("OTEL_AWS_APP_SIGNALS_ENABLED", "true")
8282
.withEnv("OTEL_METRICS_EXPORTER", "none")
8383
.withEnv("OTEL_BSP_SCHEDULE_DELAY", "0") // Don't wait to export spans to the collector
8484
.withEnv(
85-
"OTEL_AWS_SMP_EXPORTER_ENDPOINT",
85+
"OTEL_AWS_APP_SIGNALS_EXPORTER_ENDPOINT",
8686
"http://" + COLLECTOR_HOSTNAME + ":" + COLLECTOR_PORT)
8787
.withEnv(
8888
"OTEL_EXPORTER_OTLP_TRACES_ENDPOINT",

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@
4848
* <li>Add AwsMetricAttributesSpanExporter to add more attributes to all spans.
4949
* </ul>
5050
*
51-
* <p>You can control when these customizations are applied using the property otel.smp.enabled or
52-
* the environment variable OTEL_SMP_ENABLED. This flag is enabled by default.
51+
* <p>You can control when these customizations are applied using the property
52+
* otel.aws.app.signals.enabled or the environment variable OTEL_AWS_APP_SIGNALS_ENABLED. This flag
53+
* is disabled by default.
5354
*/
5455
public class AwsAppSignalsCustomizerProvider implements AutoConfigurationCustomizerProvider {
5556
private static final Duration DEFAULT_METRIC_EXPORT_INTERVAL = Duration.ofMinutes(1);
@@ -63,7 +64,8 @@ public void customize(AutoConfigurationCustomizer autoConfiguration) {
6364
}
6465

6566
private boolean isSmpEnabled(ConfigProperties configProps) {
66-
return configProps.getBoolean("otel.smp.enabled", false);
67+
return configProps.getBoolean(
68+
"otel.aws.app.signals.enabled", configProps.getBoolean("otel.smp.enabled", false));
6769
}
6870

6971
private Sampler customizeSampler(Sampler sampler, ConfigProperties configProps) {
@@ -79,7 +81,8 @@ private SdkTracerProviderBuilder customizeTracerProviderBuilder(
7981
logger.info("Span Metrics Processor enabled");
8082
String smpEndpoint =
8183
configProps.getString(
82-
"otel.aws.smp.exporter.endpoint", "http://cloudwatch-agent.amazon-cloudwatch:4317");
84+
"otel.aws.app.signals.exporter.endpoint",
85+
configProps.getString("otel.aws.smp.exporter.endpoint", "http://localhost:4315"));
8386
Duration exportInterval =
8487
configProps.getDuration("otel.metric.export.interval", DEFAULT_METRIC_EXPORT_INTERVAL);
8588
logger.log(Level.FINE, String.format("Span Metrics endpoint: %s", smpEndpoint));

0 commit comments

Comments
 (0)