-
Notifications
You must be signed in to change notification settings - Fork 287
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
feat: adds channel ID label to the Prometheus message_receive_bytes_total and message_send_bytes_total metrics #1078
feat: adds channel ID label to the Prometheus message_receive_bytes_total and message_send_bytes_total metrics #1078
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[question] Since this PR targets v0.34.x-celestia, should it be forward-ported to main? Asking because I thought the usual workflow was to target main and backport to v0.34.x-celestia per https://github.com/celestiaorg/celestia-core#branches. cc: @cmwaters
[question] how was this PR tested? Did you manually verify the metric labels? Do you mind including that in the PR description?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
this seems like a logical change, although per this comment #1077 (comment) I've been able to do this before without adding an extra index here
@staheri14 perhaps its better to create a branch of celestia-app based on v1.x that is using this branch, and then we all view it in action on grafana by updating our mocha node to use that special version of v1.x
@evan-forbes Sounds good to me, will do that and update you here. |
Created this branch to test it on our mocha node. |
After some investigation it looks like that chID may have already been attached to the metrics targeted in this PR. So converting this to draft until we verify this. |
I was able to run a node (based off the lates main branch
Below is the full list of metrics, in case needed:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know the chID doesn't appear in the metrics w/o this change, but did we ever figure out why we are able to index by channel w/o it?
@@ -532,7 +534,8 @@ func createMConnection( | |||
} | |||
} | |||
p.metrics.PeerReceiveBytesTotal.With(labels...).Add(float64(len(msgBytes))) | |||
p.metrics.MessageReceiveBytesTotal.With("message_type", p.mlc.ValueToMetricLabel(msg)).Add(float64(len(msgBytes))) | |||
p.metrics.MessageReceiveBytesTotal.With("message_type", | |||
p.mlc.ValueToMetricLabel(msg), "chID", fmt.Sprintf("%#x", chID)).Add(float64(len(msgBytes))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[no changes needed]
using fmt.Sprintf in a heavy path is something to keep an eye on in the future
Can you please elaborate on this? When were we able to do index by channel id? And for which metrics? |
If we would like to have more granularity on the bw consumption per Peer, we can use
If there is no opposing opinion, I am going to start making queries and gathering the results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sgtm!
@evan-forbes Shall we merge this (or do we want to keep it open for future metrics that we may come up with)? the channel ID proved useful in our last traffic rate report using Prometheus metrics. I am more inclined toward merging it, wdyt? |
Got @evan-forbes confirmation in a sync call, so going to merge it. |
Part of #1077