EVM Node: Add OpenTelemetry attributes for blocks and transactions
Part of L2-2
What
This patch introduces OpenTelemetry attributes to enhance tracing for block processing and transaction-related RPC calls. These attributes provide crucial context directly within the telemetry traces.
Why
By adding specific attributes such as block numbers, transaction hashes, transaction counts, and execution gas, we make the telemetry data more actionable and informative. This greatly assists in debugging, performance analysis, and overall observability of the Etherlink node's operations.
How
New functions in Telemetry.Attributes are defined to create key_value pairs
for block numbers, transaction counts, execution gas, and transaction hashes.
Calls to Octez_telemetry.Trace.add_attrs have been strategically placed in
evm_context.ml (for block application), evm_store.ml (for transaction
insertion), and services.ml (for various transaction-related RPCs like
eth_getTransactionReceipt, eth_getTransactionByHash, and transaction
submission) to attach these new attributes to the current trace spans.
Manually testing the MR
Connect Metamask to a node with opentelemetry enabled, inject a transaction, and enjoy.
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
