-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Data-Plugin] Add telemetry around query/filter bar usage #82709
Conversation
Pinging @elastic/kibana-app (Team:KibanaApp) |
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 seems to be a problem when you load the application multiple events are tracked
what users use more filters or search bar - maybe calculate the number of times a query is submitted from search bar vs filter is added
dear @AlonaNadler maybe you meant the number of times a filter is added by using the field selector, the data table, the document view compared to the usage of the search bar including the filters there?
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 all apps would benefit from this. Lets add this directly into the SearchBar
component for all apps.
Also avoiding adding new callbacks to this component is preferable, as we want to have an Observable base API.
src/plugins/discover/public/application/components/discover_legacy.tsx
Outdated
Show resolved
Hide resolved
@kertal I think you are right, can we add the number of times a filter is added either explicitly, from the table or the document view. Im addition can we collect the number of times users interact with the filter ? counting the number of times users use either |
@elasticmachine merge upstream |
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.
Looks great. I think we can add the additional metrics @AlonaNadler suggests.
Can't wait to see the results.
} | ||
|
||
export type StatefulSearchBarProps = SearchBarOwnProps & { | ||
appName: string; | ||
useDefaultBehaviors?: boolean; | ||
savedQueryId?: string; | ||
onSavedQueryIdChange?: (savedQueryId?: string) => void; | ||
onFilterAdded?: () => void; |
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 this can be removed
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 it was, you must be looking at the old commit 🤔
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.
It's actually a comment from last week :-D
Sorry
💚 Build SucceededMetrics [docs]Module Count
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
if (props.trackUiMetric) { | ||
props.trackUiMetric(METRIC_TYPE.CLICK, `${props.appName}:filter_invertInclusion`); | ||
} |
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.
@lizozom there are more functions here like onDisableAll
, onPinAll
, since this PR started to add metric to some of them this functions, I wonder if it makes sense to add metric to all of them?
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.
Code LGTM, tested locally, works 👍 in Discover, Visualize, Dashboard , added a note if it makes sense to add more metrics, and would suggest to updated the PR's description with all new metrics that were introduced and if it also makes sense to track removing of filters?
…83157) * [Discover] Add telemetry around query/filter bar usage * Updating documentation * Adding a separate method for tracking query submit * Updating doc changes * Adding trackUiMetric to Data plugin * Doc changes * Do not make usageCollection a start dependency * Updating documentation * Adding metrics for filter inclusion, edit, and disabled * updating docs Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Summary
As part of #58747, we'd like to add a metric around "the number of times a query is submitted from search bar vs filter is added.
I tested this by querying saved objects API:
http://localhost:5601/dov/api/saved_objects/_find?type=ui-metric
and inspecting the response:This PR adds the
trackUiMetric
ability to data plugin. Additionally, it introduces metrics around query/filter bar usage:query_submitted
metric, when a query is submitted from a search barfilter_added
metric, when a filter is added from a filter barfilter_edited
, when a filter is editedfilter_invertInclusion
when filter results are included/excludedfilter_toggleAllDisabled
when a filter is enabled/disabledAll metrics are prefixed with the appropriate
appName
for easier tracking.Checklist
Delete any items that are not applicable to this PR.
- [ ] Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support- [ ] Any UI touched in this PR is usable by keyboard only (learn more about keyboard accessibility)- [ ] Any UI touched in this PR does not create any new axe failures (run axe in browser: FF, Chrome)- [ ] This renders correctly on smaller devices using a responsive layout. (You can test this in your browser)- [ ] This was checked for cross-browser compatibilityFor maintainers