Skip to content

Conversation

@Kourin1996
Copy link

Closes #321

Add the following types of metrics for AltDA failover feature

  • Total count of failover occurrences
  • Total number of batches posted for each DA type

@Kourin1996 Kourin1996 requested a review from gastonponti March 14, 2025 06:36
@Kourin1996 Kourin1996 self-assigned this Mar 14, 2025
@Kourin1996 Kourin1996 marked this pull request as ready for review March 14, 2025 06:41
@palango palango requested a review from ezdac March 17, 2025 13:59
@palango
Copy link

palango commented Mar 18, 2025

@jcortejoso @alvarof2 @gastonponti Any metrics besides those implemented that would be helpful for you?

Copy link

@ezdac ezdac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!
I would record the batch-send success at a different location (see comment).

In terms of additional metrics,
maybe the actual number of bytes sent to the DA-proxy would be interesting,
so the cumulative sum of the http-body size in the setInput and setInputWithCommit, but only if the proxy returns a 200.

}
// if Alt DA is enabled we post the txdata to the DA Provider and replace it with the commitment.
l.publishToAltDAAndL1(txdata, queue, receiptsCh, daGroup)
l.Metr.RecordBatchDaType(txdata.daType.Name())
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the publishToAltDAAndL1() spawns a goroutine that in turn calls the sendTx, but only if the AltDA input can be set correctly.
If you call this here, you get a "confirmation" for sending the tx, even though you could have aborted before the send and recorded a "failedDARequest".

I think I would only add one Metr.RecordBatchDaType call in general and rather do that at the end of the sendTx(), but only if the passed in isCancel==false

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ezdac You're right. For Alt DA, it recorded regardless of success or failure. Then I updated codes and now it records when handleReceipt is called.

@Kourin1996 Kourin1996 requested a review from ezdac March 20, 2025 07:12
Copy link

@ezdac ezdac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me now!

The only thing I'm not 100% happy about is the semantic discrepancy of "sent bytes" for AltDA and for non-AltDA. For the former, it means how much has been successfully sent to the AltDA layer but not landed onchain, for the latter it means how much successfully made it onchain.

@jcortejoso
Copy link
Member

Looks good to me to 👍

@jcortejoso jcortejoso self-requested a review April 2, 2025 10:38
@Kourin1996
Copy link
Author

@ezdac Hi, I unified recordings of stored batch size. Now total frame sizes are recorded after tx is confirmed in L1 regardless of DA type.

@Kourin1996 Kourin1996 merged commit 54a4a8a into celo-rebase-12 Apr 3, 2025
32 checks passed
@Kourin1996 Kourin1996 deleted the Kourin1996/alt-da-failover-metrics branch April 3, 2025 10:45
jcortejoso pushed a commit that referenced this pull request Apr 16, 2025
* Add Prometheus metrics for AltDA failover in Batcher

* Fix calls of RecordBatchDaType

* Revert deleted comment

* Add metrics for total stored batch size

* Fix condition for RecordBatchDaType and RecordBatchDataSizeBytes

* Add missing namespace to prometheus definition

* Fix the amount of batch sizes recorded for DA

* Unify recordings of size of batch to be stored

* Improve Prometheus help text
piersy pushed a commit that referenced this pull request May 7, 2025
* Add Prometheus metrics for AltDA failover in Batcher

* Fix calls of RecordBatchDaType

* Revert deleted comment

* Add metrics for total stored batch size

* Fix condition for RecordBatchDaType and RecordBatchDataSizeBytes

* Add missing namespace to prometheus definition

* Fix the amount of batch sizes recorded for DA

* Unify recordings of size of batch to be stored

* Improve Prometheus help text
piersy pushed a commit that referenced this pull request May 8, 2025
* feat: add re emit sent msg event logic on l2 to l2 cdm

* feat: add tests for the re emit feature

* fix: review comments

chore: run pre pr

* refactor: rename to resend msg

* chore: return msg hash (#361)

---------

Co-authored-by: 0xDiscotech <[email protected]>
piersy pushed a commit that referenced this pull request May 8, 2025
* Add Prometheus metrics for AltDA failover in Batcher

* Fix calls of RecordBatchDaType

* Revert deleted comment

* Add metrics for total stored batch size

* Fix condition for RecordBatchDaType and RecordBatchDataSizeBytes

* Add missing namespace to prometheus definition

* Fix the amount of batch sizes recorded for DA

* Unify recordings of size of batch to be stored

* Improve Prometheus help text
piersy pushed a commit that referenced this pull request May 8, 2025
* Add Prometheus metrics for AltDA failover in Batcher

* Fix calls of RecordBatchDaType

* Revert deleted comment

* Add metrics for total stored batch size

* Fix condition for RecordBatchDaType and RecordBatchDataSizeBytes

* Add missing namespace to prometheus definition

* Fix the amount of batch sizes recorded for DA

* Unify recordings of size of batch to be stored

* Improve Prometheus help text
piersy pushed a commit that referenced this pull request May 8, 2025
* Add Prometheus metrics for AltDA failover in Batcher

* Fix calls of RecordBatchDaType

* Revert deleted comment

* Add metrics for total stored batch size

* Fix condition for RecordBatchDaType and RecordBatchDataSizeBytes

* Add missing namespace to prometheus definition

* Fix the amount of batch sizes recorded for DA

* Unify recordings of size of batch to be stored

* Improve Prometheus help text
piersy pushed a commit that referenced this pull request May 20, 2025
* Add Prometheus metrics for AltDA failover in Batcher

* Fix calls of RecordBatchDaType

* Revert deleted comment

* Add metrics for total stored batch size

* Fix condition for RecordBatchDaType and RecordBatchDataSizeBytes

* Add missing namespace to prometheus definition

* Fix the amount of batch sizes recorded for DA

* Unify recordings of size of batch to be stored

* Improve Prometheus help text
piersy pushed a commit that referenced this pull request May 22, 2025
* Add Prometheus metrics for AltDA failover in Batcher

* Fix calls of RecordBatchDaType

* Revert deleted comment

* Add metrics for total stored batch size

* Fix condition for RecordBatchDaType and RecordBatchDataSizeBytes

* Add missing namespace to prometheus definition

* Fix the amount of batch sizes recorded for DA

* Unify recordings of size of batch to be stored

* Improve Prometheus help text
Kourin1996 added a commit that referenced this pull request Jul 23, 2025
* Add Prometheus metrics for AltDA failover in Batcher

* Fix calls of RecordBatchDaType

* Revert deleted comment

* Add metrics for total stored batch size

* Fix condition for RecordBatchDaType and RecordBatchDataSizeBytes

* Add missing namespace to prometheus definition

* Fix the amount of batch sizes recorded for DA

* Unify recordings of size of batch to be stored

* Improve Prometheus help text
Kourin1996 added a commit that referenced this pull request Jul 25, 2025
* Add Prometheus metrics for AltDA failover in Batcher

* Fix calls of RecordBatchDaType

* Revert deleted comment

* Add metrics for total stored batch size

* Fix condition for RecordBatchDaType and RecordBatchDataSizeBytes

* Add missing namespace to prometheus definition

* Fix the amount of batch sizes recorded for DA

* Unify recordings of size of batch to be stored

* Improve Prometheus help text
Kourin1996 added a commit that referenced this pull request Jul 26, 2025
* Add Prometheus metrics for AltDA failover in Batcher

* Fix calls of RecordBatchDaType

* Revert deleted comment

* Add metrics for total stored batch size

* Fix condition for RecordBatchDaType and RecordBatchDataSizeBytes

* Add missing namespace to prometheus definition

* Fix the amount of batch sizes recorded for DA

* Unify recordings of size of batch to be stored

* Improve Prometheus help text
Kourin1996 added a commit that referenced this pull request Jul 26, 2025
* Add Prometheus metrics for AltDA failover in Batcher

* Fix calls of RecordBatchDaType

* Revert deleted comment

* Add metrics for total stored batch size

* Fix condition for RecordBatchDaType and RecordBatchDataSizeBytes

* Add missing namespace to prometheus definition

* Fix the amount of batch sizes recorded for DA

* Unify recordings of size of batch to be stored

* Improve Prometheus help text
Kourin1996 added a commit that referenced this pull request Jul 27, 2025
* Add Prometheus metrics for AltDA failover in Batcher

* Fix calls of RecordBatchDaType

* Revert deleted comment

* Add metrics for total stored batch size

* Fix condition for RecordBatchDaType and RecordBatchDataSizeBytes

* Add missing namespace to prometheus definition

* Fix the amount of batch sizes recorded for DA

* Unify recordings of size of batch to be stored

* Improve Prometheus help text
Kourin1996 added a commit that referenced this pull request Jul 27, 2025
* Add Prometheus metrics for AltDA failover in Batcher

* Fix calls of RecordBatchDaType

* Revert deleted comment

* Add metrics for total stored batch size

* Fix condition for RecordBatchDaType and RecordBatchDataSizeBytes

* Add missing namespace to prometheus definition

* Fix the amount of batch sizes recorded for DA

* Unify recordings of size of batch to be stored

* Improve Prometheus help text
Kourin1996 added a commit that referenced this pull request Jul 28, 2025
* Add Prometheus metrics for AltDA failover in Batcher

* Fix calls of RecordBatchDaType

* Revert deleted comment

* Add metrics for total stored batch size

* Fix condition for RecordBatchDaType and RecordBatchDataSizeBytes

* Add missing namespace to prometheus definition

* Fix the amount of batch sizes recorded for DA

* Unify recordings of size of batch to be stored

* Improve Prometheus help text
Kourin1996 added a commit that referenced this pull request Jul 28, 2025
* Add Prometheus metrics for AltDA failover in Batcher

* Fix calls of RecordBatchDaType

* Revert deleted comment

* Add metrics for total stored batch size

* Fix condition for RecordBatchDaType and RecordBatchDataSizeBytes

* Add missing namespace to prometheus definition

* Fix the amount of batch sizes recorded for DA

* Unify recordings of size of batch to be stored

* Improve Prometheus help text
Kourin1996 added a commit that referenced this pull request Jul 28, 2025
* Add Prometheus metrics for AltDA failover in Batcher

* Fix calls of RecordBatchDaType

* Revert deleted comment

* Add metrics for total stored batch size

* Fix condition for RecordBatchDaType and RecordBatchDataSizeBytes

* Add missing namespace to prometheus definition

* Fix the amount of batch sizes recorded for DA

* Unify recordings of size of batch to be stored

* Improve Prometheus help text
Kourin1996 added a commit that referenced this pull request Aug 4, 2025
* Add Prometheus metrics for AltDA failover in Batcher

* Fix calls of RecordBatchDaType

* Revert deleted comment

* Add metrics for total stored batch size

* Fix condition for RecordBatchDaType and RecordBatchDataSizeBytes

* Add missing namespace to prometheus definition

* Fix the amount of batch sizes recorded for DA

* Unify recordings of size of batch to be stored

* Improve Prometheus help text
Kourin1996 added a commit that referenced this pull request Aug 4, 2025
* Add Prometheus metrics for AltDA failover in Batcher

* Fix calls of RecordBatchDaType

* Revert deleted comment

* Add metrics for total stored batch size

* Fix condition for RecordBatchDaType and RecordBatchDataSizeBytes

* Add missing namespace to prometheus definition

* Fix the amount of batch sizes recorded for DA

* Unify recordings of size of batch to be stored

* Improve Prometheus help text
Kourin1996 added a commit that referenced this pull request Aug 6, 2025
* Add Prometheus metrics for AltDA failover in Batcher

* Fix calls of RecordBatchDaType

* Revert deleted comment

* Add metrics for total stored batch size

* Fix condition for RecordBatchDaType and RecordBatchDataSizeBytes

* Add missing namespace to prometheus definition

* Fix the amount of batch sizes recorded for DA

* Unify recordings of size of batch to be stored

* Improve Prometheus help text
Kourin1996 added a commit that referenced this pull request Aug 7, 2025
* Add Prometheus metrics for AltDA failover in Batcher

* Fix calls of RecordBatchDaType

* Revert deleted comment

* Add metrics for total stored batch size

* Fix condition for RecordBatchDaType and RecordBatchDataSizeBytes

* Add missing namespace to prometheus definition

* Fix the amount of batch sizes recorded for DA

* Unify recordings of size of batch to be stored

* Improve Prometheus help text
Kourin1996 added a commit that referenced this pull request Aug 8, 2025
* Add Prometheus metrics for AltDA failover in Batcher

* Fix calls of RecordBatchDaType

* Revert deleted comment

* Add metrics for total stored batch size

* Fix condition for RecordBatchDaType and RecordBatchDataSizeBytes

* Add missing namespace to prometheus definition

* Fix the amount of batch sizes recorded for DA

* Unify recordings of size of batch to be stored

* Improve Prometheus help text
Kourin1996 added a commit that referenced this pull request Aug 8, 2025
* Add Prometheus metrics for AltDA failover in Batcher

* Fix calls of RecordBatchDaType

* Revert deleted comment

* Add metrics for total stored batch size

* Fix condition for RecordBatchDaType and RecordBatchDataSizeBytes

* Add missing namespace to prometheus definition

* Fix the amount of batch sizes recorded for DA

* Unify recordings of size of batch to be stored

* Improve Prometheus help text
Kourin1996 added a commit that referenced this pull request Aug 8, 2025
* Add Prometheus metrics for AltDA failover in Batcher

* Fix calls of RecordBatchDaType

* Revert deleted comment

* Add metrics for total stored batch size

* Fix condition for RecordBatchDaType and RecordBatchDataSizeBytes

* Add missing namespace to prometheus definition

* Fix the amount of batch sizes recorded for DA

* Unify recordings of size of batch to be stored

* Improve Prometheus help text
Kourin1996 added a commit that referenced this pull request Aug 11, 2025
* Add Prometheus metrics for AltDA failover in Batcher

* Fix calls of RecordBatchDaType

* Revert deleted comment

* Add metrics for total stored batch size

* Fix condition for RecordBatchDaType and RecordBatchDataSizeBytes

* Add missing namespace to prometheus definition

* Fix the amount of batch sizes recorded for DA

* Unify recordings of size of batch to be stored

* Improve Prometheus help text
Kourin1996 added a commit that referenced this pull request Aug 11, 2025
* Add Prometheus metrics for AltDA failover in Batcher

* Fix calls of RecordBatchDaType

* Revert deleted comment

* Add metrics for total stored batch size

* Fix condition for RecordBatchDaType and RecordBatchDataSizeBytes

* Add missing namespace to prometheus definition

* Fix the amount of batch sizes recorded for DA

* Unify recordings of size of batch to be stored

* Improve Prometheus help text
gastonponti pushed a commit that referenced this pull request Sep 22, 2025
* Add Prometheus metrics for AltDA failover in Batcher

* Fix calls of RecordBatchDaType

* Revert deleted comment

* Add metrics for total stored batch size

* Fix condition for RecordBatchDaType and RecordBatchDataSizeBytes

* Add missing namespace to prometheus definition

* Fix the amount of batch sizes recorded for DA

* Unify recordings of size of batch to be stored

* Improve Prometheus help text
gastonponti pushed a commit that referenced this pull request Sep 22, 2025
* Add Prometheus metrics for AltDA failover in Batcher

* Fix calls of RecordBatchDaType

* Revert deleted comment

* Add metrics for total stored batch size

* Fix condition for RecordBatchDaType and RecordBatchDataSizeBytes

* Add missing namespace to prometheus definition

* Fix the amount of batch sizes recorded for DA

* Unify recordings of size of batch to be stored

* Improve Prometheus help text
gastonponti pushed a commit that referenced this pull request Sep 23, 2025
* Add Prometheus metrics for AltDA failover in Batcher

* Fix calls of RecordBatchDaType

* Revert deleted comment

* Add metrics for total stored batch size

* Fix condition for RecordBatchDaType and RecordBatchDataSizeBytes

* Add missing namespace to prometheus definition

* Fix the amount of batch sizes recorded for DA

* Unify recordings of size of batch to be stored

* Improve Prometheus help text
gastonponti pushed a commit that referenced this pull request Jan 8, 2026
* Add Prometheus metrics for AltDA failover in Batcher

* Fix calls of RecordBatchDaType

* Revert deleted comment

* Add metrics for total stored batch size

* Fix condition for RecordBatchDaType and RecordBatchDataSizeBytes

* Add missing namespace to prometheus definition

* Fix the amount of batch sizes recorded for DA

* Unify recordings of size of batch to be stored

* Improve Prometheus help text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AltDA fallback: add metrics

5 participants