Skip to content

Commit 19e2fb5

Browse files
committed
pr review
1 parent 9219a49 commit 19e2fb5

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

gcp-auth-extension/src/main/java/io/opentelemetry/contrib/gcp/auth/ConfigurableOption.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,7 @@ String getUserReadableName() {
9292
}
9393

9494
/**
95-
* Retrieves the configured value for this option. This method checks the environment variable
96-
* first and then the system property.
95+
* Retrieves the configured value for this option.
9796
*
9897
* @return The configured value as a string, or throws an exception if not configured.
9998
* @throws ConfigurationException if neither the environment variable nor the system property is
@@ -113,10 +112,9 @@ <T> T getRequiredConfiguredValue(
113112
}
114113

115114
/**
116-
* Retrieves the configured value for this option. This method checks the environment variable
117-
* first and then the system property.
115+
* Retrieves the configured value for this option.
118116
*
119-
* @return The configured value as a string, or throws an exception if not configured.
117+
* @return The configured value as a string, or {@code null} if not configured.
120118
*/
121119
@Nullable
122120
<T> T getConfiguredValue(

gcp-auth-extension/src/main/java/io/opentelemetry/contrib/gcp/auth/GcpAuthCustomizerProvider.java renamed to gcp-auth-extension/src/main/java/io/opentelemetry/contrib/gcp/auth/GcpAuthDeclarativeConfigurationCustomizerProvider.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
import com.google.auth.oauth2.GoogleCredentials;
1313
import com.google.auto.service.AutoService;
14+
import com.google.common.annotations.VisibleForTesting;
1415
import io.opentelemetry.contrib.sdk.autoconfigure.ConfigPropertiesUtil;
1516
import io.opentelemetry.contrib.sdk.autoconfigure.DeclarativeConfigPropertiesBridgeBuilder;
1617
import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties;
@@ -37,7 +38,7 @@
3738
import javax.annotation.Nullable;
3839

3940
@AutoService(DeclarativeConfigurationCustomizerProvider.class)
40-
public class GcpAuthCustomizerProvider implements DeclarativeConfigurationCustomizerProvider {
41+
public class GcpAuthDeclarativeConfigurationCustomizerProvider implements DeclarativeConfigurationCustomizerProvider {
4142

4243
static final String SIGNAL_TARGET_WARNING_YAML_FIX_SUGGESTION =
4344
String.format(

gcp-auth-extension/src/test/java/io/opentelemetry/contrib/gcp/auth/GcpAuthCustomizerProviderTest.java renamed to gcp-auth-extension/src/test/java/io/opentelemetry/contrib/gcp/auth/GcpAuthDeclarativeConfigurationCustomizerProviderTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
package io.opentelemetry.contrib.gcp.auth;
77

8-
import static io.opentelemetry.contrib.gcp.auth.GcpAuthCustomizerProvider.SIGNAL_TARGET_WARNING_YAML_FIX_SUGGESTION;
8+
import static io.opentelemetry.contrib.gcp.auth.GcpAuthDeclarativeConfigurationCustomizerProvider.SIGNAL_TARGET_WARNING_YAML_FIX_SUGGESTION;
99
import static org.assertj.core.api.Assertions.assertThat;
1010
import static org.mockito.Mockito.mock;
1111
import static org.mockito.Mockito.when;
@@ -20,7 +20,7 @@
2020
import java.util.Collections;
2121
import org.junit.jupiter.api.Test;
2222

23-
class GcpAuthCustomizerProviderTest {
23+
class GcpAuthDeclarativeConfigurationCustomizerProviderTest {
2424

2525
@Test
2626
void declarativeConfig() throws IOException {
@@ -51,7 +51,7 @@ void declarativeConfig() throws IOException {
5151
OpenTelemetryConfigurationModel model =
5252
DeclarativeConfiguration.parse(
5353
new ByteArrayInputStream(yaml.getBytes(StandardCharsets.UTF_8)));
54-
ConfigProperties properties = GcpAuthCustomizerProvider.getConfigProperties(model);
54+
ConfigProperties properties = GcpAuthDeclarativeConfigurationCustomizerProvider.getConfigProperties(model);
5555

5656
assertThat(GcpAuthAutoConfigurationCustomizerProvider.targetSignals(properties))
5757
.containsExactly("metrics", "traces");
@@ -64,7 +64,7 @@ void declarativeConfig() throws IOException {
6464
.thenReturn(
6565
Collections.singletonMap("x-goog-user-project", Collections.singletonList("qp")));
6666

67-
GcpAuthCustomizerProvider.customize(model, credentials, properties);
67+
GcpAuthDeclarativeConfigurationCustomizerProvider.customize(model, credentials, properties);
6868

6969
String header =
7070
"headers=\\[io.opentelemetry.sdk.extension.incubator.fileconfig.internal.model.NameStringValuePairModel@.*\\[name=x-goog-user-project,value=qp]";

0 commit comments

Comments
 (0)