coinbase / mesh-cli

CLI for the Mesh API
Apache License 2.0
155 stars 94 forks source link

Instrumentation for outbound rosetta client request/responses to track slow or failing endpoints #390

Open HassanAmed opened 1 year ago

HassanAmed commented 1 year ago

Is your feature request related to a problem? Please describe. Currently, there is no instrumentation support in rosetta-cli. Adding flag to enable instrumentation should start tracing outbound requests to measure their response time, error percentages, p99, p95, p50 etc We can add an enable-request-instrumentation flag in config.json to enable or disable instrumentation.

Describe the solution you'd like If we can integrate some instrumentation library such as open telemetry in rosetta-cli, we can instrument request/response of rosetta endpoints.

We would be able to see slow and error requests.

Describe alternatives you've considered Problems with current performance tooling:

  1. check:perf It needs to be run as a separate process and measure results for /block and /account/balance endpoint. /account/balance is not using "address" value from blocks but is using hard-coded "address" string which is why all of requests fail due to address validation.
  2. --block-profile It is great to measure block pprof data but does not shows which requests failed or are slow.

Additional context Adding instrumentation could potentially slow down the process which is why it is important to have enable/disable configuration added for it.

HassanAmed commented 1 year ago

Fixed in #395