-
Notifications
You must be signed in to change notification settings - Fork 35
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
feat: add golang runtime metrics, process metrics and std lib db metrics #1197
Conversation
291cc12
to
7d66857
Compare
base/gfspapp/app_options.go
Outdated
@@ -256,6 +256,13 @@ func DefaultGfSpDBOption(app *GfSpBaseApp, cfg *gfspconfig.GfSpConfig) error { | |||
return | |||
} | |||
app.gfSpDB = db |
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.
Should we place app.gfSpDB = db at the end of the function because db may be modified by RegisterStdDBStats?
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
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.
db is not modified by RegisterStdDBStats, this function is just used to get some db metrics.
pkg/metrics/metric_items.go
Outdated
// golang runtime and process metrics | ||
collectors.NewGoCollector(collectors.WithGoCollectorRuntimeMetrics(collectors.GoRuntimeMetricsRule{ | ||
Matcher: regexp.MustCompile("/.*")})), | ||
collectors.NewProcessCollector(collectors.ProcessCollectorOpts{}), |
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.
Keep consistent with the above, define a variable.
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
…ics (#1197) * feat: add golang runtime metrics, process metrics and std lib db metrics * fix: define golang runtime and process metrics as variables --------- Co-authored-by: VM <arimas@foxmail.com>
Description
Add golang runtime metrics, process metrics and std lib db metrics to improve availability.
Rationale
Improve availability and speed to debug problems.
Example
curl http://localhost:24367/metrics
Changes
Notable changes: