Skip to content

Conversation

ekopanev
Copy link

@ekopanev ekopanev commented Sep 8, 2025

What does this PR do?

Updates the list of supported ClickHouse versions and corresponding metrics - now it can be automatically generated for all the relevant versions and metrics.

Motivation

  • currently very old and outdated versions of Clickhouse are supported
  • that's why the list of available metrics is very limited
  • it was always updated manually, so the list of metrics is also incomplete

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Add the qa/skip-qa label if the PR doesn't need to be tested during QA.
  • If you need to backport this PR to another branch, you can add the backport/<branch-name> label to the PR and it will automatically open a backport PR once this one is merged

Copy link

github-actions bot commented Sep 8, 2025

⚠️ Major version bump
The changelog type changed or removed was used in this Pull Request, so the next release will bump major version. Please make sure this is a breaking change, or use the fixed or added type instead.

METRIC_PATTERN = re.compile(r'\s+M\((?P<metric>\w+),\s*"(?P<description>[^"]+)"\)\s*\\?')
METRIC_TYPE_PATTERN = re.compile(r'\s+M\((?P<metric>\w+),\s*"(?P<description>[^"]+)",\s*(?P<type>[\w:]+)\)\s*\\?')
ASYNC_METRICS_PATTERN = re.compile(
r'new_values\["(?P<metric>[\w.]+)"\]\s*=\s*\{.*,\s*(?P<description>"[^}]*")*?\s*(?:\w+\s*)?\}', re.MULTILINE

Check failure

Code scanning / CodeQL

Inefficient regular expression High

This part of the regular expression may cause exponential backtracking on strings starting with 'new_values["."]={,"' and containing many repetitions of '""'.
Copy link
Author

Choose a reason for hiding this comment

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

this code and regex are used only in case of manual metrics re-generation for parsing multiline descriptions like this - https://github.com/ClickHouse/ClickHouse/blob/25.3/src/Common/AsynchronousMetrics.cpp#L1267-L1274

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant