-
Notifications
You must be signed in to change notification settings - Fork 63
Traces - Add traces unique count based on cardinality aggregation #2435
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
Traces - Add traces unique count based on cardinality aggregation #2435
Conversation
Signed-off-by: Thobi Sinaga <[email protected]>
@TackAdam probably due to this? https://www.elastic.co/docs/reference/aggregations/search-aggregations-metrics-cardinality-aggregation#_counts_are_approximate I don't see a point in providing an actual number tbh. You could show an actual number if it's below 40k (the maximum you can get accurately enough) and otherwise show 10k+. |
BTW, is there a reason why the UI components and features used are different between the Data Prepper and Custom Source views? It looks like Custom Sources is enjoying the use of the updated components also used in Discovery etc. "Data Prepper" should be a specific case of a "Custom Source", I don't see a reason to differentiate the two? |
Custom source is an experimental feature introduced in version 2.17. It allowed us to iterate rapidly on the user experience, even with breaking changes. The team is actively working to bring this feature out of experimental status, at which point we can update and align the Data Prepper experience accordingly. |
After meeting with UX, we agreed that displaying the exact count is not particularly useful and can be replaced with a "10k+" indicator. This change enables the use of the more efficient cardinality aggregation. As a result, the existing check here: https://github.com/opensearch-project/dashboards-observability/blob/main/public/components/trace_analytics/requests/traces_request_handler.ts#L161 can safely be removed, since the exact count is no longer required. Next steps:
cc: @sthobis |
Signed-off-by: Thobi Sinaga <[email protected]>
Signed-off-by: Thobi Sinaga <[email protected]>
77643e8
to
fcf9064
Compare
I think the message is confusing still. The paranthesis showing 500, and "500 out of ..." is incorrect. The page size is 10 not 500. We should just say "Traces ({exact number})" or "Traces (10,000+)" and remove the yellow text. |
Thanks for the note! After review I am in agreement that the text should be adjusted. I was thinking along the lines of “Results out of {number under 10,000}” and “Results out of 10,000+” because the exact number is displayed next to the type already. I do think this callout is still necessary to indicate to the user that more than what is displayed was factored into the query call. |
Pending discussion on above, adjusting wording to “Results out of {number under 10,000}” and “Results out of 10,000+” per above comment. Few minor bugs left to fix, but it’s looking good.
Video example of bugs: Bug1+2.movBug3.mov |
Match data_prepper warning message to custom_data_prepper Fix datagrid pagination/empty state on traces mode Signed-off-by: Thobi Sinaga <[email protected]>
Updated
Screen.Recording.2025-05-06.at.19.23.03.720p.mov |
@sthobis Great work! All bugs fixed. IE fixing Should be good to merge after those two minor changes! |
Signed-off-by: Thobi Sinaga <[email protected]>
@@ -8,6 +8,8 @@ export const NANOS_TO_MS = 1e6; | |||
|
|||
export const MILI_TO_SEC = 1000; | |||
|
|||
export const MAX_DISPLAY_ROWS = 10000; |
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.
Thanks for moving this to constants
public/components/trace_analytics/components/common/shared_components/custom_datagrid.tsx
Outdated
Show resolved
Hide resolved
Signed-off-by: Thobi Sinaga <[email protected]>
Description
traceId
.data_prepper
andcustom_data_prepper
.data_prepper
view if there are more trace records than are currently shown.Screen.Recording.2025-04-30.at.16.12.35.720p.mov
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.