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() {
127
127
return traceUtil ;
128
128
}
129
129
130
+ @ InternalApi
130
131
@ BetaApi
131
132
@ Nonnull
132
133
public FirestoreOpenTelemetryOptions getOpenTelemetryOptions () {
@@ -223,6 +224,7 @@ public Builder setDatabaseId(@Nonnull String databaseId) {
223
224
*
224
225
* @param openTelemetryOptions The `FirestoreOpenTelemetryOptions` to use.
225
226
*/
227
+ @ InternalApi
226
228
@ BetaApi
227
229
@ Nonnull
228
230
public Builder setOpenTelemetryOptions (
Original file line number Diff line number Diff line change 25
25
import javax .annotation .Nullable ;
26
26
27
27
public interface TraceUtil {
28
+ static final boolean TRACING_FEATURE_ENABLED = false ;
28
29
String ATTRIBUTE_SERVICE_PREFIX = "gcp.firestore." ;
29
30
String SPAN_NAME_DOC_REF_CREATE = "DocumentReference.Create" ;
30
31
String SPAN_NAME_DOC_REF_SET = "DocumentReference.Set" ;
@@ -62,6 +63,11 @@ public interface TraceUtil {
62
63
* @return An instance of the TraceUtil class.
63
64
*/
64
65
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
+
65
71
boolean createEnabledInstance = firestoreOptions .getOpenTelemetryOptions ().isTracingEnabled ();
66
72
67
73
// The environment variable can override options to enable/disable telemetry collection.
Original file line number Diff line number Diff line change 26
26
import javax .annotation .Nullable ;
27
27
import org .junit .After ;
28
28
import org .junit .Before ;
29
+ import org .junit .Ignore ;
29
30
import org .junit .Test ;
30
31
32
+ // TODO(tracing): Re-enable this test when the tracing feature is enabled.
33
+ @ Ignore
31
34
public class OpenTelemetryOptionsTest {
32
35
@ Nullable private Firestore firestore ;
33
36
Original file line number Diff line number Diff line change 15
15
*/
16
16
package com .google .cloud .firestore .it ;
17
17
18
+ import org .junit .Ignore ;
18
19
import org .junit .runner .RunWith ;
19
20
import org .junit .runners .JUnit4 ;
20
21
21
22
@ RunWith (JUnit4 .class )
23
+ @ Ignore
22
24
public class ITE2ETracingTestGlobalOtel extends ITE2ETracingTest {
23
25
@ Override
24
26
protected boolean isUsingGlobalOpenTelemetrySDK () {
Original file line number Diff line number Diff line change 15
15
*/
16
16
package com .google .cloud .firestore .it ;
17
17
18
+ import org .junit .Ignore ;
18
19
import org .junit .runner .RunWith ;
19
20
import org .junit .runners .JUnit4 ;
20
21
21
22
@ RunWith (JUnit4 .class )
23
+ @ Ignore
22
24
public class ITE2ETracingTestNonGlobalOtel extends ITE2ETracingTest {
23
25
@ Override
24
26
protected boolean isUsingGlobalOpenTelemetrySDK () {
Original file line number Diff line number Diff line change 15
15
*/
16
16
package com .google .cloud .firestore .it ;
17
17
18
+ import org .junit .Ignore ;
18
19
import org .junit .runner .RunWith ;
19
20
import org .junit .runners .JUnit4 ;
20
21
21
22
@ RunWith (JUnit4 .class )
23
+ @ Ignore
22
24
public class ITTracingTestGlobalOtel extends ITTracingTest {
23
25
@ Override
24
26
protected boolean isUsingGlobalOpenTelemetrySDK () {
Original file line number Diff line number Diff line change 15
15
*/
16
16
package com .google .cloud .firestore .it ;
17
17
18
+ import org .junit .Ignore ;
18
19
import org .junit .runner .RunWith ;
19
20
import org .junit .runners .JUnit4 ;
20
21
21
22
@ RunWith (JUnit4 .class )
23
+ @ Ignore
22
24
public class ITTracingTestNonGlobalOtel extends ITTracingTest {
23
25
@ Override
24
26
protected boolean isUsingGlobalOpenTelemetrySDK () {
Original file line number Diff line number Diff line change @@ -56,6 +56,10 @@ public void tracingEnabledOptionsUseEnabledTraceUtil() {
56
56
.setOpenTelemetryOptions (
57
57
FirestoreOpenTelemetryOptions .newBuilder ().setTracingEnabled (true ).build ())
58
58
.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 ();
60
64
}
61
65
}
You can’t perform that action at this time.
0 commit comments