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

Record metrics #17

Merged
merged 2 commits into from
Oct 21, 2021
Merged

Conversation

jeffreypicard
Copy link
Collaborator

There are a couple metrics that try to mirror the ones from python,
many of the python ones don't apply, and vice-versa.
closes #8

There are a couple metrics that try to mirror the ones from python,
many of the python ones don't apply, and vice-versa.
@@ -44,7 +46,7 @@ type record struct {
RepostCount uint32 `json:"repost_count"`
EffectiveAmount uint64 `json:"effective_amount"`
SupportAmount uint64 `json:"support_amount"`
TrendingScore float64 `json:"TrendingScore"`
TrendingScore float64 `json:"trending_score"`
Copy link
Member

Choose a reason for hiding this comment

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

👍

server/search.go Outdated
// TODO record metric search_counter
t0 := time.Now()
metrics.RequestsCount.With(prometheus.Labels{"method": "search"}).Inc()
metrics.SessionCount.Inc()
Copy link
Member

Choose a reason for hiding this comment

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

does calling Search really start a new session? seems like that should go somewhere else

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Perhaps this is a misnomer, I wanted to replicate this metric https://github.com/lbryio/lbry-sdk/blob/master/lbry/wallet/server/session.py#L140 I figured that since each search is a grpc call that it would constitute a client "session" connected to the hub.

Consolidated error metrics into a vector counter with a label,
removed other uneeded counters.
@jeffreypicard jeffreypicard merged commit e12c26f into master Oct 21, 2021
@jeffreypicard jeffreypicard deleted the jeffreypicard/8/add-prometheus-metrics branch October 21, 2021 12:32
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.

Add prometheus metrics
3 participants