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: add k8s {deployment, daemonset, statefulset, job} resources #6401

Merged
merged 5 commits into from
Nov 12, 2024

Conversation

srikanthccv
Copy link
Member

@srikanthccv srikanthccv commented Nov 8, 2024

Summary

Part of #5373


Important

Adds Kubernetes deployment metrics handling to the query service with new API routes and data models.

  • Behavior:
    • Adds DeploymentsRepo to handle Kubernetes deployment metrics in deployments.go.
    • New API routes in http_handler.go for deployment attribute keys, values, and list.
  • Models:
    • Adds DeploymentListRequest and DeploymentListResponse to infra.go.
    • Adds DeploymentListRecord to infra.go.
  • Queries:
    • Adds getParamsForTopDeployments() in common.go for deployment queries.
    • Adds deployment-specific queries in workload_query.go.
  • Misc:
    • Updates APIHandler in http_handler.go to include deploymentsRepo.

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

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 9aa761f in 1 minute and 14 seconds

More details
  • Looked at 782 lines of code in 6 files
  • Skipped 0 files when reviewing.
  • Skipped posting 5 drafted comments based on config settings.
1. pkg/query-service/app/inframetrics/common.go:76
  • Draft comment:
    The getParamsForTopDeployments function is redundant as it only calls getParamsForTopItems. Consider removing it and using getParamsForTopItems directly.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The getParamsForTopDeployments function in pkg/query-service/app/inframetrics/common.go is redundant as it simply calls getParamsForTopItems. This pattern is repeated for other similar functions as well.
2. pkg/query-service/app/inframetrics/deployments.go:152
  • Draft comment:
    Modifying req.GroupBy directly can lead to unexpected side effects. Consider creating a copy of req before modification to avoid this issue.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    In pkg/query-service/app/inframetrics/deployments.go, the getMetadataAttributes function modifies the req.GroupBy parameter, which can lead to unexpected side effects if the request object is reused. This pattern is repeated in other similar functions as well.
3. pkg/query-service/app/inframetrics/deployments.go:255
  • Draft comment:
    Using math.Min for limit calculation can lead to incorrect results if req.Offset is greater than the length of formattedResponse[0].Series. Consider adding a check to ensure req.Offset is within bounds.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    In pkg/query-service/app/inframetrics/deployments.go, the getTopDeploymentGroups function uses math.Min to calculate the limit, which can lead to incorrect results if req.Offset is greater than the length of formattedResponse[0].Series. This pattern is repeated in other similar functions as well.
4. pkg/query-service/app/inframetrics/workload_query.go:6
  • Draft comment:
    Ensure consistency in key naming between metricNamesForWorkloads and queryNamesForDeployments to avoid confusion and potential errors.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    In pkg/query-service/app/inframetrics/workload_query.go, the metricNamesForWorkloads map uses inconsistent keys compared to the queryNamesForDeployments map in deployments.go. This inconsistency can lead to confusion and potential errors.
5. pkg/query-service/app/http_handler.go:195
  • Draft comment:
    Do not add non-ClickHouse related functions to the ClickHouseReader interface. Use the DAO in the telemetry instance to access such information instead.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable:
    The comment does not appear to be related to any specific change in the diff. It seems to be a general guideline rather than a comment on a specific code change. The diff does not show any modifications to the ClickHouseReader interface or any indication that non-ClickHouse related functions were added to it.
    I might be missing some context about the ClickHouseReader interface or the overall architecture, but based on the diff provided, there is no indication that the comment is relevant to the changes made.
    Given the lack of evidence in the diff, it is reasonable to conclude that the comment is not relevant to the changes made.
    The comment should be deleted as it does not pertain to any specific change in the diff and seems to be a general guideline rather than a necessary code change.

Workflow ID: wflow_iMGQh8voK2nOrlap


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

@srikanthccv srikanthccv changed the title chore: add k8s deployment resources chore: add k8s {deployment, daemonset, statefulset, job} resources Nov 10, 2024
Copy link
Member

@shivanshuraj1333 shivanshuraj1333 left a comment

Choose a reason for hiding this comment

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

lgtm, thanks!

@srikanthccv srikanthccv enabled auto-merge (squash) November 12, 2024 15:11
@srikanthccv srikanthccv merged commit fd9e9f0 into develop Nov 12, 2024
16 checks passed
@srikanthccv srikanthccv deleted the add-deployment branch November 12, 2024 15:23
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.

2 participants