Repository navigation
feat: allow tile alerts to use 1m as an interval option #3327
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@hyperdx/app': patch | ||
| --- | ||
|
|
||
| feat: dashboard tile alerts can use a 1 minute interval outside development |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,6 @@ import { | |
| differenceInMinutes, | ||
| sub, | ||
| } from 'date-fns'; | ||
| import _ from 'lodash'; | ||
| import { z } from 'zod'; | ||
| import { formatTileAlertDisplayName } from '@hyperdx/common-utils/dist/alerts'; | ||
| import { Granularity } from '@hyperdx/common-utils/dist/core/utils'; | ||
|
|
@@ -22,7 +21,6 @@ import { | |
| SavedChartConfig, | ||
| } from '@hyperdx/common-utils/dist/types'; | ||
|
|
||
| import { IS_DEV } from '@/config'; | ||
| import type { AlertsPageItem } from '@/types'; | ||
|
|
||
| export function intervalToGranularity(interval: AlertInterval) { | ||
|
|
@@ -121,16 +119,7 @@ export const ALERT_INTERVAL_OPTIONS: Record<AlertInterval, string> = { | |
| '1d': '1 day', | ||
| }; | ||
|
|
||
| export const TILE_ALERT_INTERVAL_OPTIONS = _.pick(ALERT_INTERVAL_OPTIONS, [ | ||
| ...(IS_DEV ? (['1m'] as const) : []), | ||
| '5m', | ||
| '15m', | ||
| '30m', | ||
| '1h', | ||
| '6h', | ||
| '12h', | ||
| '1d', | ||
| ]); | ||
| export const TILE_ALERT_INTERVAL_OPTIONS = ALERT_INTERVAL_OPTIONS; | ||
|
mrkaye97 marked this conversation as resolved.
Resolved
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔵 minor — Delete the alias and use Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond |
||
|
|
||
| export const ALERT_CHANNEL_OPTIONS: Record<AlertChannelType, string> = { | ||
| webhook: 'Webhook', | ||
|
|
||
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.
just aliased this instead of refactoring everywhere in case we wanted them to diverge in the future, but happy to also remove
TILE_ALERT_INTERVAL_OPTIONSand useALERT_INTERVAL_OPTIONSeverywhere instead!