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

chore: use any of [cpu.usage, cpu.utilization] for cpu #7017

Merged
merged 6 commits into from
Feb 6, 2025

Conversation

srikanthccv
Copy link
Member

@srikanthccv srikanthccv commented Feb 3, 2025

Summary

Fixes #7016


Important

Support transitioning metric names in queries by allowing both old and new names, with updates to query logic and tests.

  • Behavior:
    • Queries now support both old and new metric names for transitioning metrics using ClickHouseFormattedMetricNames() in utils/format.go.
    • Updated query logic to handle metric name transitions in PrepareTimeseriesFilterQuery() and PrepareTimeseriesFilterQueryV3() in helpers/sub_query.go.
  • Metrics:
    • Added MetricsUnderTransition map in metrics/transition.go to define old-to-new metric name mappings.
  • Tests:
    • Updated test cases in query_builder_test.go and query_builder_pre_agg_test.go to verify query construction with transitioning metric names.

This description was created by Ellipsis for 640b7d8. It will automatically update as commits are pushed.

@github-actions github-actions bot added the chore label Feb 3, 2025
@srikanthccv srikanthccv marked this pull request as ready for review February 4, 2025 18:33
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Reviewed everything up to 640b7d8 in 1 minute and 33 seconds

More details
  • Looked at 827 lines of code in 20 files
  • Skipped 0 files when reviewing.
  • Skipped posting 6 drafted comments based on config settings.
1. pkg/query-service/metrics/transition.go:3
  • Draft comment:
    Mapping for CPU metrics transition added. Verify that the new mapping keys align with expected naming conventions.
  • Reason this comment was not posted:
    Comment did not seem useful.
2. pkg/query-service/utils/format.go:234
  • Draft comment:
    ClickHouseFormattedMetricNames now checks MetricsUnderTransition. Confirm that returning a formatted slice is compatible with downstream query building.
  • Reason this comment was not posted:
    Comment did not seem useful.
3. pkg/query-service/metrics/transition.go:3
  • Draft comment:
    The transition mapping for CPU-related metrics is clear. Ensure that these keys cover all use-cases (e.g. cpu.usage vs cpu.utilization) required by issue 7016 and consider adding comments or tests for future extensibility.
  • Reason this comment was not posted:
    Marked as duplicate.
4. pkg/query-service/utils/format.go:234
  • Draft comment:
    ClickHouseFormattedMetricNames correctly wraps the original metric name with its alternative if available. This effectively supports the 'use any of' requirement. Consider adding unit tests to cover edge cases.
  • Reason this comment was not posted:
    Marked as duplicate.
5. pkg/query-service/utils/format.go:247
  • Draft comment:
    The AddBackTickToFormatTag helper function is simple and clear. It might also be useful to add a brief comment explaining why dot-containing tags need backticks.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    None
6. pkg/query-service/utils/format.go:261
  • Draft comment:
    The getPointerValue helper is a practical approach to dereference pointers passed in. It ensures uniform handling of pointer vs non-pointer types.
  • Reason this comment was not posted:
    Confidence changes required: 0%
    None

Workflow ID: wflow_2CPfpgOLrbUo6hyG


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@srikanthccv srikanthccv enabled auto-merge (squash) February 6, 2025 11:39
@srikanthccv srikanthccv merged commit 6d8d2e6 into main Feb 6, 2025
15 of 16 checks passed
@srikanthccv srikanthccv deleted the deprecated-metrics branch February 6, 2025 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for *.cpu.usage kubelet metric names
2 participants