feat(telemetry): attach serialized config proto to User-Agent for Get… - #5078
PranjalC100 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new ConfigUserAgent field to include serialized configuration details in the user agent string for storage control client operations. This is achieved by adding getUserAgentWithConfig to serialize and format the configuration, updating the storage client configuration, and creating a separate storage control client when a distinct config-based user agent is provided. The reviewer suggested refactoring getUserAgentWithConfig to reuse the existing getUserAgent logic, which avoids duplicating complex formatting and adds error logging for configuration serialization failures.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #5078 +/- ##
==========================================
- Coverage 86.79% 84.70% -2.10%
==========================================
Files 176 178 +2
Lines 18868 19575 +707
==========================================
+ Hits 16377 16581 +204
- Misses 2490 2993 +503
Partials 1 1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
c0c5983 to
78fb856
Compare
78fb856 to
bab407f
Compare
bab407f to
e7326ed
Compare
1094b7b to
5af9c55
Compare
* feat(cfg): compile protobuf and implement config serialization * build(proto): pin protoc v36.1 and protoc-gen-go via setup script Remove redundant go fmt directive from main.go and unify dev/CI proto compiler installation. * refactor(cfg): make ToProto and SerializeConfigToProtoBase64 receiver methods * test(cfg): replace cyclic and reflection tests with table-driven unit tests * test(cfg): split proto base64 serialization assertions into AAA subtests * build(proto): replace protoc setup script with zero-setup go run buf * test(cfg): replace proto byte assertions with base64 format check Remove non-deterministic proto serialization tests and fold base64 format checks into TestToProto_AllDataTypes. * feat(cfg): wrap config protobuf in UserAgentConfig envelope * post rebasing generated code * change name to ConfigPayload * test(config-gen): co-locate inputs and expected outputs in type_template_data_gen_test * test(config-gen): simplify proto mapping tests and separate deprecated param checks
5af9c55 to
696592d
Compare
Description
(Cfg:<b1>:<b2>:<b3>:<b4>:<b5>:<b6>)inUser-Agentwith URL-safe base64 serialized Protobuf telemetry(CfgProto:<payload>).ConfigUserAgenttostorageutil.StorageClientConfigto isolate the configuration payload to the control client used forGetStorageLayout.ConfigUserAgenttorawStorageControlClientForStorageLayout, ensuring the standardrawStorageControlClient(used for folder operations) and all data-path storage clients retain the clean, minimalUserAgent(gcsfuse/<version> (GPN:gcsfuse[-<appName>]) (mount-id:<id>)).cmd/legacy_main.goto constructuserAgent(standard) andconfigUserAgent(withCfgProto), eliminating legacy bitmask generation helpers (getConfigForUserAgent,boolToBin).cmdandinternal/storageto validate both standard and telemetry-enabled user agents across environment variable configurations and nil-receiver scenarios.Link to the issue in case of a bug fix.
b/558662750
Testing details
Any backward incompatible change? If so, please explain.
N/A - Replaces legacy internal bitmask header string with proto header string for control client initialization.