Repository navigation
feat(storage): integrate OpenTelemetry metrics gating across clients and transfer_manager - #18577
shradhakatyal wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces OpenTelemetry metrics support to the Google Cloud Storage (GCS) Python client. It adds a new _opentelemetry_metrics module to manage metrics gating, environment variable configuration, and dependency checks. The Client, GrpcClient, and AsyncGrpcClient classes are updated to accept enable_metrics and enable_advanced_metrics parameters, and transfer_manager.py is updated to support pickling these new properties. Feedback on the pull request suggests improving the robustness of client unpickling in transfer_manager.py by dynamically mapping extra positional arguments to keyword arguments when len(args) > 6, preventing potential TypeError exceptions during version mismatches.
7fd2242 to
93b878c
Compare
…and transfer_manager - Add enable_metrics and enable_debug_metrics to Client, GrpcClient, and AsyncGrpcClient - Add metrics_enabled and debug_metrics_enabled properties across all client classes - Preserve metrics configuration across process boundaries in transfer_manager - Add unit tests in test_client.py, test_grpc_client.py, test_async_grpc_client.py, and test_transfer_manager.py
93b878c to
804265e
Compare
…strings, and unit tests - Initialize _enable_metrics and _enable_debug_metrics earlier in Client.__init__ before Connection creation. - Extract _REDUCE_CLIENT_POS_ARGS = 6 constant in _LazyClient.__new__ to document positional argument slicing. - Add unit tests for default None metrics arguments and environment variable fallback across Client, GrpcClient, and AsyncGrpcClient. - Remove unused ClientWithProject mock patch from TestGrpcClient.test_metrics_properties. - Format Sphinx docstring literals and environment variable names with double backticks and mark properties as (Experimental). [Generated-by: AI]
|
/gcbrun 59cad15 |
Integrate the OpenTelemetry metrics gating configuration across Google Cloud Storage client classes and
transfer_manager.enable_metricsandenable_debug_metricsparameters toClient,GrpcClient, andAsyncGrpcClient.metrics_enabledanddebug_metrics_enabledproperties across all three client classes.enable_metricsandenable_debug_metricsacross multi-process boundaries intransfer_manager(_reduce_clientand_LazyClient).test_client.py,test_grpc_client.py,test_async_grpc_client.py, andtest_transfer_manager.py.