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

[BUG] Notification message preview shows times in wrong timezone #1173

Open
AWSHurneyt opened this issue Dec 9, 2024 · 0 comments
Open

[BUG] Notification message preview shows times in wrong timezone #1173

AWSHurneyt opened this issue Dec 9, 2024 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@AWSHurneyt
Copy link
Collaborator

AWSHurneyt commented Dec 9, 2024

What is the bug?
Currently, the alerting backend only supports sending trigger start/end time values in UTC format (see opensearch-project/alerting#1744 for request to add custom timezone support). However, the notification message preview is displaying those values in the local timezone. Because the backend only supports UTC, the preview should also use UTC for a uniform experience.

This bug is likely caused by this function retrieving the timezone from the browser instead of always using UTC.
https://github.com/opensearch-project/alerting-dashboards-plugin/blob/main/public/pages/CreateTrigger/utils/helper.js#L124C17-L124C28

Once the bug is fixed, the example message contents found here can be updated to reflect the UTC timezone.
https://github.com/opensearch-project/alerting-dashboards-plugin/blob/main/public/pages/CreateTrigger/utils/constants.js#L9

For example, this message:

Monitor {{ctx.monitor.name}} just entered alert status. Please investigate the issue.
  - Trigger: {{ctx.trigger.name}}
  - Severity: {{ctx.trigger.severity}}
  - Period start: {{ctx.periodStart}}
  - Period end: {{ctx.periodEnd}}

Can be updated to this:

Monitor {{ctx.monitor.name}} just entered alert status. Please investigate the issue.
  - Trigger: {{ctx.trigger.name}}
  - Severity: {{ctx.trigger.severity}}
  - Period start: {{ctx.periodStart}} UTC
  - Period end: {{ctx.periodEnd}} UTC
@AWSHurneyt AWSHurneyt added bug Something isn't working good first issue Good for newcomers labels Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant