Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added gRPC debugger #1443

Merged
merged 4 commits into from
Sep 13, 2021
Merged

Added gRPC debugger #1443

merged 4 commits into from
Sep 13, 2021

Conversation

cmaglie
Copy link
Member

@cmaglie cmaglie commented Sep 10, 2021

  • Please check if the PR fulfills these requirements
  • The PR has no duplicates (please search among the Pull Requests before creating one)
  • The PR follows our contributing guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • UPGRADING.md has been updated with a migration guide (for breaking changes)
  • What kind of change does this PR introduce?

This change allows the CLI to output all the gRPC calls including their payload (both request and responses) so they can be inspected. This may turn useful to debug gRPC API issues.

To enable the debugging output just run the daemon as usual with the flag:

      --debug                  Enable debug logging of gRPC calls

If you're interested only in some particular gRPC calls you can filter them using

      --debug-filter strings   Display only the provided gRPC calls

Example:

$ arduino-cli daemon --debug --debug-filter Create,SetValue,UpdateIndex
CALLED: /cc.arduino.cli.settings.v1.SettingsService/SetValue
|  REQ:  {
|    "key": "directories",
|    "json_data": "{\"data\": \"/tmp/arduino-rpc-client774405799\", \"downloads\": \"/tmp/arduino-rpc-client774405799/staging\", \"user\": \"/tmp/arduino-rpc-client774405799/sketchbook\"}"
|  }
|  RESP: {}

CALLED: /cc.arduino.cli.commands.v1.ArduinoCoreService/Create
|  REQ:  {}
|  RESP: {
|    "instance": {
|      "id": 1
|    }
|  }

CALLED: /cc.arduino.cli.settings.v1.SettingsService/SetValue
|  REQ:  {
|    "key": "network.proxy",
|    "json_data": "\"http://localhost:3128\""
|  }
|  RESP: {}

CALLED: /cc.arduino.cli.commands.v1.ArduinoCoreService/UpdateIndex STREAM_RESP
|  REQ:  {
|    "instance": {
|      "id": 1
|    }
|  }
|  ERROR:  rpc error: code = Internal desc = Error downloading index 'https://downloads.arduino.cc/packages/package_index.json': Get "https://downloads.arduino.cc/packages/package_index.json": proxyconnect tcp: dial tcp 127.0.0.1:3128: connect: connection refused

@cmaglie cmaglie requested review from silvanocerza and a team and removed request for silvanocerza September 10, 2021 15:22
cli/daemon/daemon.go Outdated Show resolved Hide resolved
Co-authored-by: Silvano Cerza <[email protected]>
@cmaglie cmaglie merged commit 58ddae7 into arduino:master Sep 13, 2021
@cmaglie cmaglie deleted the grpc_debugger branch September 13, 2021 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants