-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Avoid adding sql mem metrics twice #47750
Avoid adding sql mem metrics twice #47750
Conversation
SQL memory metrics are registered twice and they are also reported twice by metrics exporters. This is specially strange on Prometheus histograms, where buckets are duplicated: sql_mem_sql_txn_max_bucket{le="+Inf"} 0.0 sql_mem_sql_txn_max_sum 0.0 sql_mem_sql_txn_max_count 0.0 sql_mem_sql_txn_max_bucket{le="+Inf"} 0.0 sql_mem_sql_txn_max_sum 0.0 sql_mem_sql_txn_max_count 0.0 Release note (bug fix): Remove duplicated SQL memory metrics.
Thank you for contributing to CockroachDB. Please ensure you have followed the guidelines for creating a PR. My owl senses detect your PR is good for review. Please keep an eye out for any test failures in CI. I was unable to automatically find a reviewer. You can try CCing one of the following members:
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan. |
@@ -469,8 +469,8 @@ func newSQLServer(ctx context.Context, cfg sqlServerArgs) (*sqlServer, error) { | |||
execCfg.StatsRefresher = statsRefresher | |||
|
|||
// Set up internal memory metrics for use by internal SQL executors. | |||
// Don't add them to the registry now because it will be added as part of pgServer metrics. |
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.
Here:
cockroach/pkg/server/server_sql.go
Lines 505 to 507 in 081a3a7
for _, m := range pgServer.Metrics() { | |
cfg.registry.AddMetricStruct(m) | |
} |
Hey @RaduBerinde, I have seen you have been working on some SQL telemetry fixes recently. Maybe you can review this PR? 🙂 Thanks! |
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:
complete! 1 of 0 LGTMs obtained
@RaduBerinde thanks for the review, do you know if there is anything else needed to have this merged? 🙂 |
Oh, sorry, merging now. bors r+ |
Build succeeded |
@jsoriano Hi Jaime. Thank you for contributing to CockroachDB this year. As a token of our appreciation we would like to send you a gift. Please DM me on our community Slack |
SQL memory metrics are registered twice and they are also reported
twice by metrics exporters. This is specially strange on Prometheus
histograms, where buckets are duplicated:
Release note (bug fix): Remove duplicated SQL memory metrics.