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

autorelay: add metrics #2185

Merged
merged 10 commits into from
Apr 5, 2023
Merged

autorelay: add metrics #2185

merged 10 commits into from
Apr 5, 2023

Conversation

sukunrt
Copy link
Member

@sukunrt sukunrt commented Mar 15, 2023

metrics added:
relay finder status

reservation request outcomes
current reservations

candidate circuit v2 support
current candidates

relay addresses updated
num relay address

scheduled work times

closes: #2181

@sukunrt
Copy link
Member Author

sukunrt commented Mar 15, 2023

@marten-seemann
In https://github.com/sukunrt/kubo/tree/autorelay-metrics I've updated the Dockerfile to run ufw along with kubo inside the container. The go.mod points to the HEAD of this branch. This starts kubo with private reachability.
Alternatively you can also pass ForceReachabilityPrivate to libp2p constructor to test this.

For RelayReservation Requests I'm not tracking the error reason currently. that would require client.Reserve function to return that information. Should I change this function signature or do you have any other ideas?

@sukunrt sukunrt force-pushed the autorelay-metrics branch 3 times, most recently from 3e3bccd to bb3a62c Compare March 16, 2023 11:42
@sukunrt sukunrt marked this pull request as ready for review March 16, 2023 12:07
@marten-seemann marten-seemann self-requested a review March 21, 2023 04:31
@sukunrt sukunrt force-pushed the autorelay-metrics branch 2 times, most recently from f2d358e to 5c8dce8 Compare March 21, 2023 16:51
metrics added:
relay finder status

reservation request outcomes
current reservations

candidate circuit v2 support
current candidates

relay addresses updated
num relay address

scheduled work times
}

func (re ReservationError) Error() string {
return fmt.Sprintf("reservation error: status: %s reason: %s err: %s", pbv2.Status_name[int32(re.Status)], re.Reason, re.err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason to not just use the String method on the status?

Suggested change
return fmt.Sprintf("reservation error: status: %s reason: %s err: %s", pbv2.Status_name[int32(re.Status)], re.Reason, re.err)
return fmt.Sprintf("reservation error: status: %s reason: %s err: %s", re.Status, re.Reason, re.err)

return "success"
}

status := "err other"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
status := "err other"
status := "other"

@marten-seemann marten-seemann merged commit 15ec149 into master Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

autorelay: expose metrics
2 participants