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: add timezone support to logs explorer chart (built with Chartjs) #6566

Conversation

ahmadshaheer
Copy link
Collaborator

@ahmadshaheer ahmadshaheer commented Dec 1, 2024

Summary

Related Issues / PR's

Part of https://github.com/SigNoz/engineering-pod/issues/2005

Screenshots

2024-12-01.22-26-13.mov

Affected Areas and Manually Tested Areas


Important

Adds timezone support across the application using a new useTimezoneFormatter hook for consistent timestamp formatting.

  • Behavior:
    • Introduces useTimezoneFormatter hook for consistent timezone-based timestamp formatting.
    • Updates TimezoneProvider to include formatTimezoneAdjustedTimestamp function.
    • Applies timezone formatting to logs, graphs, tables, and dashboards using useTimezone.
  • Components:
    • Updates CustomTimePicker, RangePickerModal, Graph, ListLogView, RawLogView, TableView, LogsPanelComponent, TracesTableComponent, NoFilterTable, SaveView, and others to use timezone formatting.
    • Modifies getGraphOptions in utils.ts to format tooltips with timezone.
  • Misc:
    • Adds caching mechanism in useTimezoneFormatter to optimize repeated timestamp formatting.
    • Ensures consistent timezone handling across the application.

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

Copy link

github-actions bot commented Dec 1, 2024

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 1, 2024
Copy link

github-actions bot commented Dec 1, 2024

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 612dd06 in 1 minute and 6 seconds

More details
  • Looked at 145 lines of code in 3 files
  • Skipped 1 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. frontend/src/components/Graph/utils.ts:2
  • Draft comment:
    Remove the import of 'chartjs-adapter-date-fns' as it is not used and 'chartjs-adapter-dayjs-3' is being used instead.
  • Reason this comment was not posted:
    Marked as duplicate.
2. frontend/src/components/Graph/index.tsx:130
  • Draft comment:
    Use design tokens or predefined color constants instead of hardcoding color values for consistency. This applies to other hardcoded colors in this file as well.
  • Reason this comment was not posted:
    Comment was on unchanged code.

Workflow ID: wflow_azZrvepCaam4Neh8


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/Graph/index.tsx Outdated Show resolved Hide resolved
Copy link

github-actions bot commented Dec 1, 2024

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 c4bfe81 in 11 seconds

More details
  • Looked at 21 lines of code in 1 files
  • Skipped 1 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. frontend/package.json:62
  • Draft comment:
    The chartjs-adapter-dayjs-3 dependency is missing. Please add it to the dependencies section.
  • Reason this comment was not posted:
    Marked as duplicate.
2. frontend/package.json:62
  • Draft comment:
    The chartjs-adapter-dayjs-3 dependency is missing from package.json. Please add it to ensure the timezone support functionality works as intended.
  • Reason this comment was not posted:
    Comment did not seem useful.

Workflow ID: wflow_wTFu0G7pz2ZxSBDp


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

Copy link

github-actions bot commented Dec 1, 2024

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

1 similar comment
Copy link

github-actions bot commented Dec 1, 2024

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

@ahmadshaheer ahmadshaheer force-pushed the feat/apply-timezone-to-logs-explorer-chartjs-based-chart branch from c4bfe81 to fc88e02 Compare December 1, 2024 18:02
Copy link

github-actions bot commented Dec 1, 2024

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 fc88e02 in 43 seconds

More details
  • Looked at 123 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. frontend/src/components/Graph/utils.ts:2
  • Draft comment:
    The import of 'chartjs-adapter-date-fns' is unnecessary since 'dayjs' is being used for date handling. Consider removing this import to avoid confusion.
  • Reason this comment was not posted:
    Marked as duplicate.
2. frontend/src/components/Graph/index.tsx:130
  • Draft comment:
    Avoid using hardcoded color values like rgba(231,233,237,0.8). Use design tokens or predefined color constants instead. This applies to other hardcoded colors in this file as well.
  • Reason this comment was not posted:
    Comment was on unchanged code.

Workflow ID: wflow_JvRYETVfkH0N9FqJ


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/Graph/index.tsx Outdated Show resolved Hide resolved
@ahmadshaheer ahmadshaheer force-pushed the feat/apply-timezone-to-tabular-data-throughout-the-app branch from a7da3f3 to 0a21911 Compare December 2, 2024 06:14
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 44a3f1b in 23 seconds

More details
  • Looked at 52 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. frontend/src/hooks/useTimezoneFormatter/useTimezoneFormatter.ts:78
  • Draft comment:
    userTimezone is not optional in the function signature, so using optional chaining (?.) is unnecessary. Consider removing it for clarity and consistency. This also applies to line 63.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The code is mostly well-structured, but there is a minor issue with the use of optional chaining on a non-optional property.
2. frontend/src/hooks/useTimezoneFormatter/useTimezoneFormatter.ts:39
  • Draft comment:
    Avoid using the component/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 not on a valid diff hunk.

Workflow ID: wflow_GlVTSJsgD3OoWbI6


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 2b4b0ed in 37 seconds

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

Workflow ID: wflow_5BtQLLsgHppXuXEV


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

… into feat/apply-timezone-to-logs-explorer-chartjs-based-chart
@ahmadshaheer ahmadshaheer merged commit a0a611c into feat/apply-timezone-to-tabular-data-throughout-the-app Dec 3, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants