bufbuild / buf

The best way of working with Protocol Buffers.
https://buf.build
Apache License 2.0
9.18k stars 278 forks source link

Debug logs no longer provide all RPC information #3484

Open doriable opened 2 days ago

doriable commented 2 days ago

GitHub repository with your minimal reproducible example (do not leave this field blank or fill out this field with "github.com/bufbuild/buf" or we will automatically close your issue, see the instructions above!)

No response

What's up?

The change in https://github.com/bufbuild/buf/pull/3374 removed tracing, which we used for all RPC debug logs. Below is a comparison of the difference between before and after for debug logs:

Before:

$ buf push --debug
DEBUG   buffetch termination found      {"curDirPath": "Users/dkeung/src/playground/a", "path": "Users/dkeung/src/playground/a"}
DEBUG   buffetch termination found      {"curDirPath": ".", "path": "."}
DEBUG   targeting workspace based on v2 buf.yaml        {"subDirPath": "."}
DEBUG   module data store dir read write bucket {"moduleFullName": "buf.build/googleapis/googleapis", "commitID": "c0913f24652a4cfc95f77d97443a5005", "dirPath": "b5/buf.build/googleapis/googleapis/c0913f24652a4cfc95f77d97443a5005"}
DEBUG   module data store get module.yaml       {"moduleFullName": "buf.build/googleapis/googleapis", "commitID": "c0913f24652a4cfc95f77d97443a5005", "found": false, "error": "stat b5/buf.build/googleapis/googleapis/c0913f24652a4cfc95f77d97443a5005/module.yaml: file does not exist"}
DEBUG   module data store dir read write bucket {"moduleFullName": "buf.build/googleapis/googleapis", "commitID": "c0913f24652a4cfc95f77d97443a5005", "dirPath": "b5/buf.build/googleapis/googleapis/c0913f24652a4cfc95f77d97443a5005"}
DEBUG   module data store put read check module.yaml    {"moduleFullName": "buf.build/googleapis/googleapis", "commitID": "c0913f24652a4cfc95f77d97443a5005", "found": false, "error": "stat b5/buf.build/googleapis/googleapis/c0913f24652a4cfc95f77d97443a5005/module.yaml: file does not exist"}
DEBUG   module data store put check module.yaml {"moduleFullName": "buf.build/googleapis/googleapis", "commitID": "c0913f24652a4cfc95f77d97443a5005", "found": false, "error": "stat b5/buf.build/googleapis/googleapis/c0913f24652a4cfc95f77d97443a5005/module.yaml: file does not exist"}
buf.build/dkeung/test:7f52ea154a434355805b27cf220d3cf7
DEBUG   github.com/bufbuild/buf/private/buf/bufworkspace.(*workspaceProvider).getWorkspaceForBucketBufYAMLV2    {"duration": "25µs", "status": "Ok"}
DEBUG   github.com/bufbuild/buf/private/buf/bufctl.(*controller).getWorkspaceForSourceRef       {"duration": "906.958µs", "status": "Ok"}
DEBUG   buf.registry.module.v1.GraphService/GetGraph    {"duration": "82.829125ms", "status": "Unset", "net.peer.name": "buf.build", "rpc.system": "connect_rpc", "rpc.service": "buf.registry.module.v1.GraphService", "rpc.method": "GetGraph", "message.type": "SENT", "message.id": 1, "message.uncompressed_size": 36, "message.type": "RECEIVED", "message.id": 1, "message.uncompressed_size": 225}
DEBUG   buf.registry.module.v1.DownloadService/Download {"duration": "69.83975ms", "status": "Unset", "net.peer.name": "buf.build", "rpc.system": "connect_rpc", "rpc.service": "buf.registry.module.v1.DownloadService", "rpc.method": "Download", "message.type": "SENT", "message.id": 1, "message.uncompressed_size": 38, "message.type": "RECEIVED", "message.id": 1, "message.uncompressed_size": 232432}
DEBUG   buf.registry.module.v1.ModuleService/GetModules {"duration": "39.438583ms", "status": "Unset", "net.peer.name": "buf.build", "rpc.system": "connect_rpc", "rpc.service": "buf.registry.module.v1.ModuleService", "rpc.method": "GetModules", "message.type": "SENT", "message.id": 1, "message.uncompressed_size": 36, "message.type": "RECEIVED", "message.id": 1, "message.uncompressed_size": 120}
DEBUG   github.com/bufbuild/buf/private/bufpkg/bufimage.BuildImage      {"duration": "213.928458ms", "status": "Ok"}
DEBUG   buf.registry.module.v1.ModuleService/GetModules {"duration": "479.727875ms", "status": "Unset", "net.peer.name": "buf.build", "rpc.system": "connect_rpc", "rpc.service": "buf.registry.module.v1.ModuleService", "rpc.method": "GetModules", "message.type": "SENT", "message.id": 1, "message.uncompressed_size": 18, "message.type": "RECEIVED", "message.id": 1, "message.uncompressed_size": 114}
DEBUG   buf.registry.module.v1.UploadService/Upload     {"duration": "387.585625ms", "status": "Unset", "net.peer.name": "buf.build", "rpc.system": "connect_rpc", "rpc.service": "buf.registry.module.v1.UploadService", "rpc.method": "Upload", "message.type": "SENT", "message.id": 1, "message.uncompressed_size": 175, "message.type": "RECEIVED", "message.id": 1, "message.uncompressed_size": 223}
DEBUG   command {"duration": "1.088746333s", "status": "Unset"}

