-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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: added logs and traces tab in host metrics detail view #6359
base: host-lists
Are you sure you want to change the base?
Conversation
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
There was a problem hiding this 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 c8bfe87 in 1 minute and 35 seconds
More details
- Looked at
1035
lines of code in13
files - Skipped
0
files when reviewing. - Skipped posting
4
drafted comments based on config settings.
1. frontend/src/components/HostMetricsDetail/HostMetricTraces/HostMetricTraces.tsx:22
- Draft comment:
Theoffset
state is initialized but never updated. If pagination or data fetching with offset is intended, ensure to update this state accordingly. - Reason this comment was not posted:
Comment did not seem useful.
2. frontend/src/components/HostMetricsDetail/HostMetricsLogs/HostMetricsLogs.tsx:33
- Draft comment:
Consider resettingprevOffset
andafterOffset
whenfilters
ortimeRange
changes to ensure correct data fetching. - Reason this comment was not posted:
Marked as duplicate.
3. frontend/src/components/HostMetricsDetail/HostMetricsLogs/HostMetricLogs.styles.scss:29
- Draft comment:
Use design tokens or predefined color constants instead of hardcoding color values forbackground
properties. This applies to lines 29 and 33. - Reason this comment was not posted:
Marked as duplicate.
4. frontend/src/components/HostMetricsDetail/HostMetricsLogs/HostMetricsLogs.tsx:166
- Draft comment:
Avoid using inline styles. Move the styles for theSkeleton
component to an external stylesheet or use styled components. This applies to lines 166 and 182. - Reason this comment was not posted:
Marked as duplicate.
Workflow ID: wflow_EURKifo6WfC4sCTK
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.
frontend/src/components/HostMetricsDetail/HostMetricsLogs/HostMetricsLogs.tsx
Outdated
Show resolved
Hide resolved
frontend/src/components/HostMetricsDetail/HostMetricTraces/HostMetricTraces.styles.scss
Outdated
Show resolved
Hide resolved
frontend/src/components/HostMetricsDetail/HostMetricTraces/HostMetricTraces.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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 698a771 in 18 seconds
More details
- Looked at
12
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
0
drafted comments based on config settings.
Workflow ID: wflow_vLunTA5PfMHU2s3E
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
There was a problem hiding this 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 332f548 in 48 seconds
More details
- Looked at
406
lines of code in10
files - Skipped
0
files when reviewing. - Skipped posting
5
drafted comments based on config settings.
1. frontend/src/components/HostMetricsDetail/HostMetricsLogs/constants.ts:57
- Draft comment:
Usinguuidv4()
generates a new ID for each query payload. Ensure this is intended, as it will create a unique ID for every call. - Reason this comment was not posted:
Confidence changes required:50%
The use ofuuidv4()
for generating query IDs is appropriate, but it should be noted that this will generate a new ID every time the function is called, which might not be necessary if the ID is meant to be consistent across calls for the same query. If the ID is meant to be unique for each call, then this is fine.
2. frontend/src/components/HostMetricsDetail/Metrics/Metrics.tsx:37
- Draft comment:
Inconsistent time conversion: initial state divides by 1000, while custom time change divides by 1000000000. Ensure consistent units. - Reason this comment was not posted:
Comment did not seem useful.
3. frontend/src/components/HostMetricsDetail/HostMetricsLogs/HostMetricsLogs.tsx:159
- Draft comment:
EnsureprevQueryPayload
andafterQueryPayload
are always defined when needed, asenabled: !!prevQueryPayload
only checks for truthiness. - Reason this comment was not posted:
Confidence changes required:50%
TheHostMetricsLogs
component usesuseQuery
withenabled: !!prevQueryPayload
andenabled: !!afterQueryPayload
. This is correct for conditional fetching, but ensure thatprevQueryPayload
andafterQueryPayload
are always defined when needed, as!!
only checks for truthiness.
4. frontend/src/components/HostMetricsDetail/HostMetricsLogs/HostMetricsLogs.tsx:162
- Draft comment:
Ensureskeleton-container
styles are defined and applied correctly. - Reason this comment was not posted:
Confidence changes required:50%
TheHostMetricsLogs
component usesSkeleton
components with a class nameskeleton-container
. Ensure that the styles for this class are defined and applied correctly in the corresponding SCSS file.
5. frontend/src/components/HostMetricsDetail/HostMetricsLogs/HostMetricsLogs.tsx:169
- Draft comment:
Avoid using inline styles for the Virtuoso component. Consider using CSS classes or styled components instead. - Reason this comment was not posted:
Comment was on unchanged code.
Workflow ID: wflow_4UD8tRP0ZN8IwFfh
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
There was a problem hiding this 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 2ecd830 in 39 seconds
More details
- Looked at
411
lines of code in5
files - Skipped
0
files when reviewing. - Skipped posting
7
drafted comments based on config settings.
1. frontend/src/components/HostMetricsDetail/HostMetricTraces/HostMetricTraces.styles.scss:15
- Draft comment:
Avoid using!important
in CSS. It can make debugging and maintenance difficult. Consider using more specific selectors or refactoring the CSS. - Reason this comment was not posted:
Confidence changes required:50%
The use of!important
in CSS should be avoided unless absolutely necessary, as it makes debugging and maintenance harder. It's better to use more specific selectors or refactor the CSS to achieve the desired effect without!important
.
2. frontend/src/components/HostMetricsDetail/HostMetricTraces/HostMetricTraces.tsx:52
- Draft comment:
Theoffset
state is initialized but never updated. Ensure thatoffset
is updated appropriately if pagination is required. - Reason this comment was not posted:
Comment did not seem useful.
3. frontend/src/components/HostMetricsDetail/HostMetricTraces/HostMetricTraces.tsx:54
- Draft comment:
ThesetSelectedInterval
state is defined but never used after initialization. Consider removing it if it's not needed. - Reason this comment was not posted:
Confidence changes required:30%
ThesetSelectedInterval
state is defined but never used after initialization. If it's not needed, consider removing it to clean up the code.
4. frontend/src/components/HostMetricsDetail/HostMetricTraces/HostMetricTraces.tsx:90
- Draft comment:
EnsurecurrentQuery.builder.queryData
is not empty before accessingqueryData[0]
to avoid potential errors. - Reason this comment was not posted:
Confidence changes required:50%
Thequery
variable is checked for nullability before being used in JSX. However, ifcurrentQuery.builder.queryData
is empty, accessingqueryData[0]
could lead to an error. Consider adding a check forqueryData
length before accessing its first element.
5. frontend/src/components/HostMetricsDetail/HostMetricTraces/HostMetricTraces.tsx:181
- Draft comment:
Ensuredata?.payload?.data?.newResult?.data?.result
is not empty before accessing its elements to avoid potential errors. - Reason this comment was not posted:
Confidence changes required:50%
ThetotalCount
calculation assumes thatdata?.payload?.data?.newResult?.data?.result
is always an array with at least one element. This could lead to errors if the structure changes or if the data is not as expected. Consider adding checks to ensure the array is not empty before accessing its elements.
6. frontend/src/components/HostMetricsDetail/HostMetricTraces/HostMetricTraces.styles.scss:14
- Draft comment:
Use design tokens or predefined color constants instead of hardcoding color values. - Reason this comment was not posted:
Comment was on unchanged code.
7. frontend/src/components/HostMetricsDetail/HostMetricTraces/HostMetricTraces.tsx:1
- Draft comment:
Avoid using thecomponent/index.tsx
file structure approach. It makes it difficult to debug and find components using global search tools. - Reason this comment was not posted:
Comment was on unchanged code.
Workflow ID: wflow_ejFFUdX13wrclcWi
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
List view testing - https://www.loom.com/share/daf25a3c66874aca98018de9052c1fd3 |
@rahulkeswani101 can we move the pagination to the bottom of the table? |
@GeekBoySupreme are you referring to the traces tab in detail view? We are taking the same component from traces explorer. |
@rahulkeswani101 traces tabs issues https://www.loom.com/share/ddb69fafe8f0468d867c0f412b971690
|
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
There was a problem hiding this 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 af9f3dd in 45 seconds
More details
- Looked at
927
lines of code in13
files - Skipped
0
files when reviewing. - Skipped posting
6
drafted comments based on config settings.
1. frontend/src/components/HostMetricsDetail/HostMetricTraces/HostMetricTraces.tsx:116
- Draft comment:
Ensure consistent time conversion factors across the codebase. Here,Math.floor(dateTimeRange[0] / 1000)
is used, but in other places, different factors are used. Verify the correct unit and apply consistently. - Reason this comment was not posted:
Comment did not seem useful.
2. frontend/src/components/HostMetricsDetail/HostMetricTraces/HostMetricTraces.tsx:122
- Draft comment:
Ensure consistent time conversion factors across the codebase. Here,Math.floor(minTime / 1000000)
is used, but in other places, different factors are used. Verify the correct unit and apply consistently. - Reason this comment was not posted:
Marked as duplicate.
3. frontend/src/components/HostMetricsDetail/HostMetricsLogs/HostMetricLogsDetailedView.tsx:92
- Draft comment:
Ensure consistent time conversion factors across the codebase. Here,Math.floor(dateTimeRange[0] / 1000)
is used, but in other places, different factors are used. Verify the correct unit and apply consistently. - Reason this comment was not posted:
Marked as duplicate.
4. frontend/src/components/HostMetricsDetail/HostMetricsLogs/HostMetricLogsDetailedView.tsx:98
- Draft comment:
Ensure consistent time conversion factors across the codebase. Here,Math.floor(minTime / 1000000)
is used, but in other places, different factors are used. Verify the correct unit and apply consistently. - Reason this comment was not posted:
Marked as duplicate.
5. frontend/src/components/HostMetricsDetail/Metrics/Metrics.tsx:47
- Draft comment:
Ensure consistent time conversion factors across the codebase. Here,Math.floor(dateTimeRange[0] / 1000)
is used, but in other places, different factors are used. Verify the correct unit and apply consistently. - Reason this comment was not posted:
Marked as duplicate.
6. frontend/src/components/HostMetricsDetail/Metrics/Metrics.tsx:53
- Draft comment:
Ensure consistent time conversion factors across the codebase. Here,Math.floor(minTime / 1000000000)
is used, but in other places, different factors are used. Verify the correct unit and apply consistently. - Reason this comment was not posted:
Marked as duplicate.
Workflow ID: wflow_oUBKgzlv6gVLGSSQ
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
There was a problem hiding this 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 a7710e4 in 58 seconds
More details
- Looked at
917
lines of code in10
files - Skipped
0
files when reviewing. - Skipped posting
5
drafted comments based on config settings.
1. frontend/src/providers/QueryBuilder.tsx:919
- Draft comment:
Resetting the currentQuery to initialQueriesMap.metrics on route change to INFRASTRUCTURE_MONITORING_HOSTS may lead to unexpected behavior. Consider if this is the intended behavior. - Reason this comment was not posted:
Comment did not seem useful.
2. frontend/src/components/HostMetricsDetail/HostMetricTraces/HostMetricTraces.tsx:50
- Draft comment:
Avoid using 'any' type for the traces state. Define a specific type for better type safety and code readability. - Reason this comment was not posted:
Comment was on unchanged code.
3. frontend/src/components/HostMetricsDetail/HostMetricsLogs/HostMetricsLogs.tsx:38
- Draft comment:
Avoid using 'any' type for the logs state. Define a specific type for better type safety and code readability. - Reason this comment was not posted:
Marked as duplicate.
4. frontend/src/components/HostMetricsDetail/HostMetricsLogs/HostMetricLogsDetailedView.tsx:37
- Draft comment:
Avoid using 'any' type for the logs state. Define a specific type for better type safety and code readability. - Reason this comment was not posted:
Marked as duplicate.
5. frontend/src/components/HostMetricsDetail/index.tsx:54
- Draft comment:
Avoid using 'any' type for the logs state. Define a specific type for better type safety and code readability. - Reason this comment was not posted:
Marked as duplicate.
Workflow ID: wflow_9LLcxt1hzrR08O8e
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
There was a problem hiding this 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 aba6443 in 1 minute and 2 seconds
More details
- Looked at
745
lines of code in12
files - Skipped
0
files when reviewing. - Skipped posting
4
drafted comments based on config settings.
1. frontend/src/components/HostMetricsDetail/HostMetricsLogs/HostMetricsLogs.tsx:57
- Draft comment:
TheisPaginating
state is set but not used for any conditional logic. Consider removing it if it's not needed. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
The comment suggests thatisPaginating
is not used, but the code shows it is used in theuseQuery
hook and reset in auseEffect
. This means the comment is incorrect.
I might be missing some context about howisPaginating
is intended to be used, but based on the code, it is clearly used for conditional logic.
The code shows clear usage ofisPaginating
, so the comment is incorrect regardless of any additional context.
The comment is incorrect becauseisPaginating
is used in the code. It should be deleted.
2. frontend/src/components/HostMetricsDetail/HostMetricsLogs/HostMetricsLogs.tsx:124
- Draft comment:
Ensure thathandleChangeLogFilters
correctly handles pagination filters to avoid incorrect filtering. - Reason this comment was not posted:
Comment did not seem useful.
3. frontend/src/container/TopNav/DateTimeSelectionV2/index.tsx:390
- Draft comment:
Consider refactoringonCustomDateHandler
to improve readability and maintainability. - Reason this comment was not posted:
Confidence changes required:50%
InDateTimeSelectionV2/index.tsx
, theonCustomDateHandler
function has a complex logic for handling custom date selection. It might be beneficial to refactor this function to improve readability and maintainability.
4. frontend/src/pages/InfraMonitoringHosts/InfraMonitoring.styles.scss:46
- Draft comment:
Use design tokens or predefined color constants instead of hardcoding color values for consistency. This is also applicable in other parts of this file. - Reason this comment was not posted:
Comment looked like it was already resolved.
Workflow ID: wflow_WJmjNZuHMtLXhLtx
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.
handleChangeTracesFilters, | ||
tracesFilters, | ||
selectedInterval, | ||
}: Props): JSX.Element { | ||
const [traces, setTraces] = useState<any[]>([]); | ||
const [offset] = useState<number>(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The offset
state is not being updated anywhere in the component. Consider using a simple variable instead of useState
.
const [offset] = useState<number>(0); | |
const offset = 0; |
queryType: 'builder', | ||
builder: { | ||
...initialQueryState.builder, | ||
queryData: [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider implementing duplicate filter removal in handleChangeTracesFilters
similar to handleChangeLogFilters
.
Summary
Related Issues / PR's
Screenshots
Affected Areas and Manually Tested Areas
Important
Add logs and traces tabs to host metrics detail view with new components, styles, and utilities.
HostMetricLogsDetailedView
andHostMetricTraces
components for logs and traces in host metrics detail view.HostMetricDetail
for view switching.isModalTimeSelection
prop toHostDetailProps
andDateTimeSelectionV2
for modal time selection.HostMetricTraces
inHostMetricTraces.styles.scss
.InfraMonitoring.styles.scss
for better layout and design.formatNanoToMS
utility inutils.ts
for duration formatting.getHostTracesQueryPayload
andgetHostLogsQueryPayload
inconstants.ts
for query payloads.HostsList.tsx
to use newHostMetricDetail
with logs and traces.DateTimeSelectionV2
to support modal time selection.This description was created by for aba6443. It will automatically update as commits are pushed.