From d9054629dbe09b31126daeb296c093a7edca374b Mon Sep 17 00:00:00 2001 From: Daniel Sanche Date: Fri, 26 Jan 2024 15:04:20 -0800 Subject: [PATCH] added metric controls to table --- google/cloud/bigtable/data/_async/client.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/google/cloud/bigtable/data/_async/client.py b/google/cloud/bigtable/data/_async/client.py index d0578ff1a..11a4ed7bd 100644 --- a/google/cloud/bigtable/data/_async/client.py +++ b/google/cloud/bigtable/data/_async/client.py @@ -78,6 +78,8 @@ from google.cloud.bigtable.data.row_filters import CellsRowLimitFilter from google.cloud.bigtable.data.row_filters import RowFilterChain +from google.cloud.bigtable.data._metrics import BigtableClientSideMetricsController + if TYPE_CHECKING: from google.cloud.bigtable.data._helpers import RowKeySamples @@ -525,6 +527,13 @@ def __init__( ) self.default_mutate_rows_attempt_timeout = default_mutate_rows_attempt_timeout + self._metrics = BigtableClientSideMetricsController( + project_id=self.client.project, + instance_id=instance_id, + table_id=table_id, + app_profile_id=app_profile_id, + ) + self.default_read_rows_retryable_errors = ( default_read_rows_retryable_errors or () )