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

Fix #905: use SUM_LOCK_TIME and SUM_CPU_TIME with mysql >= 8.0.28 #916

Merged
merged 3 commits into from
Feb 14, 2025

Conversation

cristiangreco
Copy link
Contributor

@cristiangreco cristiangreco commented Feb 10, 2025

Fix issue introduced in #862

Only query SUM_LOCK_TIME and SUM_CPU_TIME when using MySQL >= 8.0.28.

Fixes #905

…8.0.28

Fix issue introduced in prometheus#862

Only query SUM_LOCK_TIME and SUM_CPU_TIME when using MySQL >= 8.0.28.

Fixes prometheus#905

Signed-off-by: Cristian Greco <[email protected]>
@cristiangreco cristiangreco marked this pull request as ready for review February 10, 2025 21:23
@cristiangreco cristiangreco requested a review from SuperQ February 11, 2025 17:33
@SuperQ
Copy link
Member

SuperQ commented Feb 14, 2025

I think we typically version the whole query rather than try and do string manipulation.

Copy link
Member

@SuperQ SuperQ left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +44 to +46
if pb.Summary != nil {
return MetricResult{labels: labels, value: pb.GetSummary().GetSampleSum(), metricType: dto.MetricType_SUMMARY}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ideally would add quantiles as well, but that seems too much refactoring for this PR.

@cristiangreco cristiangreco merged commit 9bddc1a into prometheus:main Feb 14, 2025
13 checks passed
@cristiangreco cristiangreco deleted the cristian/issue-905 branch February 14, 2025 13:41
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.

Unknown column 'SUM_CPU_TIME' in 'SELECT'"
3 participants