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 namespaces list table in infra monitoring #6617

Conversation

amlannandy
Copy link
Member

@amlannandy amlannandy commented Dec 11, 2024

Summary

Implement namespaces entity in Infra Monitoring

  • Namespaces list table
  • Namespace details view

Related Issues / PR's

N/A

Screenshots

N/A

Affected Areas and Manually Tested Areas

Infra Monitoring section


Important

Implement Kubernetes namespaces monitoring in Infra Monitoring with list and detail views, including metrics, logs, events, and traces.

  • Features:
    • Implement namespaces list table and details view in InfraMonitoringK8s.
    • Add support for viewing metrics, logs, events, and traces for namespaces.
  • API:
    • Add getK8sNamespacesList function in getK8sNamespacesList.ts.
    • Create useGetK8sNamespacesList hook in useGetK8sNamespacesList.ts.
  • UI Components:
    • Add NamespaceDetails, NamespaceMetrics, NamespaceLogs, NamespaceEvents, and NamespaceTraces components.
    • Implement styles for new components in respective .scss files.
  • Utilities:
    • Add utility functions in utils.tsx for formatting and data handling.
  • Constants:
    • Update reactQueryKeys.ts and constants.ts with new keys and configurations.

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

Copy link

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

@github-actions github-actions bot added the enhancement New feature or request label Dec 11, 2024
@amlannandy amlannandy force-pushed the feat/infra-monitoring-k8s-nodes branch from ef641e7 to 2e8350b Compare December 11, 2024 16:49
@amlannandy amlannandy force-pushed the feat/infra-monitoring-k8s-namespaces branch from 0e1f256 to 728f325 Compare December 11, 2024 16:50
@amlannandy amlannandy force-pushed the feat/infra-monitoring-k8s-nodes branch 4 times, most recently from 26a6959 to b5d57e1 Compare December 19, 2024 12:44
@amlannandy amlannandy changed the base branch from feat/infra-monitoring-k8s-nodes to feat/infra-monitoring-k8s December 19, 2024 16:38
@amlannandy amlannandy force-pushed the feat/infra-monitoring-k8s-namespaces branch from 728f325 to d5cd9f7 Compare December 19, 2024 16:45
@amlannandy amlannandy marked this pull request as ready for review December 23, 2024 06:20
@amlannandy amlannandy requested a review from YounixM as a code owner December 23, 2024 06:20
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 98e5fe6 in 1 minute and 44 seconds

More details
  • Looked at 947 lines of code in 8 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. frontend/src/api/infraMonitoring/getK8sNamespacesList.ts:53
  • Draft comment:
    Use response.status instead of hardcoded 200 for statusCode to ensure it reflects the actual response status.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable:
    This is a new API endpoint file. The comment suggests a change that could make the code more dynamic, but there are several issues: 1) This is a success case in the try block, so we know it succeeded 2) Axios successful responses always have status 200 3) The statusCode is part of our own response wrapper, not the HTTP status 4) The suggestion could actually introduce bugs if the backend returns a different 2xx status code.
    Maybe using response.status would be more accurate for non-200 success codes like 201 Created. The current approach might hide important status information.
    This is a GET endpoint that returns a list - it will always be 200 on success. Other status codes would be caught in the catch block and handled by ErrorResponseHandler.
    The comment should be deleted. The hardcoded 200 is correct here as it's in the success path, and using response.status could actually introduce bugs.
2. frontend/src/api/infraMonitoring/getK8sNamespacesList.ts:55
  • Draft comment:
    Use response.statusText instead of hardcoded 'Success' for the message to ensure it reflects the actual response message.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable:
    The comment is about code style/implementation choice, not a clear bug. Using response.statusText isn't necessarily better - it would make the response message less predictable and consistent. The hardcoded 'Success' is a deliberate choice to provide a consistent response format. HTTP status texts can vary between servers and implementations.
    Maybe using the actual HTTP status text would provide more detailed information about the response. The hardcoded message could hide useful information.
    The purpose of this message field seems to be providing a consistent, predictable success indicator rather than detailed status information. The actual response data is already included in the payload.
    This comment should be deleted as it suggests a change that isn't clearly better and could make the API response less consistent.

Workflow ID: wflow_rotZg7lxf6EgSuYM


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.