After:

$ /Users/dkeung/.cache/buf/Darwin/arm64/gobin/buf push --debug
DEBUG   buffetch termination found      {"curDirPath": "Users/dkeung/src/playground/a", "path": "Users/dkeung/src/playground/a"}
DEBUG   buffetch termination found      {"curDirPath": ".", "path": "."}
DEBUG   targeting workspace based on v2 buf.yaml        {"subDirPath": "."}
DEBUG   github.com/bufbuild/buf/private/buf/bufworkspace.(*workspaceProvider).getWorkspaceForBucketBufYAMLV2    {"duration": "10.25µs"}
DEBUG   github.com/bufbuild/buf/private/buf/bufctl.(*controller).getWorkspaceForSourceRef       {"duration": "291.75µs"}
DEBUG   module data store dir read write bucket {"moduleFullName": "buf.build/googleapis/googleapis", "commitID": "c0913f24652a4cfc95f77d97443a5005", "dirPath": "b5/buf.build/googleapis/googleapis/c0913f24652a4cfc95f77d97443a5005"}
DEBUG   module data store get module.yaml       {"moduleFullName": "buf.build/googleapis/googleapis", "commitID": "c0913f24652a4cfc95f77d97443a5005", "found": false, "error": "stat b5/buf.build/googleapis/googleapis/c0913f24652a4cfc95f77d97443a5005/module.yaml: file does not exist"}
DEBUG   module data store dir read write bucket {"moduleFullName": "buf.build/googleapis/googleapis", "commitID": "c0913f24652a4cfc95f77d97443a5005", "dirPath": "b5/buf.build/googleapis/googleapis/c0913f24652a4cfc95f77d97443a5005"}
DEBUG   module data store put read check module.yaml    {"moduleFullName": "buf.build/googleapis/googleapis", "commitID": "c0913f24652a4cfc95f77d97443a5005", "found": false, "error": "stat b5/buf.build/googleapis/googleapis/c0913f24652a4cfc95f77d97443a5005/module.yaml: file does not exist"}
DEBUG   module data store put check module.yaml {"moduleFullName": "buf.build/googleapis/googleapis", "commitID": "c0913f24652a4cfc95f77d97443a5005", "found": false, "error": "stat b5/buf.build/googleapis/googleapis/c0913f24652a4cfc95f77d97443a5005/module.yaml: file does not exist"}
DEBUG   module data store dir read write bucket {"moduleFullName": "buf.build/googleapis/googleapis", "commitID": "c0913f24652a4cfc95f77d97443a5005", "dirPath": "b5/buf.build/googleapis/googleapis/c0913f24652a4cfc95f77d97443a5005"}
DEBUG   module data store get module.yaml       {"moduleFullName": "buf.build/googleapis/googleapis", "commitID": "c0913f24652a4cfc95f77d97443a5005", "found": true}
DEBUG   github.com/bufbuild/buf/private/bufpkg/bufimage.BuildImage      {"duration": "296.150292ms"}

We no longer get RPC level debug logs. This came up during a debugging session with users, where engineers ended up downgrading the version to get more information. We should figure out how to reintroduce RPC-level debug logs.