-
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: add timezone support to the graphs throughout the app #6520
feat: add timezone support to the graphs throughout the app #6520
Conversation
…artOptions traces, logs time series, dashboard, service details (time series, bar), Node, Pod, Alert graphs
This reverts commit f8411ab.
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! Reviewed everything up to 234d71a in 1 minute and 10 seconds
More details
- Looked at
537
lines of code in14
files - Skipped
0
files when reviewing. - Skipped posting
8
drafted comments based on config settings.
1. frontend/src/container/AlertHistory/Timeline/Graph/Graph.tsx:123
- Draft comment:
The use of optional chaining withtimezone?.value
is unnecessary sincetimezone
is always defined in the context. Consider usingtimezone.value
instead. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
The comment claims thattimezone
is always defined, but without seeing the implementation ofuseTimezone
, it's speculative. The use of optional chaining is a defensive programming practice to prevent runtime errors iftimezone
is undefined. Without strong evidence thattimezone
is always defined, the comment seems speculative.
I might be missing the context of howuseTimezone
is implemented, which could confirm whethertimezone
is always defined. The comment could be correct ifuseTimezone
guarantees a definedtimezone
.
Without access to theuseTimezone
implementation, I should err on the side of caution and assume the comment is speculative. Optional chaining is a common practice to handle potential undefined values safely.
The comment should be deleted as it is speculative without evidence thattimezone
is always defined. Optional chaining is a safe practice.
2. frontend/src/container/AnomalyAlertEvaluationView/AnomalyAlertEvaluationView.tsx:157
- Draft comment:
The use of optional chaining withtimezone?.value
is unnecessary sincetimezone
is always defined in the context. Consider usingtimezone.value
instead. - Reason this comment was not posted:
Marked as duplicate.
3. frontend/src/container/AnomalyAlertEvaluationView/AnomalyAlertEvaluationView.tsx:263
- Draft comment:
The use of optional chaining withtimezone?.value
is unnecessary sincetimezone
is always defined in the context. Consider usingtimezone.value
instead. - Reason this comment was not posted:
Marked as duplicate.
4. frontend/src/container/FormAlertRules/ChartPreview/index.tsx:244
- Draft comment:
The use of optional chaining withtimezone?.value
is unnecessary sincetimezone
is always defined in the context. Consider usingtimezone.value
instead. - Reason this comment was not posted:
Marked as duplicate.
5. frontend/src/container/FormAlertRules/ChartPreview/index.tsx:245
- Draft comment:
The use of optional chaining withtimezone?.value
is unnecessary sincetimezone
is always defined in the context. Consider usingtimezone.value
instead. - Reason this comment was not posted:
Marked as duplicate.
6. frontend/src/container/GantChart/Span/index.tsx:45
- Draft comment:
The use of optional chaining withtimezone?.value
is unnecessary sincetimezone
is always defined in the context. Consider usingtimezone.value
instead. - Reason this comment was not posted:
Marked as duplicate.
7. frontend/src/container/LogDetailedView/InfraMetrics/NodeMetrics.tsx:94
- Draft comment:
The use of optional chaining withtimezone?.value
is unnecessary sincetimezone
is always defined in the context. Consider usingtimezone.value
instead. - Reason this comment was not posted:
Marked as duplicate.
8. frontend/src/container/LogDetailedView/InfraMetrics/NodeMetrics.tsx:95
- Draft comment:
The use of optional chaining withtimezone?.value
is unnecessary sincetimezone
is always defined in the context. Consider usingtimezone.value
instead. - Reason this comment was not posted:
Marked as duplicate.
Workflow ID: wflow_cHZt1i2FXP4VlGNK
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> |
1 similar comment
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
…ker placeholder" This reverts commit 429c87a.
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.
👍 Looks good to me! Incremental review on d5dc65a in 24 seconds
More details
- Looked at
32
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
2
drafted comments based on config settings.
1. frontend/src/container/TopNav/DateTimeSelectionV2/index.tsx:664
- Draft comment:
The removal of timezone handling here might lead to incorrect time display if the timezone is not managed elsewhere. Ensure that the timezone is correctly applied to the date-time values used in the component. - Reason this comment was not posted:
Comment did not seem useful.
2. frontend/src/container/TopNav/DateTimeSelectionV2/index.tsx:618
- Draft comment:
Avoid using inline styles in React components. Use external stylesheets, CSS classes, or styled components instead. This is also applicable at line 632. - Reason this comment was not posted:
Comment was not on a valid diff hunk.
Workflow ID: wflow_398CDOsA4DRscp64
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> |
* feat: display timezone adjusted time range in time picker * fix: open the timepicker on clicking the input after closing the timezone picker by clicking outside (#6522)
@@ -17,7 +19,7 @@ const tooltipPlugin = ( | |||
return value.toFixed(3); | |||
} | |||
if (value instanceof Date) { | |||
return value.toLocaleString(); | |||
return dayjs(value).tz(timezone).format('MM/DD/YYYY, h:mm:ss A'); |
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.
earlier this was string coming from consumer, you had a format, just recheck if this is expected, and you are not overriding anything
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, this is the tooltip plugin for anomaly alert. No, we aren't overriding anything, this is the only change that we have made, i.e., introduced timezone-adjusted timestamp formatting.
…app (#6565) * fix: make x axis and tooltip time format consistent in uPlot graphs * feat: custom hook for formatting timezone * feat: add timezone support to traces explorer timestamp column * feat: add timezone support to saved views ...
1b48eb8
into
feat/timezone-picker-basic-functionality
Add timezone support to the graphs throughout the app
Service details page
Overview tab
DB Call Metrics tab
External Metrics tab
Traces explorer
Logs explorer
Dashboard
Details page, New Panel, Edit Panel
Messaging queues
Alert Details
Overview Tab
Alert History Tab
Trace details
Note:
This PR doesn't include the logs explorer preview chart (which is built using Chart.js), it'll be picked up separately
Related Issues / PR's
Part of https://github.com/SigNoz/engineering-pod/issues/2005
Screenshots
Affected Areas and Manually Tested Areas
Important
Add timezone support to graphs and charts using a custom hook for consistent date formatting across the application.
useTimezone
hook inproviders/Timezone.tsx
to manage timezone settings.Graph.tsx
,AnomalyAlertEvaluationView.tsx
,ChartPreview/index.tsx
,NodeMetrics.tsx
,PodMetrics.tsx
,UplotPanelWrapper.tsx
,TimeSeriesView.tsx
,DateTimeSelectionV2/index.tsx
,TraceDetail/index.tsx
.tooltipPlugin.ts
to format timestamps using the current timezone.getUplotChartOptions.ts
to includetzDate
andtimezone
options foruPlot
.This description was created by for 234d71a. It will automatically update as commits are pushed.