5555 * otel.aws.application.signals.enabled or the environment variable
5656 * OTEL_AWS_APPLICATION_SIGNALS_ENABLED. This flag is disabled by default.
5757 */
58- public class AwsAppSignalsCustomizerProvider implements AutoConfigurationCustomizerProvider {
58+ public class AwsApplicationSignalsCustomizerProvider
59+ implements AutoConfigurationCustomizerProvider {
5960 private static final Duration DEFAULT_METRIC_EXPORT_INTERVAL = Duration .ofMinutes (1 );
6061 private static final Logger logger =
61- Logger .getLogger (AwsAppSignalsCustomizerProvider .class .getName ());
62+ Logger .getLogger (AwsApplicationSignalsCustomizerProvider .class .getName ());
6263
6364 private static final String SMP_ENABLED_CONFIG = "otel.smp.enabled" ;
6465 private static final String APP_SIGNALS_ENABLED_CONFIG = "otel.aws.app.signals.enabled" ;
@@ -76,42 +77,44 @@ public void customize(AutoConfigurationCustomizer autoConfiguration) {
7677 autoConfiguration .addSpanExporterCustomizer (this ::customizeSpanExporter );
7778 }
7879
79- private boolean isAppSignalsEnabled (ConfigProperties configProps ) {
80+ private boolean isApplicationSignalsEnabled (ConfigProperties configProps ) {
8081 return configProps .getBoolean (
8182 APPLICATION_SIGNALS_ENABLED_CONFIG ,
8283 configProps .getBoolean (
8384 APP_SIGNALS_ENABLED_CONFIG , configProps .getBoolean (SMP_ENABLED_CONFIG , false )));
8485 }
8586
8687 private Sampler customizeSampler (Sampler sampler , ConfigProperties configProps ) {
87- if (isAppSignalsEnabled (configProps )) {
88+ if (isApplicationSignalsEnabled (configProps )) {
8889 return AlwaysRecordSampler .create (sampler );
8990 }
9091 return sampler ;
9192 }
9293
9394 private SdkTracerProviderBuilder customizeTracerProviderBuilder (
9495 SdkTracerProviderBuilder tracerProviderBuilder , ConfigProperties configProps ) {
95- if (isAppSignalsEnabled (configProps )) {
96- logger .info ("AWS AppSignals enabled" );
96+ if (isApplicationSignalsEnabled (configProps )) {
97+ logger .info ("AWS Application Signals enabled" );
9798 Duration exportInterval =
9899 configProps .getDuration ("otel.metric.export.interval" , DEFAULT_METRIC_EXPORT_INTERVAL );
99100 logger .log (
100- Level .FINE , String .format ("AppSignals Metrics export interval: %s" , exportInterval ));
101+ Level .FINE ,
102+ String .format ("AWS Application Signals Metrics export interval: %s" , exportInterval ));
101103 // Cap export interval to 60 seconds. This is currently required for metrics-trace correlation
102104 // to work correctly.
103105 if (exportInterval .compareTo (DEFAULT_METRIC_EXPORT_INTERVAL ) > 0 ) {
104106 exportInterval = DEFAULT_METRIC_EXPORT_INTERVAL ;
105107 logger .log (
106108 Level .INFO ,
107- String .format ("AWS AppSignals metrics export interval capped to %s" , exportInterval ));
109+ String .format (
110+ "AWS Application Signals metrics export interval capped to %s" , exportInterval ));
108111 }
109112 // Construct and set local and remote attributes span processor
110113 tracerProviderBuilder .addSpanProcessor (
111114 AttributePropagatingSpanProcessorBuilder .create ().build ());
112115 // Construct meterProvider
113116 MetricExporter metricsExporter =
114- AppSignalsExporterProvider .INSTANCE .createExporter (configProps );
117+ ApplicationSignalsExporterProvider .INSTANCE .createExporter (configProps );
115118
116119 MetricReader metricReader =
117120 PeriodicMetricReader .builder (metricsExporter ).setInterval (exportInterval ).build ();
@@ -121,7 +124,7 @@ private SdkTracerProviderBuilder customizeTracerProviderBuilder(
121124 .setResource (ResourceHolder .getResource ())
122125 .registerMetricReader (metricReader )
123126 .build ();
124- // Construct and set AppSignals metrics processor
127+ // Construct and set application signals metrics processor
125128 SpanProcessor spanMetricsProcessor =
126129 AwsSpanMetricsProcessorBuilder .create (meterProvider , ResourceHolder .getResource ())
127130 .build ();
@@ -132,7 +135,7 @@ private SdkTracerProviderBuilder customizeTracerProviderBuilder(
132135
133136 private SpanExporter customizeSpanExporter (
134137 SpanExporter spanExporter , ConfigProperties configProps ) {
135- if (isAppSignalsEnabled (configProps )) {
138+ if (isApplicationSignalsEnabled (configProps )) {
136139 return AwsMetricAttributesSpanExporterBuilder .create (
137140 spanExporter , ResourceHolder .getResource ())
138141 .build ();
@@ -141,43 +144,49 @@ private SpanExporter customizeSpanExporter(
141144 return spanExporter ;
142145 }
143146
144- private enum AppSignalsExporterProvider {
147+ private enum ApplicationSignalsExporterProvider {
145148 INSTANCE ;
146149
147150 public MetricExporter createExporter (ConfigProperties configProps ) {
148151 String protocol =
149152 OtlpConfigUtil .getOtlpProtocol (OtlpConfigUtil .DATA_TYPE_METRICS , configProps );
150- logger .log (Level .FINE , String .format ("AppSignals export protocol: %s" , protocol ));
153+ logger .log (
154+ Level .FINE , String .format ("AWS Application Signals export protocol: %s" , protocol ));
151155
152- String appSignalsEndpoint ;
156+ String applicationSignalsEndpoint ;
153157 if (protocol .equals (OtlpConfigUtil .PROTOCOL_HTTP_PROTOBUF )) {
154- appSignalsEndpoint =
158+ applicationSignalsEndpoint =
155159 configProps .getString (
156160 APPLICATION_SIGNALS_EXPORTER_ENDPOINT_CONFIG ,
157161 configProps .getString (
158162 APP_SIGNALS_EXPORTER_ENDPOINT_CONFIG ,
159163 configProps .getString (SMP_EXPORTER_ENDPOINT_CONFIG , "http://localhost:4316/v1/metrics" )));
160- logger .log (Level .FINE , String .format ("AppSignals export endpoint: %s" , appSignalsEndpoint ));
164+ logger .log (
165+ Level .FINE ,
166+ String .format ("AWS Application Signals export endpoint: %s" , applicationSignalsEndpoint ));
161167 return OtlpHttpMetricExporter .builder ()
162- .setEndpoint (appSignalsEndpoint )
168+ .setEndpoint (applicationSignalsEndpoint )
163169 .setDefaultAggregationSelector (this ::getAggregation )
164170 .setAggregationTemporalitySelector (AggregationTemporalitySelector .deltaPreferred ())
165171 .build ();
166172 } else if (protocol .equals (OtlpConfigUtil .PROTOCOL_GRPC )) {
167- appSignalsEndpoint =
173+ applicationSignalsEndpoint =
168174 configProps .getString (
169175 APPLICATION_SIGNALS_EXPORTER_ENDPOINT_CONFIG ,
170176 configProps .getString (
171177 APP_SIGNALS_EXPORTER_ENDPOINT_CONFIG ,
172178 configProps .getString (SMP_EXPORTER_ENDPOINT_CONFIG , "http://localhost:4315" )));
173- logger .log (Level .FINE , String .format ("AppSignals export endpoint: %s" , appSignalsEndpoint ));
179+ logger .log (
180+ Level .FINE ,
181+ String .format ("AWS Application Signals export endpoint: %s" , applicationSignalsEndpoint ));
174182 return OtlpGrpcMetricExporter .builder ()
175- .setEndpoint (appSignalsEndpoint )
183+ .setEndpoint (applicationSignalsEndpoint )
176184 .setDefaultAggregationSelector (this ::getAggregation )
177185 .setAggregationTemporalitySelector (AggregationTemporalitySelector .deltaPreferred ())
178186 .build ();
179187 }
180- throw new ConfigurationException ("Unsupported AppSignals export protocol: " + protocol );
188+ throw new ConfigurationException (
189+ "Unsupported AWS Application Signals export protocol: " + protocol );
181190 }
182191
183192 private Aggregation getAggregation (InstrumentType instrumentType ) {
0 commit comments