@amlannandy amlannandy force-pushed the feat/infra-monitoring-k8s-namespaces branch from 98e5fe6 to a0c8bf9 Compare December 24, 2024 13:37
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 a0c8bf9 in 1 minute and 3 seconds

More details
  • Looked at 757 lines of code in 4 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. frontend/src/container/InfraMonitoringK8s/InfraMonitoringK8s.tsx:324
  • Draft comment:
    Avoid using inline styles in React components. Instead, use external stylesheets, CSS classes, or styled components. This applies to all similar instances in this file.
  • Reason this comment was not posted:
    Comment was on unchanged code.

Workflow ID: wflow_UgbcDEXuPKcSMRQY


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.

return (
<div className="pod-group">
{groupByValues.map((value) => (
<Tag key={value} color="#1D212D" className="pod-group-tag-item">
Copy link
Contributor

Choose a reason for hiding this comment

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

Use design tokens or predefined color constants instead of hardcoding color values in the Tag component.

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 384b309 in 25 seconds

More details
  • Looked at 111 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. frontend/src/container/InfraMonitoringK8s/Namespaces/K8sNamespacesList.tsx:325
  • Draft comment:
    Ensure that setting showHeader={false} is intentional. Hiding table headers can reduce clarity for users.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The showHeader property is set to false for the Table component, which might not be the intended behavior if headers are needed for clarity.
2. frontend/src/container/InfraMonitoringK8s/Namespaces/utils.tsx:28
  • Draft comment:
    Ensure that the renaming of cpuUsage to cpu and memoryUsage to memory is consistent across the codebase. This change is also applicable in K8sNamespacesRowData and columnsConfig.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The cpu and memory fields have been renamed from cpuUsage and memoryUsage. Ensure consistency across the codebase.

Workflow ID: wflow_wV26lGxAs0EeFQm3


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

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 79e07b7 in 12 seconds

More details
  • Looked at 24 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. frontend/src/hooks/infraMonitoring/useGetK8sNamespacesList.ts:37
  • Draft comment:
    The change from GET_HOST_LIST to GET_NAMESPACE_LIST in the query key is correct and aligns with the new functionality of fetching namespaces.
  • Reason this comment was not posted:
    Confidence changes required: 0%
    The change from GET_HOST_LIST to GET_NAMESPACE_LIST in the query key is correct and aligns with the new functionality of fetching namespaces.
2. frontend/src/hooks/infraMonitoring/useGetK8sNamespacesList.ts:37
  • Draft comment:
    Ensure that REACT_QUERY_KEY.GET_NAMESPACE_LIST is defined in reactQueryKeys.ts to maintain consistency and avoid hardcoding.
  • Reason this comment was not posted:
    Comment did not seem useful.

Workflow ID: wflow_OBlofEjwc5hhz7Da


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>

@amlannandy amlannandy force-pushed the feat/infra-monitoring-k8s branch from c89ffab to 79cae2d Compare January 3, 2025 06:14
@YounixM YounixM force-pushed the feat/infra-monitoring-k8s branch from a294614 to 6855009 Compare January 6, 2025 05:56
@amlannandy amlannandy force-pushed the feat/infra-monitoring-k8s branch from 2edb730 to 579c7cb Compare January 8, 2025 05:21
@YounixM YounixM force-pushed the feat/infra-monitoring-k8s branch from 579c7cb to 22a33e3 Compare January 8, 2025 10:32
Base automatically changed from feat/infra-monitoring-k8s to main January 8, 2025 10:43
@amlannandy amlannandy force-pushed the feat/infra-monitoring-k8s-namespaces branch from 79e07b7 to ec352eb Compare January 12, 2025 10:44
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 ec352eb in 59 seconds

More details
  • Looked at 3965 lines of code in 38 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 drafted comments based on config settings.
1. frontend/src/api/infraMonitoring/getK8sNamespacesList.ts:60
  • Draft comment:
    Consider adding validation for the response data to ensure it matches the expected structure. This can help prevent runtime errors if the API response changes unexpectedly.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The function getK8sNamespacesList is used to fetch data, but there is no validation or error handling for the response data. This could lead to runtime errors if the response structure is not as expected.
2. frontend/src/hooks/infraMonitoring/useGetK8sNamespacesList.ts:34
  • Draft comment:
    Ensure queryKey is always returned as an array for consistency with React Query's expectations. If options.queryKey is a string, consider wrapping it in an array.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The queryKey in the useGetK8sNamespacesList hook is constructed based on the options.queryKey. However, if options.queryKey is a string, it is returned directly, which might not be the intended behavior as it should be an array for consistency with React Query's expectations.
3. frontend/src/container/InfraMonitoringK8s/Namespaces/NamespaceDetails/Traces/constants.ts:95
  • Draft comment:
    Consider generating a unique ID for each query instance to avoid potential conflicts when multiple queries are executed simultaneously.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The getNamespaceTracesQueryPayload function uses a hardcoded UUID for the query ID. This could lead to issues if multiple instances of this function are used simultaneously, as they would share the same ID.

Workflow ID: wflow_bKMCHPmD86ouUkLl


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.

return (
<div className="pod-group">
{groupByValues.map((value) => (
<Tag key={value} color="#1D212D" className="pod-group-tag-item">
Copy link
Contributor

Choose a reason for hiding this comment

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

Use design tokens or predefined color constants instead of hardcoding color values for consistency.

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 4f07338 in 21 seconds

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

Workflow ID: wflow_wStJCZjRjMhhFo54


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>

2 similar comments
Copy link

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

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 7a9b5d5 in 1 minute and 12 seconds

More details
  • Looked at 517 lines of code in 8 files
  • Skipped 0 files when reviewing.
  • Skipped posting 4 drafted comments based on config settings.
1. frontend/src/container/InfraMonitoringK8s/commonUtils.tsx:207
  • Draft comment:
    Avoid using inline styles. Use CSS classes or styled components instead.
  • Reason this comment was not posted:
    Marked as duplicate.
2. frontend/src/container/InfraMonitoringK8s/Namespaces/utils.tsx:137
  • Draft comment:
    Avoid using inline styles. Use CSS classes or styled components instead. This is also applicable in other parts of the code where inline styles are used.
  • Reason this comment was not posted:
    Comment was on unchanged code.
3. frontend/src/container/InfraMonitoringK8s/Namespaces/K8sNamespacesList.tsx:508
  • Draft comment:
    Avoid using inline styles. Use CSS classes or styled components instead. This is also applicable in other parts of the code where inline styles are used.
  • Reason this comment was not posted:
    Marked as duplicate.
4. frontend/src/container/InfraMonitoringK8s/Namespaces/NamespaceDetails/Events/NamespaceEvents.tsx:184
  • Draft comment:
    Avoid using inline styles. Use CSS classes or styled components instead. This is also applicable in other parts of the code where inline styles are used.
  • Reason this comment was not posted:
    Marked as duplicate.

Workflow ID: wflow_ksUuYqNttACdxdhr


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

type: 'tag',
isColumn: true,
},
];
Copy link
Contributor

Choose a reason for hiding this comment

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

already exists

key: 'responseStatusCode-string-tag',
width: 145,
},
];
Copy link
Contributor

Choose a reason for hiding this comment

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

already exists

Copy link
Contributor

@SagarRajput-7 SagarRajput-7 left a comment

Choose a reason for hiding this comment

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

Please see and refactor code accordingly to reduce these larger duplications with the already merged code and with the other 3 PRs

@amlannandy amlannandy changed the base branch from main to feat/infra-monitoring-k8s-deployments January 16, 2025 05:38
@amlannandy amlannandy force-pushed the feat/infra-monitoring-k8s-namespaces branch from 7a9b5d5 to f6c7740 Compare January 16, 2025 05:42
@amlannandy amlannandy requested a review from a team as a code owner January 16, 2025 05:42
@CLAassistant
Copy link

CLAassistant commented Jan 16, 2025

CLA assistant check
All committers have signed the CLA.

@amlannandy amlannandy force-pushed the feat/infra-monitoring-k8s-namespaces branch from dfcc2b4 to de33336 Compare January 16, 2025 05:51
Copy link
Contributor

ellipsis-dev bot commented Jan 16, 2025

⚠️ This PR is too big for Ellipsis, but support for larger PRs is coming soon. If you want us to prioritize this feature, let us know at [email protected]


Generated with ❤️ by ellipsis.dev

@amlannandy amlannandy merged commit 22cae31 into feat/infra-monitoring-k8s-deployments Jan 16, 2025
6 checks passed
@amlannandy amlannandy deleted the feat/infra-monitoring-k8s-namespaces branch January 16, 2025 05:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs required enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants