From 676cd0ffb54c63f3ab70bacb4267cfdb38703732 Mon Sep 17 00:00:00 2001 From: Thomas Letan Date: Fri, 13 Jun 2025 11:21:42 +0200 Subject: [PATCH] EVM Node: Add Opentelemetry tracing to `Evm_state.execute` function * What This commit integrates OpenTelemetry tracing into the `execute` function found in `etherlink/bin_node/lib_dev/evm_state.ml`. The `execute` function is now wrapped with `Octez_telemetry.Trace.with_tzresult`, using "Evm_state" as the service name and "execute" as the span name for clear identification of the trace. * Why The primary motivation for this change is to significantly enhance the observability of the EVM execution process within the Etherlink node. By adding tracing to this critical function, we can gain deeper insights into its performance characteristics, identify potential bottlenecks, and better understand the overall flow of EVM state computations. This will greatly aid in debugging and performance tuning efforts. * How The tracing is implemented by adding a single line of code at the beginning of the `execute` function. The `Octez_telemetry.Trace.with_tzresult` call ensures that the entire execution duration of the function is captured as an OpenTelemetry span, providing structured telemetry data for analysis in distributed tracing systems. --- etherlink/bin_node/lib_dev/evm_state.ml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/etherlink/bin_node/lib_dev/evm_state.ml b/etherlink/bin_node/lib_dev/evm_state.ml index 84f9b826e7e8..453c44e86aaf 100644 --- a/etherlink/bin_node/lib_dev/evm_state.ml +++ b/etherlink/bin_node/lib_dev/evm_state.ml @@ -37,6 +37,8 @@ let execute ?(wasm_pvm_fallback = false) ?profile ?(kind = Events.Application) ?(wasm_entrypoint = Tezos_scoru_wasm.Constants.wasm_entrypoint) ~config ~native_execution evm_state inbox = let open Lwt_result_syntax in + Octez_telemetry.Trace.with_tzresult ~service_name:"Evm_state" "execute" + @@ fun _ -> let path = Filename.concat (kernel_logs_directory ~data_dir) log_file in let inbox = List.map (function `Input s -> s) inbox in let inbox = List.to_seq [inbox] in -- GitLab