File tree Expand file tree Collapse file tree 8 files changed +24
-1
lines changed
google-cloud-firestore/src
main/java/com/google/cloud/firestore
test/java/com/google/cloud/firestore Expand file tree Collapse file tree 8 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -127,6 +127,7 @@ com.google.cloud.firestore.telemetry.TraceUtil getTraceUtil() {
127127 return traceUtil ;
128128 }
129129
130+ @ InternalApi
130131 @ BetaApi
131132 @ Nonnull
132133 public FirestoreOpenTelemetryOptions getOpenTelemetryOptions () {
@@ -223,6 +224,7 @@ public Builder setDatabaseId(@Nonnull String databaseId) {
223224 *
224225 * @param openTelemetryOptions The `FirestoreOpenTelemetryOptions` to use.
225226 */
227+ @ InternalApi
226228 @ BetaApi
227229 @ Nonnull
228230 public Builder setOpenTelemetryOptions (
Original file line number Diff line number Diff line change 2525import javax .annotation .Nullable ;
2626
2727public interface TraceUtil {
28+ static final boolean TRACING_FEATURE_ENABLED = false ;
2829 String ATTRIBUTE_SERVICE_PREFIX = "gcp.firestore." ;
2930 String SPAN_NAME_DOC_REF_CREATE = "DocumentReference.Create" ;
3031 String SPAN_NAME_DOC_REF_SET = "DocumentReference.Set" ;
@@ -62,6 +63,11 @@ public interface TraceUtil {
6263 * @return An instance of the TraceUtil class.
6364 */
6465 static TraceUtil getInstance (@ Nonnull FirestoreOptions firestoreOptions ) {
66+ // TODO(tracing): Remove this to enable the feature.
67+ if (!TRACING_FEATURE_ENABLED ) {
68+ return new DisabledTraceUtil ();
69+ }
70+
6571 boolean createEnabledInstance = firestoreOptions .getOpenTelemetryOptions ().isTracingEnabled ();
6672
6773 // The environment variable can override options to enable/disable telemetry collection.
Original file line number Diff line number Diff line change 2626import javax .annotation .Nullable ;
2727import org .junit .After ;
2828import org .junit .Before ;
29+ import org .junit .Ignore ;
2930import org .junit .Test ;
3031
32+ // TODO(tracing): Re-enable this test when the tracing feature is enabled.
33+ @ Ignore
3134public class OpenTelemetryOptionsTest {
3235 @ Nullable private Firestore firestore ;
3336
Original file line number Diff line number Diff line change 1515 */
1616package com .google .cloud .firestore .it ;
1717
18+ import org .junit .Ignore ;
1819import org .junit .runner .RunWith ;
1920import org .junit .runners .JUnit4 ;
2021
2122@ RunWith (JUnit4 .class )
23+ @ Ignore
2224public class ITE2ETracingTestGlobalOtel extends ITE2ETracingTest {
2325 @ Override
2426 protected boolean isUsingGlobalOpenTelemetrySDK () {
Original file line number Diff line number Diff line change 1515 */
1616package com .google .cloud .firestore .it ;
1717
18+ import org .junit .Ignore ;
1819import org .junit .runner .RunWith ;
1920import org .junit .runners .JUnit4 ;
2021
2122@ RunWith (JUnit4 .class )
23+ @ Ignore
2224public class ITE2ETracingTestNonGlobalOtel extends ITE2ETracingTest {
2325 @ Override
2426 protected boolean isUsingGlobalOpenTelemetrySDK () {
Original file line number Diff line number Diff line change 1515 */
1616package com .google .cloud .firestore .it ;
1717
18+ import org .junit .Ignore ;
1819import org .junit .runner .RunWith ;
1920import org .junit .runners .JUnit4 ;
2021
2122@ RunWith (JUnit4 .class )
23+ @ Ignore
2224public class ITTracingTestGlobalOtel extends ITTracingTest {
2325 @ Override
2426 protected boolean isUsingGlobalOpenTelemetrySDK () {
Original file line number Diff line number Diff line change 1515 */
1616package com .google .cloud .firestore .it ;
1717
18+ import org .junit .Ignore ;
1819import org .junit .runner .RunWith ;
1920import org .junit .runners .JUnit4 ;
2021
2122@ RunWith (JUnit4 .class )
23+ @ Ignore
2224public class ITTracingTestNonGlobalOtel extends ITTracingTest {
2325 @ Override
2426 protected boolean isUsingGlobalOpenTelemetrySDK () {
Original file line number Diff line number Diff line change @@ -56,6 +56,10 @@ public void tracingEnabledOptionsUseEnabledTraceUtil() {
5656 .setOpenTelemetryOptions (
5757 FirestoreOpenTelemetryOptions .newBuilder ().setTracingEnabled (true ).build ())
5858 .build ());
59- assertThat (traceUtil instanceof EnabledTraceUtil ).isTrue ();
59+
60+ // This is currently disabled because the feature is disabled as a whole.
61+ // TODO (tracing): This should be `traceUtil instanceof EnabledTraceUtil
62+ // once the feature is enabled.
63+ assertThat (traceUtil instanceof DisabledTraceUtil ).isTrue ();
6064 }
6165}
You can’t perform that action at this time.
0 commit comments