Draft: RPC_metrics: Add output size for each RPC call metric
What
Solving an issue raised by the community (the RPC metrics one), which can be found here.
Why
Closes #7296 (closed).
How
Commit 1 : add output_size metric for each RPC call URI and method, which accumulates the amount of data outputted by each RPC call.
Manually testing the MR
(sandbox testing)
$ ./src/bin_node/octez-sandboxed-node.sh 1 --connections 0 --metrics-addr localhost:12345
$ eval `./src/bin_client/octez-init-sandboxed-client.sh 1`
$ curl -s 'localhost:12345/metrics' | grep output
#HELP octez_rpc_calls_output_size RPC endpoint response body output sizes.
#TYPE octez_rpc_calls_output_size gauge
octez_rpc_calls_output_size{endpoint="/chains/<chain_id>/blocks/<block_id>/protocols", method="GET"} 822.000000
octez_rpc_calls_output_size{endpoint="/version", method="GET"} 1650.000000
$ octez-activate-alpha
$ curl -s 'localhost:12345/metrics' | grep output
#HELP octez_rpc_calls_output_size RPC endpoint response body output sizes.
#TYPE octez_rpc_calls_output_size gauge
octez_rpc_calls_output_size{endpoint="/chains/<chain_id>/blocks/<block_id>/helpers/preapply/block", method="POST"} 370.000000
octez_rpc_calls_output_size{endpoint="/chains/<chain_id>/blocks/<block_id>/protocols", method="GET"} 959.000000
octez_rpc_calls_output_size{endpoint="/chains/<chain_id>/chain_id", method="GET"} 18.000000
octez_rpc_calls_output_size{endpoint="/injection/block", method="POST"} 54.000000
octez_rpc_calls_output_size{endpoint="/version", method="GET"} 1925.000000
Checklist
-
Document the interface of any function added or modified (see the coding guidelines) -
Document any change to the user interface, including configuration parameters (see node configuration) -
Provide automatic testing (see the testing guide). -
For new features and bug fixes, add an item in the appropriate changelog ( docs/protocols/alpha.rstfor the protocol and the environment,CHANGES.rstat the root of the repository for everything else). -
Select suitable reviewers using the Reviewersfield below. -
Select as Assigneethe next person who should take action on that MR