@@ -157,14 +157,6 @@ DataConnectionComponents MakeDataConnectionComponents(
157157
158158std::shared_ptr<bigtable::DataConnection> MakeSingleStubDataConnection (
159159 DataConnectionComponents components) {
160- #ifdef GOOGLE_CLOUD_CPP_BIGTABLE_WITH_OTEL_METRICS
161- if (components.direct_access_compatibility != nullptr ) {
162- components.direct_access_compatibility ->Record (
163- opentelemetry::context::RuntimeContext::GetCurrent (), 0 ,
164- bigtable_internal::DirectAccessCompatibilityLabels{
165- " " , " manually_disabled" });
166- }
167- #endif
168160 std::shared_ptr<bigtable_internal::BigtableStub> stub =
169161 bigtable_internal::CreateBigtableStub (std::move (components.auth ),
170162 components.background ->cq (),
@@ -194,7 +186,7 @@ std::shared_ptr<bigtable::DataConnection> MakeInstanceAffinityDataConnection(
194186 affinity_stubs = bigtable_internal::CreateBigtableAffinityStubs (
195187 instances, stub_creation_fn);
196188#ifdef GOOGLE_CLOUD_CPP_BIGTABLE_WITH_OTEL_METRICS
197- if (components.direct_access_compatibility != nullptr ) {
189+ if (!instances. empty () && components.direct_access_compatibility != nullptr ) {
198190 components.direct_access_compatibility ->Record (
199191 opentelemetry::context::RuntimeContext::GetCurrent (), 0 ,
200192 bigtable_internal::DirectAccessCompatibilityLabels{
0 commit comments