-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
feat(aci): Create detector on submit #93380
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
Conversation
❌ 4 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
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.
😅 sorry for so many comments, in future i think it might be easier if the PR is a bit smaller scope. things like introducing the priorityControl then using it in the detector form would make it a bit easier to review.
biggest pieces of feedback would be if we can match the enums a bit better to the server, then you might have an easier time with typing etc and wanting to understand why we are re-mapping the priority level things to a new structure.
|
||
return ( | ||
<NewDetectorLayout> | ||
<MetricDetectorForm model={model} /> | ||
<FullHeightForm |
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.
is any of this stuff something we should make shared components from?
It seems like we could have a lot of little split out components to me,
<StyledLayoutHeader>
<Layout.HeaderContent>
<NewDetectorBreadcrumbs />
<Layout.Title>
<EditableDetectorName />
</Layout.Title>
</Layout.HeaderContent>
</StyledLayoutHeader>
might be a shareable DetectorHeader
-- need to find those common components because we'll have so many different detector types. (the other trick is to make them composable to allow for overrides)
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 thirds layout we're using is the shared layout component for now
/** | ||
* Creates the data source configuration for the detector | ||
*/ | ||
function createDataSource(data: MetricDetectorFormData): NewDataSource { |
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.
should the NewDataSource
type be a generic type that we pass in stuff like SnubaDataSource
to? that way we could have a generic for anything that's common in the data sources and have a strict typing to snuba for the metric case.
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.
yeah i've not figured out what that looks like yet. That part of the form isn't built
const eventTypes = ['error']; | ||
|
||
return { | ||
queryType: 0, |
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.
queryType: 0, | |
queryType: DetectorType.METRIC, |
seems like we should drive this through an enum, and something we can access from the form itself.
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.
i'll figure out query type and the enum when we add that part of the form soon
: lowThresholdDirection === 'higher' | ||
? t('higher') | ||
: t('lower')} | ||
{conditionType === 'gt' ? t('higher') : t('lower')} |
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.
should we cache consistent translations like higher
and lower
in a constants file?
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.
usually ends up not being worth it because of casing and stuff or you want 'higher than' in another file
@@ -1,22 +0,0 @@ | |||
import SentryDocumentTitle from 'sentry/components/sentryDocumentTitle'; |
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.
Curious why we're removing this component? it seems like a helpful wrapper component to build more monitors quickly.
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 layouts were preemptively split out a bit early. Right now they're getting in the way since they're trying to share code between multiple pages that are changing. We'll likely have a single page for edit/new and another for step 1 similar to metric alerts. Right now they don't have a ton in common.
Allows creating new detectors via the ui. Not everything is working yet like resolution threshold.