[go: up one dir, main page]

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.

2025-06-16-22_14_22

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.rst for the protocol and the environment, CHANGES.rst at the root of the repository for everything else).
  • Select suitable reviewers using the Reviewers field below.
  • Select as Assignee the next person who should take action on that MR
Edited by Thomas Letan

Merge request reports

Loading