File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
google-cloud-spanner/src/main/java/com/google/cloud/spanner Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -727,6 +727,7 @@ private static class SpannerEnvironmentImpl implements SpannerEnvironment {
727727 private static final String SPANNER_ENABLE_API_TRACING = "SPANNER_ENABLE_API_TRACING" ;
728728 private static final String SPANNER_ENABLE_END_TO_END_TRACING =
729729 "SPANNER_ENABLE_END_TO_END_TRACING" ;
730+ private static final String SPANNER_DISABLE_BUILTIN_METRICS = "SPANNER_DISABLE_BUILTIN_METRICS" ;
730731
731732 private SpannerEnvironmentImpl () {}
732733
@@ -753,6 +754,11 @@ public boolean isEnableApiTracing() {
753754 return Boolean .parseBoolean (System .getenv (SPANNER_ENABLE_API_TRACING ));
754755 }
755756
757+ @ Override
758+ public boolean isEnableBuiltInMetrics () {
759+ return !Boolean .parseBoolean (System .getenv (SPANNER_DISABLE_BUILTIN_METRICS ));
760+ }
761+
756762 @ Override
757763 public boolean isEnableEndToEndTracing () {
758764 return Boolean .parseBoolean (System .getenv (SPANNER_ENABLE_END_TO_END_TRACING ));
@@ -821,7 +827,7 @@ public static class Builder
821827 private boolean enableApiTracing = SpannerOptions .environment .isEnableApiTracing ();
822828 private boolean enableExtendedTracing = SpannerOptions .environment .isEnableExtendedTracing ();
823829 private boolean enableEndToEndTracing = SpannerOptions .environment .isEnableEndToEndTracing ();
824- private boolean enableBuiltInMetrics = true ;
830+ private boolean enableBuiltInMetrics = SpannerOptions . environment . isEnableBuiltInMetrics () ;
825831
826832 private static String createCustomClientLibToken (String token ) {
827833 return token + " " + ServiceOptions .getGoogApiClientLibName ();
You can’t perform that action at this time.
0 commit comments