-
Notifications
You must be signed in to change notification settings - Fork 173
doc: Add metrics doc #3162
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
doc: Add metrics doc #3162
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.
Reviewed 1 of 1 files at r2.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @lukedirtwalker and @oncilla)
doc/Metrics.md, line 104 at r1 (raw file):
strucst
s/to/the/
doc/Metrics.md, line 136 at r1 (raw file):
beacons: prom.NewCounterVec(Namespace, sub, "beacons_total", "Total number of beacons originated.", OriginatorLabels.Labels()), time: prom.NewCounter(Namespace, sub, "time_seconds_total",
I think "duration" is a better name here (following the example of http_request_duration_seconds
in https://prometheus.io/docs/practices/naming/).
doc/Metrics.md, line 184 at r1 (raw file):
func (in *input) BytesWith(l SocketLabels) prometheus.Counter {
This should be PktSize
doc/Metrics.md, line 202 at r1 (raw file):
func (s *Sender) Run(ctx context.Context) { l := metrics.KeepaliveLabel{IfID: ifid, Result: metrics.ErrNotClassified}
You need to drop ifid
from here, and instead set l.Ifid
at the top of the loop.
doc/Metrics.md, line 247 at r1 (raw file):
1. Namespace should be one word 1. Subsystem should be one word (if present) 1. Use values that can be search with regex. E.g. prepend `err_` for every error result.
searched
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.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @lukedirtwalker and @oncilla)
doc/Metrics.md, line 202 at r1 (raw file):
Previously, kormat (Stephen Shirley) wrote…
You need to drop
ifid
from here, and instead setl.Ifid
at the top of the loop.
Actually i think you want to move this entire line to the top of the loop.
f8e6697
to
e99d7bb
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.
Reviewable status: 0 of 1 files reviewed, 5 unresolved discussions (waiting on @kormat and @lukedirtwalker)
doc/Metrics.md, line 104 at r1 (raw file):
Previously, kormat (Stephen Shirley) wrote…
strucst
s/to/the/
Done.
doc/Metrics.md, line 136 at r1 (raw file):
Previously, kormat (Stephen Shirley) wrote…
I think "duration" is a better name here (following the example of
http_request_duration_seconds
in https://prometheus.io/docs/practices/naming/).
Done.
doc/Metrics.md, line 184 at r1 (raw file):
Previously, kormat (Stephen Shirley) wrote…
This should be PktSize
Done.
doc/Metrics.md, line 202 at r1 (raw file):
Previously, kormat (Stephen Shirley) wrote…
Actually i think you want to move this entire line to the top of the loop.
yes, you're right.
Done.
doc/Metrics.md, line 247 at r1 (raw file):
Previously, kormat (Stephen Shirley) wrote…
searched
Done.
doc/Metrics.md, line 119 at r3 (raw file):
If we export that, then we need a comment so everyone to follow that |
doc/Metrics.md, line 114 at r3 (raw file):
Comment for the linter? |
doc/Metrics.md, line 213 at r3 (raw file):
Ideally the usage example should be mapped to the example definition. For example what is Transmit? expecting to find somewhere above |
doc/Metrics.md, line 80 at r3 (raw file):
Is there a reason why we need to export it? Then let's agree on a comment |
doc/Metrics.md, line 123 at r3 (raw file):
there a typo (it was why i could search where is being used :) ) |
doc/Metrics.md, line 26 at r3 (raw file):
For completeness, the metric/keepalive should be there also |
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.
Reviewed 1 of 1 files at r3.
Reviewable status: all files reviewed, 6 unresolved discussions (waiting on @lukedirtwalker and @oncilla)
e99d7bb
to
0710dc1
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.
Reviewable status: 0 of 1 files reviewed, 6 unresolved discussions (waiting on @karampok, @kormat, @lukedirtwalker, and @oncilla)
doc/Metrics.md, line 80 at r3 (raw file):
Previously, karampok (Konstantinos) wrote…
Is there a reason why we need to export it? Then let's agree on a comment
Done.
doc/Metrics.md, line 114 at r3 (raw file):
Previously, karampok (Konstantinos) wrote…
Comment for the linter?
Suggestiong
// KeepaliveLabels is used by clients to pass in a safe way labels
// values to prometheus metric types (e.g. counter).
Added more generic string.
doc/Metrics.md, line 119 at r3 (raw file):
Previously, karampok (Konstantinos) wrote…
If we export that, then we need a comment so everyone to follow that
This is a trade-off between testability and minimal API design.
see: https://github.com/scionproto/scion/blob/043fdd7da50d946d65d43278979c6955c1f66ae7/go/lib/prom/promtest/promtest.go
doc/Metrics.md, line 123 at r3 (raw file):
Previously, karampok (Konstantinos) wrote…
there a typo (it was why i could search where is being used :) )
Done.
doc/Metrics.md, line 213 at r3 (raw file):
Previously, karampok (Konstantinos) wrote…
Ideally the usage example should be mapped to the example definition. For example what is Transmit? expecting to find somewhere above
Done.
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.
Reviewable status: 0 of 1 files reviewed, 6 unresolved discussions (waiting on @karampok, @kormat, and @lukedirtwalker)
doc/Metrics.md, line 26 at r3 (raw file):
Previously, karampok (Konstantinos) wrote…
For completeness, the metric/keepalive should be there also
Done.
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.
Reviewed 1 of 1 files at r4.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @lukedirtwalker)
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.
Reviewed 1 of 1 files at r4.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @lukedirtwalker)
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.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @lukedirtwalker and @oncilla)
doc/Metrics.md, line 31 at r4 (raw file):
│ │ └── sender.go │ └── beaconing │ ├── keepalive.go
this is under metrics, no?
doc/Metrics.md, line 124 at r4 (raw file):
// Labels returns the list of labels. func (l *OriginatorLabels) Labels() []string{
do we need the *pointer?
0649703
to
f43db34
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.
Reviewable status: 0 of 1 files reviewed, 2 unresolved discussions (waiting on @karampok and @kormat)
doc/Metrics.md, line 31 at r4 (raw file):
Previously, karampok (Konstantinos) wrote…
this is under metrics, no?
ah, yes.
Done.
doc/Metrics.md, line 124 at r4 (raw file):
Previously, karampok (Konstantinos) wrote…
do we need the *pointer?
we don't have to, but it's best practice to keep the receiver types consistent.
https://golang.org/doc/faq#methods_on_values_or_pointers
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.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @karampok, @kormat, and @oncilla)
doc/Metrics.md, line 124 at r4 (raw file):
Previously, Oncilla wrote…
we don't have to, but it's best practice to keep the receiver types consistent.
https://golang.org/doc/faq#methods_on_values_or_pointers
I would keep both without
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.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @karampok and @kormat)
doc/Metrics.md, line 124 at r4 (raw file):
Previously, karampok (Konstantinos) wrote…
I would keep both without
Done.
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.
Reviewed 1 of 1 files at r5.
Reviewable status:complete! all files reviewed, all discussions resolved
Add a metrics doc that outlines the way we instrument the code.
e5c0ca4
to
3ce50f6
Compare
Add a metrics doc that outlines the way we instrument the code.
This change is