@@ -98,6 +98,10 @@ type ExecutionCollector struct {
9898 evmTransactionGasUsed prometheus.Histogram
9999 evmBlockTxCount prometheus.Histogram
100100 evmBlockGasUsed prometheus.Histogram
101+ callbacksExecutedCount prometheus.Histogram
102+ callbacksExecutedTotal prometheus.Counter
103+ callbacksProcessComputationUsed prometheus.Histogram
104+ callbacksExecuteComputationLimits prometheus.Histogram
101105}
102106
103107func NewExecutionCollector (tracer module.Tracer ) * ExecutionCollector {
@@ -793,6 +797,37 @@ func NewExecutionCollector(tracer module.Tracer) *ExecutionCollector {
793797 Name : "evm_block_total_supply" ,
794798 Help : "the total amount of flow deposited to EVM (in FLOW)" ,
795799 }),
800+
801+ callbacksExecutedCount : promauto .NewHistogram (prometheus.HistogramOpts {
802+ Namespace : namespaceExecution ,
803+ Subsystem : subsystemRuntime ,
804+ Name : "callbacks_executed_count" ,
805+ Help : "the number of callbacks executed" ,
806+ Buckets : prometheus .ExponentialBuckets (1 , 2 , 8 ),
807+ }),
808+
809+ callbacksExecutedTotal : promauto .NewCounter (prometheus.CounterOpts {
810+ Namespace : namespaceExecution ,
811+ Subsystem : subsystemRuntime ,
812+ Name : "callbacks_executed_total" ,
813+ Help : "the total number of callbacks executed" ,
814+ }),
815+
816+ callbacksProcessComputationUsed : promauto .NewHistogram (prometheus.HistogramOpts {
817+ Namespace : namespaceExecution ,
818+ Subsystem : subsystemRuntime ,
819+ Name : "callbacks_process_computation_used" ,
820+ Help : "the computation used by the process callback transaction" ,
821+ Buckets : prometheus .ExponentialBuckets (10_000 , 2 , 12 ),
822+ }),
823+
824+ callbacksExecuteComputationLimits : promauto .NewHistogram (prometheus.HistogramOpts {
825+ Namespace : namespaceExecution ,
826+ Subsystem : subsystemRuntime ,
827+ Name : "callbacks_execute_computation_limits" ,
828+ Help : "the total computation limits for execute callback transactions" ,
829+ Buckets : prometheus .ExponentialBuckets (10_000 , 2 , 12 ),
830+ }),
796831 }
797832
798833 return ec
@@ -883,6 +918,14 @@ func (ec *ExecutionCollector) ExecutionScriptExecuted(dur time.Duration, compUse
883918 ec .scriptMemoryDifference .Observe (float64 (memoryEstimated ) - float64 (memoryUsed ))
884919}
885920
921+ // ExecutionCallbacksExecuted reports callback execution metrics
922+ func (ec * ExecutionCollector ) ExecutionCallbacksExecuted (callbackCount int , processComputationUsed , executeComputationLimits uint64 ) {
923+ ec .callbacksExecutedCount .Observe (float64 (callbackCount ))
924+ ec .callbacksExecutedTotal .Add (float64 (callbackCount ))
925+ ec .callbacksProcessComputationUsed .Observe (float64 (processComputationUsed ))
926+ ec .callbacksExecuteComputationLimits .Observe (float64 (executeComputationLimits ))
927+ }
928+
886929// ExecutionStateStorageDiskTotal reports the total storage size of the execution state on disk in bytes
887930func (ec * ExecutionCollector ) ExecutionStateStorageDiskTotal (bytes int64 ) {
888931 ec .stateStorageDiskTotal .Set (float64 (bytes ))
0 commit comments