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: statefulsets implementation for k8s infra monitoring #6630

Conversation

amlannandy
Copy link
Member

@amlannandy amlannandy commented Dec 13, 2024

Summary

Implement the statefulSets entity in Infra Monitoring

  • Statefulsets List table
  • Statefulsets details view

Related Issues / PR's

N/A

Screenshots

Screenshot 2025-01-14 at 8 29 14 PM Screenshot 2025-01-14 at 8 29 21 PM

Affected Areas and Manually Tested Areas

Infra Monitoring section


Important

Implement Kubernetes StatefulSets monitoring in the infrastructure monitoring section with new API, UI components, and query handling.

  • Behavior:
    • Adds getK8sStatefulSetsList function in getsK8sStatefulSetsList.ts to fetch StatefulSets data.
    • Implements K8sStatefulSetsList component in K8sStatefulSetsList.tsx for displaying StatefulSets list with filtering and sorting.
    • Adds StatefulSetDetails component in StatefulSetDetails.tsx for detailed view of a StatefulSet, including metrics, logs, events, and traces.
  • Styles:
    • Adds styles for StatefulSets components in K8sStatefulSetsList.styles.scss and StatefulSetDetails.styles.scss.
  • Hooks:
    • Introduces useGetK8sStatefulSetsList hook in useGetK8sStatefulSetsList.ts for querying StatefulSets data.
  • Constants:
    • Updates reactQueryKeys.ts with GET_STATEFULSET_LIST key.
    • Adds query constants in constants.ts for StatefulSets.

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

@github-actions github-actions bot added the enhancement New feature or request label Dec 13, 2024
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-nodes branch 5 times, most recently from b5d57e1 to ba944d0 Compare December 24, 2024 06:53
@amlannandy amlannandy force-pushed the feat/infra-monitoring-k8s-nodes branch from 186f768 to 6d441f3 Compare December 27, 2024 04:04
Base automatically changed from feat/infra-monitoring-k8s-nodes to feat/infra-monitoring-k8s January 3, 2025 06:09
@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-stateful-sets branch from fc0db62 to 16e60e4 Compare January 14, 2025 14:58
@amlannandy amlannandy changed the title feat: implement statefulSets list table for infra monitoring feat: statefulsets implementation for k8s infra monitoring Jan 14, 2025
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>

@amlannandy amlannandy marked this pull request as ready for review January 14, 2025 15:01
@amlannandy amlannandy requested a review from YounixM as a code owner January 14, 2025 15:01
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 16e60e4 in 2 minutes and 13 seconds

More details
  • Looked at 5046 lines of code in 33 files
  • Skipped 0 files when reviewing.
  • Skipped posting 7 drafted comments based on config settings.
1. frontend/src/container/InfraMonitoringK8s/StatefulSets/StatefulSetDetails/StatefulSetDetails.tsx:62
  • Draft comment:
    The conversion of minTime and maxTime to milliseconds seems incorrect. Use 1000000 instead of 1000000000 for the conversion.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable:
  1. The division by 1000000000 converts nanoseconds to seconds (1 billion nanoseconds = 1 second). 2. The division by 1000000 would convert to milliseconds instead. 3. Looking at the code context, these values are used for time ranges and filtering, where seconds are a more appropriate unit than milliseconds. 4. The conversion is used consistently throughout the file.
    I could be wrong about the intended time unit for the API or UI components. There might be documentation or other code that expects milliseconds.
    The consistent use throughout the file and the fact that seconds are a common unit for time ranges in monitoring UIs suggests the current implementation is correct. If milliseconds were required, it would likely cause obvious issues that would have been caught.
    The current conversion from nanoseconds to seconds using division by 1000000000 appears to be correct. The comment suggesting to use 1000000 instead would result in milliseconds, which does not seem to be the intended unit.
2. frontend/src/container/InfraMonitoringK8s/StatefulSets/StatefulSetDetails/Metrics/StatefulSetMetrics.tsx:58
  • Draft comment:
    Using the entire payload object as part of the queryKey can lead to unnecessary re-fetches. Consider using a stable key or a subset of the payload that uniquely identifies the query.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable:
    The comment raises a valid React Query performance concern. Using mutable objects in queryKey can cause unnecessary re-renders. However, without seeing the payload structure from getStatefulSetQueryPayload(), it's hard to know if there's a better subset of data we could use. The current implementation is not necessarily wrong - it will work correctly, just maybe not optimally.
    I don't have visibility into what fields are actually in the payload object. The current implementation might already be using the minimal necessary data.
    While the concern is valid in theory, without being able to see the payload structure, we can't make a confident recommendation about what specific fields should be used instead.
    The comment should be deleted because while it raises a valid concern, we don't have enough context to make a specific, actionable recommendation about how to improve the query key.
3. frontend/src/container/InfraMonitoringK8s/StatefulSets/StatefulSetDetails/Traces/StatefulSetTraces.tsx:54
  • Draft comment:
    The offset state is initialized but never updated. Ensure that the offset is updated appropriately for pagination to work correctly.
  • Reason this comment was not posted:
    Comment did not seem useful.
4. frontend/src/container/InfraMonitoringK8s/StatefulSets/StatefulSetDetails/StatefulSetDetails.tsx:428
  • Draft comment:
    Avoid using inline styles. Consider using CSS classes or styled components instead.
  • Reason this comment was not posted:
    Marked as duplicate.
5. frontend/src/container/InfraMonitoringK8s/StatefulSets/StatefulSetDetails/StatefulSetDetails.styles.scss:4
  • Draft comment:
    Use design tokens or predefined color constants instead of hardcoding color values for consistency in design and theming.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.
6. frontend/src/container/InfraMonitoringK8s/StatefulSets/StatefulSetDetails/StatefulSetDetails.styles.scss:43
  • Draft comment:
    Use design tokens or predefined color constants instead of hardcoding color values for consistency in design and theming.
  • Reason this comment was not posted:
    Marked as duplicate.
7. frontend/src/container/InfraMonitoringK8s/StatefulSets/StatefulSetDetails/StatefulSetDetails.styles.scss:184
  • Draft comment:
    Use design tokens or predefined color constants instead of hardcoding color values for consistency in design and theming.
  • Reason this comment was not posted:
    Marked as duplicate.

Workflow ID: wflow_EpyVFsLcVrxZKFbM


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.

open={!!statefulSet}
style={{
overscrollBehavior: 'contain',
background: isDarkMode ? Color.BG_INK_400 : Color.BG_VANILLA_100,
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.

@amlannandy amlannandy changed the base branch from main to feat/infra-monitoring-k8s-jobs January 20, 2025 07:10
@amlannandy amlannandy merged commit 53c4c56 into feat/infra-monitoring-k8s-jobs Jan 20, 2025
6 checks passed
@amlannandy amlannandy deleted the feat/infra-monitoring-k8s-stateful-sets branch January 20, 2025 07:28
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.

1 participant