Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add metric for data availability wait time #13534

Merged
merged 4 commits into from
Jan 26, 2024

Conversation

terencechain
Copy link
Member

This PR introduces a valuable metric: data availability wait time. This metric measures the duration a node is blocked at ReceiveBlock, making it crucial to monitor.

@terencechain terencechain added the Ready For Review A pull request ready for code review label Jan 26, 2024
@terencechain terencechain requested a review from a team as a code owner January 26, 2024 15:48
dataAvabilityWaitedTime = promauto.NewSummary(prometheus.SummaryOpts{
Name: "da_waited_time_milliseconds",
Help: "Total time to wait for a data availability check in ReceiveBlock(), a node is blocked during this time",
})
Copy link
Contributor

Choose a reason for hiding this comment

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

suggest “total time spent waiting”. also do we need the comment about the node blocking in the metric description? i’m sure that fact is true about a number of other metrics.

Copy link
Member Author

Choose a reason for hiding this comment

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

"total time spent waiting" is a bit vague. It could be waiting for a lot of things. How about "total time spent waiting da"?

Copy link
Contributor

Choose a reason for hiding this comment

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

That's basically what I meant - replace "Total time to wait for a data availability check", with "Total time spent waiting for a data availability check".

@@ -209,6 +209,7 @@ func (s *Service) ReceiveBlock(ctx context.Context, block interfaces.ReadOnlySig

timeWithoutDaWait := time.Since(receivedTime) - daWaitedTime
chainServiceProcessingTime.Observe(float64(timeWithoutDaWait.Milliseconds()))
dataAvabilityWaitedTime.Observe(float64(daWaitedTime.Milliseconds()))
Copy link
Contributor

Choose a reason for hiding this comment

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

There are some error returns between this metrics update and where daWaitedTime is set. I think we should call Observe right after line 124.

kasey
kasey previously approved these changes Jan 26, 2024
@terencechain terencechain added this pull request to the merge queue Jan 26, 2024
Merged via the queue into develop with commit 23b0718 Jan 26, 2024
17 checks passed
@terencechain terencechain deleted the add-da-wait-time-metric branch January 26, 2024 18:39
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready For Review A pull request ready for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants