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

feat: implement nodes list table in infra monitoring #6615

Open
wants to merge 15 commits into
base: feat/infra-monitoring-k8s
Choose a base branch
from

Conversation

amlannandy
Copy link
Member

@amlannandy amlannandy commented Dec 11, 2024

Summary

Implement the nodes list table in Infra Monitoring

Related Issues / PR's

N/A

Screenshots

N/A

Affected Areas and Manually Tested Areas

Infra Monitoring section


Important

Implement Kubernetes nodes list feature in Infra Monitoring with new API, UI components, and hooks for data fetching and display.

  • API:
    • Add getK8sNodesList in getK8sNodesList.ts to fetch Kubernetes nodes.
    • Define interfaces K8sNodesListPayload, K8sNodesData, and K8sNodesListResponse.
  • UI Components:
    • Add K8sNodesList component in K8sNodesList.tsx for displaying nodes with pagination and sorting.
    • Update InfraMonitoringK8s.tsx to include K8sNodesList.
    • Modify K8sFiltersSidePanel.tsx and K8sHeader.tsx for dynamic column management.
  • Hooks:
    • Implement useGetK8sNodesList in useGetK8sNodesList.ts for querying nodes list.
  • Utilities:
    • Add utility functions in utils.tsx for data formatting and table columns.
    • Update constants.ts to include nodes-related quick filters.

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

@github-actions github-actions bot added the enhancement New feature or request label Dec 11, 2024
Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

@@ -14,6 +14,13 @@ import {
} from 'components/QuickFilters/QuickFilters';
import { DataTypes } from 'types/api/queryBuilder/queryAutocompleteResponse';

export interface IEntityColumn {
Copy link
Member Author

Choose a reason for hiding this comment

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

Using this instead of IPodColumn. As we're reusing it, thought it should have a more generic name.
We can remove IPodColumn in the end. I didn't rename it now to avoid conflicts.

@@ -127,4 +128,11 @@ function K8sHeader({
);
}

K8sHeader.defaultProps = {
Copy link
Member Author

Choose a reason for hiding this comment

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

Made these fields optional for list views where there is no metadata to show

@amlannandy amlannandy force-pushed the feat/infra-monitoring-k8s-nodes branch 2 times, most recently from ea32f5e to 0bbd4d0 Compare December 18, 2024 12:55
@amlannandy amlannandy force-pushed the feat/infra-monitoring-k8s-nodes branch from f8b95d1 to efd5c2c Compare December 18, 2024 18:13
Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

@amlannandy amlannandy marked this pull request as ready for review December 19, 2024 07:07
@amlannandy amlannandy requested a review from YounixM as a code owner December 19, 2024 07:07
Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

1 similar comment
Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

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.

❌ Changes requested. Reviewed everything up to 8a1558a in 2 minutes and 7 seconds

More details
  • Looked at 1006 lines of code in 9 files
  • Skipped 0 files when reviewing.
  • Skipped posting 5 drafted comments based on config settings.
1. frontend/src/container/InfraMonitoringK8s/K8sFiltersSidePanel/K8sFiltersSidePanel.tsx:129
  • Draft comment:
    Duplicate default export. Remove one of the export default K8sFiltersSidePanel; statements.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable:
    The comment claims there are duplicate default exports, but I can only see one export default statement in the file. The comment appears to be incorrect. The code follows a common pattern of defining the component, setting its defaultProps, and then exporting it once at the end.
    Could there be another export default statement that was removed in this diff that makes this comment relevant to the changes?
    Looking at the diff, I can see that the original code did have an export default on the component definition that was removed in favor of the new pattern. However, in the current state of the code, there is no duplicate export.
    The comment is incorrect for the current state of the code - there is no duplicate export default. The code has been properly refactored to use a single export.
2. frontend/src/container/InfraMonitoringK8s/K8sHeader.tsx:161
  • Draft comment:
    Duplicate default export. Remove one of the export default K8sHeader; statements.
  • Reason this comment was not posted:
    Comment was on unchanged code.
3. frontend/src/container/InfraMonitoringK8s/Nodes/utils.tsx:82
  • Draft comment:
    The orderBy field uses 'cpu' which does not match any field in K8sNodesData. Ensure the column name is correct.
  • Reason this comment was not posted:
    Comment did not seem useful.
4. frontend/src/container/InfraMonitoringK8s/utils.tsx:11
  • Draft comment:
    The orderBy field uses 'cpu' which does not match any field in K8sPodsData. Ensure the column name is correct.
  • Reason this comment was not posted:
    Comment did not seem useful.
5. frontend/src/container/InfraMonitoringK8s/Nodes/K8sNodesList.tsx:112
  • Draft comment:
    Avoid using inline styles in React components. Instead, use external stylesheets, CSS classes, or styled components.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.

Workflow ID: wflow_vV8t4Cw8NM6YDObK


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

</div>
),
clusterName: node.meta.k8s_cluster_name,
cpuUtilization: node.nodeCPUUsage === -1 ? '-' : node.nodeCPUUsage,
Copy link
Member Author

Choose a reason for hiding this comment

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

Showing - instead of -1 to denote invalid value

@amlannandy amlannandy force-pushed the feat/infra-monitoring-k8s-nodes branch from 8a1558a to c951cd0 Compare December 19, 2024 10:24
Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

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! Incremental review on 26a6959 in 45 seconds

More details
  • Looked at 42 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 drafted comments based on config settings.
1. frontend/src/container/InfraMonitoringK8s/Nodes/K8sNodesList.tsx:404
  • Draft comment:
    Consider creating a utility function to handle resetting expandedRowKeys to improve code readability and maintainability. This is applicable in multiple places where setExpandedRowKeys([]) is used.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The setExpandedRowKeys is used in multiple places to reset the expanded rows. It would be more efficient to use a single function to handle this logic, improving code readability and maintainability.
2. frontend/src/container/InfraMonitoringK8s/Nodes/K8sNodesList.tsx:478
  • Draft comment:
    Consider creating a utility function to handle resetting expandedRowKeys to improve code readability and maintainability. This is applicable in multiple places where setExpandedRowKeys([]) is used.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The expandedRowKeys state is being reset in multiple places. It would be beneficial to have a utility function to handle this logic, which would improve code readability and maintainability.
3. frontend/src/container/InfraMonitoringK8s/Nodes/K8sNodesList.tsx:480
  • Draft comment:
    Avoid using inline styles for the Spin component. Consider using CSS classes or styled components instead.
  • Reason this comment was not posted:
    Comment was not on a valid diff hunk.

Workflow ID: wflow_vYKGCHCTPSGUmUMa


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

@amlannandy amlannandy force-pushed the feat/infra-monitoring-k8s-nodes branch from 26a6959 to b5d57e1 Compare December 19, 2024 12:44
@SigNoz SigNoz deleted a comment from ellipsis-dev bot Dec 19, 2024
@amlannandy amlannandy force-pushed the feat/infra-monitoring-k8s-nodes branch from b5d57e1 to ba944d0 Compare December 24, 2024 06:53
Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

1 similar comment
Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

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! Incremental review on 1b0d029 in 52 seconds

More details
  • Looked at 191 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 drafted comments based on config settings.
1. frontend/src/api/infra/getHostAttributeKeys.ts:24
  • Draft comment:
    Consider making the limit parameter configurable instead of hardcoding it to 500. This will provide more flexibility and potentially improve performance for different use cases.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable:
    The limit of 500 seems like a reasonable default that would work for most autocomplete scenarios. Making it configurable would add complexity without clear benefits. There's no evidence that different use cases need different limits. The comment is speculative about "potentially improve performance" without concrete justification.
    Maybe there are specific use cases where a different limit would be beneficial. The hardcoded value could become a maintenance issue if requirements change.
    Without concrete evidence of different limit requirements or performance issues, adding configuration complexity isn't justified. If needs change, the value can be updated then.
    Delete the comment as it suggests adding complexity without clear evidence of benefit. The hardcoded 500 limit is reasonable for autocomplete.
2. frontend/src/container/InfraMonitoringK8s/Nodes/K8sNodesList.tsx:317
  • Draft comment:
    The showHeader property is set to false, which hides the table headers. Ensure this is the intended behavior, as headers are typically important for data tables.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    In K8sNodesList.tsx, the showHeader property of the Table component is set to false. This might not be the intended behavior as it hides the table headers, which are usually important for understanding the data being displayed.
3. frontend/src/container/InfraMonitoringK8s/Nodes/K8sNodesList.tsx:317
  • Draft comment:
    Avoid using inline styles in React components. Use external stylesheets, CSS classes, or styled components instead. This is also applicable to other inline styles in this file.
  • Reason this comment was not posted:
    Comment was on unchanged code.

Workflow ID: wflow_H93uRSdOk7nJ9bvj


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

@amlannandy amlannandy force-pushed the feat/infra-monitoring-k8s-nodes branch from 186f768 to 6d441f3 Compare December 27, 2024 04:04
Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

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! Incremental review on 186f768 in 1 minute and 34 seconds

More details
  • Looked at 339 lines of code in 13 files
  • Skipped 0 files when reviewing.
  • Skipped posting 8 drafted comments based on config settings.
1. frontend/src/container/InfraMonitoringK8s/Nodes/K8sNodesList.styles.scss:8
  • Draft comment:
    Avoid using !important in CSS unless absolutely necessary. It makes the code harder to maintain and override.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable:
    The use of !important here seems deliberate to ensure consistent table column widths, likely fighting against Ant Design's default table styles. While generally avoiding !important is good practice, in cases of overriding third-party component styles it's often necessary. Without seeing the actual rendering and style conflicts, we can't be certain if there's a better alternative.
    I might be too lenient on accepting !important when dealing with third-party components. There could be alternative approaches using more specific selectors or component customization.
    While alternatives might exist, the comment doesn't provide specific actionable solutions, and !important is a common necessity when working with third-party UI libraries like Ant Design.
    Delete the comment as it's not providing clear actionable feedback, and the use of !important appears intentional for overriding third-party component styles.
2. frontend/src/container/InfraMonitoringK8s/Nodes/NodeDetails/Events/NodeEvents.tsx:80
  • Draft comment:
    Avoid using as any for type casting. Ensure filters is correctly typed and initialized.
  • Reason this comment was not posted:
    Comment did not seem useful.
3. frontend/src/container/InfraMonitoringK8s/Nodes/NodeDetails/Logs/NodeLogsDetailedView.tsx:53
  • Draft comment:
    Avoid using as any for type casting. Ensure filters is correctly typed and initialized.
  • Reason this comment was not posted:
    Marked as duplicate.
4. frontend/src/container/InfraMonitoringK8s/Nodes/NodeDetails/Traces/NodeTraces.tsx:70
  • Draft comment:
    Avoid using as any for type casting. Ensure filters is correctly typed and initialized.
  • Reason this comment was not posted:
    Marked as duplicate.
5. frontend/src/container/InfraMonitoringK8s/Pods/PodDetails/Events/Events.tsx:80
  • Draft comment:
    Avoid using as any for type casting. Ensure filters is correctly typed and initialized.
  • Reason this comment was not posted:
    Marked as duplicate.
6. frontend/src/container/InfraMonitoringK8s/Pods/PodDetails/PodLogs/PodLogsDetailedView.tsx:53
  • Draft comment:
    Avoid using as any for type casting. Ensure filters is correctly typed and initialized.
  • Reason this comment was not posted:
    Marked as duplicate.
7. frontend/src/container/InfraMonitoringK8s/Pods/PodDetails/PodTraces/PodTraces.tsx:70
  • Draft comment:
    Avoid using as any for type casting. Ensure filters is correctly typed and initialized.
  • Reason this comment was not posted:
    Marked as duplicate.
8. frontend/src/container/InfraMonitoringK8s/Nodes/NodeDetails/NodeDetails.tsx:95
  • Draft comment:
    Avoid using inline styles. Use external stylesheets, CSS classes, or styled components instead.
  • Reason this comment was not posted:
    Comment was not on a valid diff hunk.

Workflow ID: wflow_8ZdfvAp2H7ursDOl


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

Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

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.

❌ Changes requested. Incremental review on 9a57f08 in 1 minute and 11 seconds

More details
  • Looked at 239 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. frontend/src/container/InfraMonitoringK8s/commonUtils.tsx:108
  • Draft comment:
    The EntityProgressBar uses getStrokeColorForLimitUtilization, which might not be appropriate for request utilization. Consider using getStrokeColorForRequestUtilization for request progress bars to maintain consistent visual representation.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable:
    Without more context about how EntityProgressBar is used, we can't know if it's meant for requests or limits. The name is generic and could be used for either. The comment is speculative ("might not be appropriate") rather than definitive. We don't have enough evidence to know if this is actually incorrect.
    The comment could be correct - if EntityProgressBar is used for requests, using the limit colors would be wrong. We're missing the usage context.
    Per the rules, we should delete speculative comments and comments that require more context to validate. The comment uses "might" language and we can't verify the correct behavior.
    Delete the comment since it's speculative and we lack the context to verify if it's actually incorrect.

Workflow ID: wflow_WS9bXdpQVWDvcAHX


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

className="progress-bar"
showInfo={false}
/>
<Typography.Text style={{ fontSize: '10px' }}>{percentage}%</Typography.Text>
Copy link
Contributor

Choose a reason for hiding this comment

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

Avoid using inline styles. Consider using CSS classes or styled components instead.

Copy link

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

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.

❌ Changes requested. Incremental review on dba5695 in 1 minute and 25 seconds

More details
  • Looked at 273 lines of code in 10 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_AcwUgzo1SEUYbQTf


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

},
],
},
}),
[currentQuery],
);

console.log({ updatedCurrentQuery });
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove console.log statement to avoid cluttering the console in production.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant