diff --git a/packages/taiko-client/internal/metrics/metrics.go b/packages/taiko-client/internal/metrics/metrics.go index 4ac2d51067..b1a8846c04 100644 --- a/packages/taiko-client/internal/metrics/metrics.go +++ b/packages/taiko-client/internal/metrics/metrics.go @@ -55,21 +55,33 @@ var ( ProverAggregationSubmissionErrorCounter = factory.NewCounter(prometheus.CounterOpts{ Name: "prover_proof_aggregation_submission_error", }) + ProverAggregationGenerationTime = factory.NewGauge(prometheus.GaugeOpts{ + Name: "prover_proof_aggregation_generation_time", + }) ProverSgxProofGeneratedCounter = factory.NewCounter(prometheus.CounterOpts{ Name: "prover_proof_sgx_generated", }) + ProverSgxProofGenerationTime = factory.NewGauge(prometheus.GaugeOpts{ + Name: "prover_proof_sgx_generation_time", + }) ProverSgxProofAggregationGeneratedCounter = factory.NewCounter(prometheus.CounterOpts{ Name: "prover_proof_sgx_aggregation_generated", }) ProverR0ProofGeneratedCounter = factory.NewCounter(prometheus.CounterOpts{ Name: "prover_proof_r0_generated", }) + ProverR0ProofGenerationTime = factory.NewGauge(prometheus.GaugeOpts{ + Name: "prover_proof_r0_generation_time", + }) ProverR0ProofAggregationGeneratedCounter = factory.NewCounter(prometheus.CounterOpts{ Name: "prover_proof_r0_aggregation_generated", }) ProverSp1ProofGeneratedCounter = factory.NewCounter(prometheus.CounterOpts{ Name: "prover_proof_sp1_generated", }) + ProverSP1ProofGenerationTime = factory.NewGauge(prometheus.GaugeOpts{ + Name: "prover_proof_sp1_generation_time", + }) ProverSp1ProofAggregationGeneratedCounter = factory.NewCounter(prometheus.CounterOpts{ Name: "prover_proof_sp1_aggregation_generated", }) diff --git a/packages/taiko-client/prover/proof_producer/sgx_producer.go b/packages/taiko-client/prover/proof_producer/sgx_producer.go index cf843f02f0..75079c376f 100644 --- a/packages/taiko-client/prover/proof_producer/sgx_producer.go +++ b/packages/taiko-client/prover/proof_producer/sgx_producer.go @@ -333,6 +333,7 @@ func (s *SGXProofProducer) requestBatchProof( "time", time.Since(requestAt), "producer", "SGXProofProducer", ) + metrics.ProverAggregationGenerationTime.Set(float64(time.Since(requestAt).Seconds())) return proof, nil } @@ -390,6 +391,7 @@ func (s *SGXProofProducer) callProverDaemon( "time", time.Since(requestAt), "producer", "SGXProofProducer", ) + metrics.ProverSgxProofGenerationTime.Set(float64(time.Since(requestAt).Seconds())) return proof, nil } diff --git a/packages/taiko-client/prover/proof_producer/zkvm_producer.go b/packages/taiko-client/prover/proof_producer/zkvm_producer.go index 34590ef0b3..9ecd021dcf 100644 --- a/packages/taiko-client/prover/proof_producer/zkvm_producer.go +++ b/packages/taiko-client/prover/proof_producer/zkvm_producer.go @@ -196,6 +196,11 @@ func (s *ZKvmProofProducer) callProverDaemon( "time", time.Since(requestAt), "producer", "ZKvmProofProducer", ) + if s.ZKProofType == ZKProofTypeR0 { + metrics.ProverR0ProofGenerationTime.Set(float64(time.Since(requestAt).Seconds())) + } else if s.ZKProofType == ZKProofTypeSP1 { + metrics.ProverSP1ProofGenerationTime.Set(float64(time.Since(requestAt).Seconds())) + } return proof, nil }