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 metrics for SCIOND client API #3254

Merged
merged 3 commits into from
Oct 16, 2019
Merged

Add metrics for SCIOND client API #3254

merged 3 commits into from
Oct 16, 2019

Conversation

scrye
Copy link
Contributor

@scrye scrye commented Oct 16, 2019

Added metrics:

# HELP lib_sciond_conn_connections_total The amount of SCIOND connection
attempts.
# TYPE lib_sciond_conn_connections_total counter
lib_sciond_conn_connections_total{result="ok_success"} 5
# HELP lib_sciond_path_requests_total The amount of Path requests sent.
# TYPE lib_sciond_path_requests_total counter
lib_sciond_path_request_total{result="ok_success"} 4

Metrics for the other client API calls are also included.


This change is Reviewable

@scrye scrye added SCIOND feature New feature or request c/observability Metrics, logging, tracing labels Oct 16, 2019
@scrye scrye requested a review from lukedirtwalker October 16, 2019 10:54
@scrye scrye self-assigned this Oct 16, 2019
Copy link
Collaborator

@lukedirtwalker lukedirtwalker left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 4 files at r1.
Reviewable status: 3 of 4 files reviewed, 1 unresolved discussion (waiting on @lukedirtwalker and @scrye)


go/lib/sciond/sciond.go, line 278 at r1 (raw file):

	roundTripper, err := c.ctxAwareConnect(ctx)
	if err != nil {
		metrics.SVCInfos.Inc(errorToPrometheusLabel(err))

this is probably at the wrong place. As discussed probably it's better to do it here and before the return with nil error.

Copy link
Collaborator

@lukedirtwalker lukedirtwalker left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 4 files at r1.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @scrye)


go/lib/sciond/internal/metrics/metrics.go, line 79 at r1 (raw file):

func newPathRequest() Request {
	return Request{
		count: prom.NewCounterVec(Namespace, subsystemPath, "request_total",

should be requests_total

Copy link
Contributor Author

@scrye scrye left a comment

Choose a reason for hiding this comment

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

Reviewable status: 2 of 4 files reviewed, 2 unresolved discussions (waiting on @lukedirtwalker)


go/lib/sciond/sciond.go, line 278 at r1 (raw file):

Previously, lukedirtwalker (Lukas Vogel) wrote…

this is probably at the wrong place. As discussed probably it's better to do it here and before the return with nil error.

Done.


go/lib/sciond/internal/metrics/metrics.go, line 79 at r1 (raw file):

Previously, lukedirtwalker (Lukas Vogel) wrote…

should be requests_total

Done.

scrye added 2 commits October 16, 2019 13:43
```
# HELP lib_sciond_conn_connections_total The amount of SCIOND connection
attempts.
# TYPE lib_sciond_conn_connections_total counter
lib_sciond_conn_connections_total{result="ok_success"} 5
# HELP lib_sciond_path_request_total The amount of Path requests sent.
# TYPE lib_sciond_path_request_total counter
lib_sciond_path_request_total{result="ok_success"} 4
```

Metrics for the other client API calls are also included.
Copy link
Collaborator

@lukedirtwalker lukedirtwalker left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r2.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @scrye)


go/lib/sciond/internal/metrics/metrics.go, line 79 at r1 (raw file):

Previously, scrye (Sergiu Costea) wrote…

Done.

Only on one metric? Doesn't it need to be everywhere?

Copy link
Contributor Author

@scrye scrye left a comment

Choose a reason for hiding this comment

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

Reviewable status: 3 of 4 files reviewed, 1 unresolved discussion (waiting on @lukedirtwalker)


go/lib/sciond/internal/metrics/metrics.go, line 79 at r1 (raw file):

Previously, lukedirtwalker (Lukas Vogel) wrote…

Only on one metric? Doesn't it need to be everywhere?

Whoops, missed this one. Fixed.

Copy link
Collaborator

@lukedirtwalker lukedirtwalker left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 1 of 1 files at r3.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@scrye scrye merged commit 9ed14c9 into scionproto:master Oct 16, 2019
@scrye scrye deleted the pubpr-fix-3109 branch October 16, 2019 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c/observability Metrics, logging, tracing feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants