-
Notifications
You must be signed in to change notification settings - Fork 23
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: support navigating to discover in alerting popover #316
Conversation
Signed-off-by: tygao <[email protected]>
Signed-off-by: tygao <[email protected]>
Signed-off-by: tygao <[email protected]>
Signed-off-by: tygao <[email protected]>
const timeDslIndex = filters?.findIndex((filter: Record<string, string>) => filter?.range); | ||
const timeDsl = filters[timeDslIndex]?.range; | ||
const timeFieldName = Object.keys(timeDsl)[0]; | ||
if (!timeFieldName) return; | ||
filters?.splice(timeDslIndex, 1); |
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.
there could have multiple range filters in filters and date range is not the first one
{
"size": 0,
"query": {
"bool": {
"filter": [
{
"range": {
"total_quantity": {
"from": 1,
"to": 5,
"include_lower": true,
"include_upper": true,
"boost": 1
}
}
},
{
"range": {
"order_date": {
"from": "{{period_end}}||-1h",
"to": "{{period_end}}",
"include_lower": true,
"include_upper": true,
"format": "epoch_millis",
"boost": 1
}
}
}
],
"adjust_pure_negative": true,
"boost": 1
}
}
}
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.
In which case will this DSL exist? I was told offline there only be one range in DSL, if so, this could be a potential issue.
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.
What does period_end mean?
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.
In which case will this DSL exist? I was told offline there only be one range in DSL, if so, this could be a potential issue.
This is a manual input query DSL. From create monitor page, if i add more range filters they will not at the first. It will looks like below, and the code logic is find first range filter, work for most cases.
"query": {
"size": 0,
"aggregations": {},
"query": {
"bool": {
"filter": [
{
"range": {
"order_date": {
"gte": "{{period_end}}||-1h",
"lte": "{{period_end}}",
"format": "epoch_millis"
}
}
},
{
"range": {
"products.price": {
"gte": 10,
"lte": 20
}
}
}
]
}
}
}
What does period_end mean?
this is placeholder to actual trigger time.
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.
There still have other edge cases, like customized query don't have range filter. For POC we can ignore it.
* feat: support navigate to discover in alerting popover Signed-off-by: tygao <[email protected]> * feat: support MDS and fix test env error Signed-off-by: tygao <[email protected]> * doc: add changelog Signed-off-by: tygao <[email protected]> * add tests Signed-off-by: tygao <[email protected]> --------- Signed-off-by: tygao <[email protected]> (cherry picked from commit 93744fe) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md
* feat: support navigate to discover in alerting popover Signed-off-by: tygao <[email protected]> * feat: support MDS and fix test env error Signed-off-by: tygao <[email protected]> * doc: add changelog Signed-off-by: tygao <[email protected]> * add tests Signed-off-by: tygao <[email protected]> --------- Signed-off-by: tygao <[email protected]> (cherry picked from commit 93744fe) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Description
support navigating to discover in alerting popover
Screen shot
-.2024-09-14.6_33_33.mp4
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.