Skip to content

Commit

Permalink
address feedback.
Browse files Browse the repository at this point in the history
  • Loading branch information
ehsannas committed Apr 4, 2024
1 parent 1be10df commit 98c29aa
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class FirestoreOpenTelemetryOptions {
this.openTelemetry = builder.openTelemetry;
}

public boolean getTracingEnabled() {
public boolean isTracingEnabled() {
return tracingEnabled;
}

Expand Down Expand Up @@ -71,11 +71,11 @@ public FirestoreOpenTelemetryOptions build() {
/**
* Sets whether tracing should be enabled.
*
* @param enable Whether tracing should be enabled.
* @param tracingEnabled Whether tracing should be enabled.
*/
@Nonnull
public FirestoreOpenTelemetryOptions.Builder setTracingEnabled(boolean enable) {
this.tracingEnabled = enable;
public FirestoreOpenTelemetryOptions.Builder setTracingEnabled(boolean tracingEnabled) {
this.tracingEnabled = tracingEnabled;
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public interface TraceUtil {
* @return An instance of the TraceUtil class.
*/
static TraceUtil getInstance(@Nonnull FirestoreOptions firestoreOptions) {
boolean createEnabledInstance = firestoreOptions.getOpenTelemetryOptions().getTracingEnabled();
boolean createEnabledInstance = firestoreOptions.getOpenTelemetryOptions().isTracingEnabled();

// The environment variable can override options to enable/disable telemetry collection.
String enableTracingEnvVar = System.getenv(ENABLE_TRACING_ENV_VAR);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ FirestoreOptions.Builder getBaseOptions() {
public void defaultOptionsDisablesTelemetryCollection() {
FirestoreOptions firestoreOptions = getBaseOptions().build();
firestore = firestoreOptions.getService();
assertThat(firestore.getOptions().getOpenTelemetryOptions().getTracingEnabled()).isFalse();
assertThat(firestore.getOptions().getOpenTelemetryOptions().isTracingEnabled()).isFalse();
assertThat(firestore.getOptions().getOpenTelemetryOptions().getOpenTelemetry()).isNull();
assertThat(firestore.getOptions().getTraceUtil()).isNotNull();
assertThat(firestore.getOptions().getTraceUtil() instanceof DisabledTraceUtil).isTrue();
Expand All @@ -66,7 +66,7 @@ public void canEnableTelemetryCollectionWithoutOpenTelemetryInstance() {
FirestoreOpenTelemetryOptions.newBuilder().setTracingEnabled(true).build())
.build();
firestore = firestoreOptions.getService();
assertThat(firestore.getOptions().getOpenTelemetryOptions().getTracingEnabled()).isTrue();
assertThat(firestore.getOptions().getOpenTelemetryOptions().isTracingEnabled()).isTrue();
assertThat(firestore.getOptions().getOpenTelemetryOptions().getOpenTelemetry()).isNull();
assertThat(firestore.getOptions().getTraceUtil()).isNotNull();
assertThat(firestore.getOptions().getTraceUtil() instanceof EnabledTraceUtil).isTrue();
Expand All @@ -84,7 +84,7 @@ public void canEnableTelemetryCollectionWithOpenTelemetryInstance() {
.build())
.build();
firestore = firestoreOptions.getService();
assertThat(firestore.getOptions().getOpenTelemetryOptions().getTracingEnabled()).isTrue();
assertThat(firestore.getOptions().getOpenTelemetryOptions().isTracingEnabled()).isTrue();
assertThat(firestore.getOptions().getOpenTelemetryOptions().getOpenTelemetry())
.isEqualTo(openTelemetry);
assertThat(firestore.getOptions().getTraceUtil()).isNotNull();
Expand All @@ -103,7 +103,7 @@ public void canDisableTelemetryCollectionWhileOpenTelemetryInstanceIsNotNull() {
.build())
.build();
firestore = firestoreOptions.getService();
assertThat(firestore.getOptions().getOpenTelemetryOptions().getTracingEnabled()).isFalse();
assertThat(firestore.getOptions().getOpenTelemetryOptions().isTracingEnabled()).isFalse();
assertThat(firestore.getOptions().getOpenTelemetryOptions().getOpenTelemetry())
.isEqualTo(openTelemetry);
assertThat(firestore.getOptions().getTraceUtil()).isNotNull();
Expand All @@ -118,7 +118,7 @@ public void existenceOfGlobalOpenTelemetryDoesNotEnableTracing() {
// Make sure Firestore does not use GlobalOpenTelemetry by default.
FirestoreOptions firestoreOptions = getBaseOptions().build();
firestore = firestoreOptions.getService();
assertThat(firestore.getOptions().getOpenTelemetryOptions().getTracingEnabled()).isFalse();
assertThat(firestore.getOptions().getOpenTelemetryOptions().isTracingEnabled()).isFalse();
assertThat(firestore.getOptions().getOpenTelemetryOptions().getOpenTelemetry()).isNull();
assertThat(firestore.getOptions().getTraceUtil()).isNotNull();
assertThat(firestore.getOptions().getTraceUtil() instanceof DisabledTraceUtil).isTrue();
Expand Down

0 comments on commit 98c29aa

Please sign in to comment.