-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
identify: add metrics #2126
identify: add metrics #2126
Conversation
metrics added: address count protocol count peer push support
8341157
to
557aac3
Compare
dashboards/identify/identify.json
Outdated
"title": "Outgoing Address Count", | ||
"type": "gauge" |
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.
This looks a bit misleading since the gauge is never full. Any suggestions here?
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.
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.
fixed this.
dashboards/identify/identify.json
Outdated
"title": "Outgoing Protocols Count", | ||
"type": "gauge" | ||
}, |
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.
Same here the gauge may be a bit empty and so a bit misleading.
p2p/protocol/identify/id.go
Outdated
} | ||
mes.ListenAddrs = append(mes.ListenAddrs, addr.Bytes()) | ||
} | ||
if ids.metricsTracer != nil { | ||
ids.metricsTracer.NumProtocols(len(mes.Protocols)) | ||
ids.metricsTracer.NumAddrs(len(mes.ListenAddrs)) | ||
} |
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.
we can simplify this a bit if we are fine with counting snaphot.Addrs as Num Address Sent.
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'm wondering if we should rework the API a bit. Might be nice to have a Identify{Push}Received(numProtos, numAddrs int)
. wdyt?
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.
agreed. will fix this.
@marten-seemann left comments at a few places where I'm confused. Suggestions would be very helpful. |
p2p/protocol/identify/id.go
Outdated
} | ||
mes.ListenAddrs = append(mes.ListenAddrs, addr.Bytes()) | ||
} | ||
if ids.metricsTracer != nil { | ||
ids.metricsTracer.NumProtocols(len(mes.Protocols)) | ||
ids.metricsTracer.NumAddrs(len(mes.ListenAddrs)) | ||
} |
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'm wondering if we should rework the API a bit. Might be nice to have a Identify{Push}Received(numProtos, numAddrs int)
. wdyt?
07219a7
to
bc36042
Compare
bc36042
to
0f0778c
Compare
addressed review comments. This looks much cleaner now. I think we can remove counting peers by push support. On my node there are no peers with push not supported. So it doesn't look too useful. Do you think this metric would be useful? |
123f806
to
81f80d2
Compare
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.
lgtm
added metrics for:
address count
protocol count
peer push support