-
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
Metrics time selection #6360
Metrics time selection #6360
Conversation
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
1 similar comment
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 a510958 in 1 minute and 40 seconds
More details
- Looked at
1191
lines of code in14
files - Skipped
0
files when reviewing. - Skipped posting
5
drafted comments based on config settings.
1. frontend/src/components/HostMetricsDetail/HostMetricTraces/HostMetricTraces.tsx:22
- Draft comment:
Sinceoffset
is never updated, consider using a constant instead ofuseState
for better performance and clarity.
const offset = 0;
- Reason this comment was not posted:
Confidence changes required:50%
The use ofuseState<number>(0)
foroffset
is unnecessary sinceoffset
is never updated. It can be a constant instead.
2. frontend/src/components/HostMetricsDetail/HostMetricTraces/constants.ts:54
- Draft comment:
Theoffset
parameter is always 0 and never changes, making it redundant. Consider removing it from the function signature and calls. - Reason this comment was not posted:
Confidence changes required:50%
Theoffset
parameter ingetHostTracesQueryPayload
is set to 0 by default, and sinceoffset
is never updated, this parameter is redundant.
3. frontend/src/components/HostMetricsDetail/HostMetricsLogs/HostMetricsLogs.tsx:32
- Draft comment:
Ensure that the logic for updatingprevOffset
andafterOffset
is correct and does not lead to potential bugs. Consider adding comments or refactoring for clarity. - Reason this comment was not posted:
Confidence changes required:50%
TheHostMetricsLogs
component usesprevOffset
andafterOffset
to manage pagination, but the logic for updating these offsets is not clear. It might lead to potential bugs if not handled correctly.
4. frontend/src/components/HostMetricsDetail/HostMetricsLogs/HostMetricsLogs.tsx:33
- Draft comment:
Ensure that the logic for updatingprevOffset
andafterOffset
is correct and does not lead to potential bugs. Consider adding comments or refactoring for clarity. - Reason this comment was not posted:
Confidence changes required:50%
TheHostMetricsLogs
component usesprevOffset
andafterOffset
to manage pagination, but the logic for updating these offsets is not clear. It might lead to potential bugs if not handled correctly.
5. frontend/src/components/HostMetricsDetail/index.tsx:12
- Draft comment:
Avoid using thecomponent/index.tsx
file structure approach, as it makes it difficult to debug and find components using global search tools like VS Code. - Reason this comment was not posted:
Comment was on unchanged code.
Workflow ID: wflow_nW0E3CKcnChQe6rS
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.
@@ -0,0 +1,30 @@ | |||
.host-metric-traces { | |||
.ant-table { | |||
background: #121212; |
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.
Use design tokens or predefined color constants instead of hardcoding color values for background
and color
. This applies to lines 3, 4, 7, 8, 9, 13, 14, 15, 19, and 26.
background: #121212; | |
background: $background-color; |
/> | ||
{isLoading && traces.length > 0 && ( | ||
<Skeleton | ||
style={{ |
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.
Avoid using inline styles. Consider using external stylesheets, CSS classes, or styled components instead. This also applies to the inline styles on lines 166 and 182 in HostMetricsLogs.tsx
.
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.
+1
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.
@SagarRajput-7 Let me add these changes of Traces in the new PR.
@@ -0,0 +1,4 @@ | |||
export const formatNanoToMS = (nanoSeconds: number): string => { |
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 formatNanoToMS
function duplicates the conversion logic of nanoToMilli
. Consider using nanoToMilli
and appending 'ms' to its result to avoid duplication.
- function
nanoToMilli
(timeUtils.ts)
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.
+1
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
queryName: 'A', | ||
aggregateOperator: 'noop', | ||
aggregateAttribute: { | ||
id: '------false', |
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.
check if there's an id available - which includes key also, something like 'host.name--string--resource--false'
aggregateAttribute: { | ||
id: '------false', | ||
dataType: DataTypes.EMPTY, | ||
key: '', |
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.
no key?
limit: 10, | ||
offset, | ||
}, | ||
selectColumns: [ |
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.
check if we can use the constant - defaultTraceSelectedColumns
frontend/src/components/HostMetricsDetail/HostMetricsLogs/HostMetricLogsDetailedView.tsx
Show resolved
Hide resolved
frontend/src/components/HostMetricsDetail/HostMetricsLogs/HostMetricsLogs.tsx
Show resolved
Hide resolved
frontend/src/components/HostMetricsDetail/HostMetricsLogs/HostMetricsLogs.tsx
Outdated
Show resolved
Hide resolved
frontend/src/components/HostMetricsDetail/HostMetricsLogs/constants.ts
Outdated
Show resolved
Hide resolved
frontend/src/components/HostMetricsDetail/HostMetricsLogs/constants.ts
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.
Please check the comments
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 9368e74 in 52 seconds
More details
- Looked at
99
lines of code in3
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:
Consider whether generating a new UUID for each query is necessary. If the ID is not used for distinguishing between different queries, a static ID might suffice. - Reason this comment was not posted:
Confidence changes required:50%
The use ofuuidv4()
for generating query IDs ensures uniqueness, which is good for preventing potential conflicts. However, it might be unnecessary if the ID is not used for distinguishing between different queries in a meaningful way.
2. frontend/src/components/HostMetricsDetail/HostMetricsLogs/HostMetricsLogs.tsx:163
- Draft comment:
Good use of theSkeleton
component for loading states. The change from inline styles to a CSS class improves maintainability. - Reason this comment was not posted:
Confidence changes required:0%
TheSkeleton
component is used for loading states, which is a good practice for user experience. However, the inline styles were replaced with a class, which is a good change for maintainability and consistency.
3. frontend/src/components/HostMetricsDetail/HostMetricsLogs/HostMetricsLogs.tsx:170
- Draft comment:
Consider refactoring the repeated logic inuseEffect
hooks for processingprevData
andafterData
into a separate function to avoid duplication. - Reason this comment was not posted:
Confidence changes required:50%
TheuseEffect
hooks are correctly used to update the logs state when new data is fetched. However, the logic for checking and mapping the data is repeated in both hooks, which could be refactored into a separate function to avoid duplication.
4. frontend/src/components/HostMetricsDetail/HostMetricsLogs/HostMetricsLogs.tsx:170
- Draft comment:
Avoid using inline styles in React components. Move the style to an external stylesheet or use styled components. - Reason this comment was not posted:
Comment looked like it was already resolved.
5. frontend/src/components/HostMetricsDetail/HostMetricsLogs/constants.ts:7
- Draft comment:
Do not add non-ClickHouse related functions likeuuidv4()
to the ClickHouseReader interface. Use the DAO in the telemetry instance instead. - Reason this comment was not posted:
Comment was on unchanged code.
Workflow ID: wflow_ivm4CZTtj8nsk6n6
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
@SagarRajput-7 Resolved some of the comments. For traces I am testing some changes so, I will address the changes for traces in that PR. |
sure, I am approving this, please make sure to address the remaining comment in followup PR |
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.
Skipped PR review on df43f0e because no changed files had a supported extension. If you think this was in error, please contact us and we'll fix it right away.
* feat: added the host list view and filters * feat: removed group by filter and added autocomplete for where clause * feat: updated the table view and added the pagination * feat: pass updated filters to api to get filtered data in the list * feat: added global time range and order by for cpu,memory,iowait,load * feat: added order by and color codes for cpu and memory usage progress bar * refactor: removed inline styles * Host lists improvement (#6366) * style: added new style changes for date time selection in host lists view * style: added padding to date time selector * style: removed unnecessary styles for host tabs * style: removed unused css * feat: added the host detail view (#6267) * Host containers (#6297) * feat: added the host detail view * feat: completed containers and processes details view * Show host metrics panels in metrics tab. (#6306) * feat: added the host detail view * feat: completed containers and processes details view * feat: added host metrics panels in metrics tabs * refactor: removed inline styles from host containers and processes tabs * style: added top and bottom margin to containers and processes tab * Metrics time selection (#6360) * feat: added the host detail view * feat: completed containers and processes details view * feat: added host metrics panels in metrics tabs * refactor: removed inline styles from host containers and processes tabs * feat: added logs and traces tab in host metrics detail view * chore: removed console statements * feat: added DateTimeSelection component in metrics tab * style: added top and bottom margin to containers and processes tab * style: removed inline styles * feat: added logs and traces tab in host metrics detail view (#6359) * feat: added the host detail view * feat: completed containers and processes details view * feat: added host metrics panels in metrics tabs * refactor: removed inline styles from host containers and processes tabs * feat: added logs and traces tab in host metrics detail view * chore: removed console statements * feat: added filters and time selection in traces tab * fix: resolved metrics,logs and traces tab issues * feat: added navigation for logs and traces to respective explorer pages * fix: added the code for logs tab and navigation to respective explorer page * fix: added fixes for date time selection custom issue * style: added styles for light mode * refactor: removed unused code and added comments * refactor: added new code for host metric attribute keys * feat: reset query data once we are on infra monitoring page * chore: remove optional parameter from get attributes and groupby interfaces * feat: update ui as per the designs * fix: logs list, time select and other ui issues * feat: update title for infra monitoring page * feat: update copies * feat: update styles for light mode * fix: reset page size on filter, open explorers in new tab, enable horizontal scroll * feat: traces tab updates * feat: move infra monitoring behind ff * fix: remove sorting from host listing page --------- Co-authored-by: Yunus M <myounis.ar@live.com>
* feat: added the host list view and filters (#6210) * feat: added the host list view and filters * feat: removed group by filter and added autocomplete for where clause * feat: updated the table view and added the pagination * feat: pass updated filters to api to get filtered data in the list * feat: added global time range and order by for cpu,memory,iowait,load * feat: added order by and color codes for cpu and memory usage progress bar * refactor: removed inline styles * Host lists improvement (#6366) * style: added new style changes for date time selection in host lists view * style: added padding to date time selector * style: removed unnecessary styles for host tabs * style: removed unused css * feat: added the host detail view (#6267) * Host containers (#6297) * feat: added the host detail view * feat: completed containers and processes details view * Show host metrics panels in metrics tab. (#6306) * feat: added the host detail view * feat: completed containers and processes details view * feat: added host metrics panels in metrics tabs * refactor: removed inline styles from host containers and processes tabs * style: added top and bottom margin to containers and processes tab * Metrics time selection (#6360) * feat: added the host detail view * feat: completed containers and processes details view * feat: added host metrics panels in metrics tabs * refactor: removed inline styles from host containers and processes tabs * feat: added logs and traces tab in host metrics detail view * chore: removed console statements * feat: added DateTimeSelection component in metrics tab * style: added top and bottom margin to containers and processes tab * style: removed inline styles * feat: added logs and traces tab in host metrics detail view (#6359) * feat: added the host detail view * feat: completed containers and processes details view * feat: added host metrics panels in metrics tabs * refactor: removed inline styles from host containers and processes tabs * feat: added logs and traces tab in host metrics detail view * chore: removed console statements * feat: added filters and time selection in traces tab * fix: resolved metrics,logs and traces tab issues * feat: added navigation for logs and traces to respective explorer pages * fix: added the code for logs tab and navigation to respective explorer page * fix: added fixes for date time selection custom issue * style: added styles for light mode * refactor: removed unused code and added comments * refactor: added new code for host metric attribute keys * feat: reset query data once we are on infra monitoring page * chore: remove optional parameter from get attributes and groupby interfaces * feat: update ui as per the designs * fix: logs list, time select and other ui issues * feat: update title for infra monitoring page * feat: update copies * feat: update styles for light mode * fix: reset page size on filter, open explorers in new tab, enable horizontal scroll * feat: traces tab updates * feat: move infra monitoring behind ff * fix: remove sorting from host listing page --------- Co-authored-by: Yunus M <myounis.ar@live.com> * chore: fix lint errors --------- Co-authored-by: rahulkeswani101 <rahul@signoz.io>
Summary
Related Issues / PR's
Screenshots
Affected Areas and Manually Tested Areas
Important
Adds modal time selection to host metrics, logs, and traces with new components and styles.
isModalTimeSelection
prop toHostMetricDetail
and subcomponents for modal time selection.DateTimeSelectionV2
for time range selection inMetrics
,HostMetricLogsDetailedView
, andHostMetricTraces
.HostsList
to passisModalTimeSelection
toHostMetricDetail
.HostMetricTraces
component for displaying host metric traces with time selection.HostMetricsLogs
andHostMetricLogsDetailedView
components for displaying logs with time selection.HostMetricTraces
andHostMetricsLogs
in respective.scss
files.Metrics.styles.scss
for new layout adjustments.formatNanoToMS
utility inHostMetricTraces/utils.ts
for formatting durations.HostMetricTraces/constants.ts
andHostMetricsLogs/constants.ts
.This description was created by for 9368e74. It will automatically update as commits are pushed.