Skip to content

Commit 77e4485

Browse files
committed
rename environment var
1 parent 5fa3e39 commit 77e4485

File tree

1 file changed

+9
-13
lines changed
  • instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/internal/properties

1 file changed

+9
-13
lines changed

instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/internal/properties/SpringConfigProperties.java

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
* any time.
2626
*/
2727
public class SpringConfigProperties implements ConfigProperties {
28-
private final CachedPropertyResolver cachedEnvironment;
28+
private final CachedPropertyResolver environment;
2929

3030
private final ExpressionParser parser;
3131
private final OtlpExporterProperties otlpExporterProperties;
@@ -44,7 +44,7 @@ public SpringConfigProperties(
4444
OtelResourceProperties resourceProperties,
4545
OtelSpringProperties otelSpringProperties,
4646
ConfigProperties otelSdkProperties) {
47-
this.cachedEnvironment = new CachedPropertyResolver(environment);
47+
this.environment = new CachedPropertyResolver(environment);
4848
this.parser = parser;
4949
this.otlpExporterProperties = otlpExporterProperties;
5050
this.resourceProperties = resourceProperties;
@@ -152,7 +152,7 @@ public static ConfigProperties create(
152152
@Override
153153
public String getString(String name) {
154154
String normalizedName = ConfigUtil.normalizeEnvironmentVariableKey(name);
155-
String value = cachedEnvironment.getProperty(normalizedName, String.class);
155+
String value = environment.getProperty(normalizedName, String.class);
156156
if (value == null && normalizedName.equals("otel.exporter.otlp.protocol")) {
157157
// SDK autoconfigure module defaults to `grpc`, but this module aligns with
158158
// recommendation in specification to default to `http/protobuf`
@@ -165,34 +165,31 @@ public String getString(String name) {
165165
@Override
166166
public Boolean getBoolean(String name) {
167167
return or(
168-
cachedEnvironment.getProperty(
169-
ConfigUtil.normalizeEnvironmentVariableKey(name), Boolean.class),
168+
environment.getProperty(ConfigUtil.normalizeEnvironmentVariableKey(name), Boolean.class),
170169
otelSdkProperties.getBoolean(name));
171170
}
172171

173172
@Nullable
174173
@Override
175174
public Integer getInt(String name) {
176175
return or(
177-
cachedEnvironment.getProperty(
178-
ConfigUtil.normalizeEnvironmentVariableKey(name), Integer.class),
176+
environment.getProperty(ConfigUtil.normalizeEnvironmentVariableKey(name), Integer.class),
179177
otelSdkProperties.getInt(name));
180178
}
181179

182180
@Nullable
183181
@Override
184182
public Long getLong(String name) {
185183
return or(
186-
cachedEnvironment.getProperty(ConfigUtil.normalizeEnvironmentVariableKey(name), Long.class),
184+
environment.getProperty(ConfigUtil.normalizeEnvironmentVariableKey(name), Long.class),
187185
otelSdkProperties.getLong(name));
188186
}
189187

190188
@Nullable
191189
@Override
192190
public Double getDouble(String name) {
193191
return or(
194-
cachedEnvironment.getProperty(
195-
ConfigUtil.normalizeEnvironmentVariableKey(name), Double.class),
192+
environment.getProperty(ConfigUtil.normalizeEnvironmentVariableKey(name), Double.class),
196193
otelSdkProperties.getDouble(name));
197194
}
198195

@@ -212,8 +209,7 @@ public List<String> getList(String name) {
212209
}
213210
}
214211

215-
List<String> envValue =
216-
(List<String>) cachedEnvironment.getProperty(normalizedName, List.class);
212+
List<String> envValue = (List<String>) environment.getProperty(normalizedName, List.class);
217213
return or(envValue, otelSdkProperties.getList(name));
218214
}
219215

@@ -240,7 +236,7 @@ public Map<String, String> getMap(String name) {
240236
return specialMap;
241237
}
242238

243-
String value = cachedEnvironment.getProperty(normalizedName);
239+
String value = environment.getProperty(normalizedName);
244240
if (value == null) {
245241
return otelSdkMap;
246242
}

0 commit comments

Comments
 (0)