-
Notifications
You must be signed in to change notification settings - Fork 63
Traces - Update custom source display, add toast. #2403
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
Signed-off-by: Adam Tackett <[email protected]>
@@ -187,7 +187,7 @@ export const getTracesQuery = ( | |||
}, | |||
}, | |||
}, | |||
track_total_hits: false, | |||
track_total_hits: true, |
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.
nit. This is true by default if we don't provide the field here.
} catch { | ||
// not JSON, skip | ||
} |
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 this be empty?
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 think we don't a separate try catch here.
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.
Removed empty catch
@@ -35,6 +36,50 @@ export async function handleDslRequest( | |||
const query = { | |||
dataSourceMDSId, | |||
}; | |||
|
|||
const handleError = (error: any) => { |
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.
this function might need unit tests to make it easier to understand the examples of error
variable, and to ensure there's no regression
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.
Extraced handleError to a helper_functions file and included tested for it
public/components/trace_analytics/requests/tests/helper_funtions.test.tsx
PASS public/components/trace_analytics/requests/__tests__/helper_funtions.test.tsx (5.281 s)
handleError in handleDslRequest
✓ displays danger toast for too_many_buckets_exception (1 ms)
✓ logs error for non-bucket exceptions
✓ parses nested message JSON string (1 ms)
Signed-off-by: Adam Tackett <[email protected]>
Description
Toast message:

Updated warning in corner:

Issues Resolved
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.