Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

Commit cc79cde

Browse files
committed
always log metric errors
1 parent 4369d57 commit cc79cde

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

google/cloud/bigtable/data/_metrics/data_model.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@
3636
# by default, exceptions in the metrics system are logged,
3737
# but enabling this flag causes them to be raised instead
3838
ALLOW_METRIC_EXCEPTIONS = os.getenv("BIGTABLE_METRICS_EXCEPTIONS", False)
39-
LOGGER = (
40-
logging.getLogger(__name__) if os.getenv("BIGTABLE_METRICS_LOGS", False) else None
41-
)
39+
LOGGER = logging.getLogger(__name__)
4240

4341
# default values for zone and cluster data, if not captured
4442
DEFAULT_ZONE = "global"
@@ -429,8 +427,7 @@ def _handle_error(message: str) -> None:
429427
full_message = f"Error in Bigtable Metrics: {message}"
430428
if ALLOW_METRIC_EXCEPTIONS:
431429
raise ValueError(full_message)
432-
if LOGGER:
433-
LOGGER.warning(full_message)
430+
LOGGER.warning(full_message)
434431

435432
async def __aenter__(self):
436433
"""

0 commit comments

Comments
 (0)