Skip to content
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

[OneDiscover] Add EBT event to track field usage #193996

Merged
merged 15 commits into from
Sep 30, 2024

Conversation

jughosta
Copy link
Contributor

@jughosta jughosta commented Sep 25, 2024

Summary

This PR adds new EBT event type discover_field_usage which we use for tracking adding and removing grid columns and adding filters via +/-/exists buttons. Properties of the added events consist of:

eventType: dataTableSelection, dataTableRemoval, or filterAddition
fieldName: name of the field if it's from ECS schema
filterOperation: +, -, or _exists_

Screenshot 2024-09-25 at 17 51 27

Testing

Enable "Usage collection" global setting.

Navigate to Discover and observe kibana-browser requests in Network tab.

Checklist

@jughosta jughosta added release_note:skip Skip the PR/issue when compiling release notes Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) Project:OneDiscover Enrich Discover with contextual awareness labels Sep 25, 2024
@jughosta jughosta self-assigned this Sep 25, 2024
@jughosta jughosta marked this pull request as ready for review September 25, 2024 17:33
@jughosta jughosta requested a review from a team as a code owner September 25, 2024 17:33
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

Copy link
Contributor

@davismcphee davismcphee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code changes look good and it works well, thanks! I think it would also be a good idea for us to start documenting some of this new telemetry soon for future reference.

});
};

private registerEmbeddable(core: CoreSetup<DiscoverStartPlugins>, plugins: DiscoverSetupPlugins) {
const ebtManager = new DiscoverEBTManager(); // It is not initialized outside of Discover
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may want to consider also tracking the custom events in embeddables too since we don't have the same issue as we do with context. We can discuss first and do it as a followup though if we decide to.

@jughosta jughosta enabled auto-merge (squash) September 30, 2024 11:42
@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
discover 819.2KB 820.2KB +1.1KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
discover 49.0KB 50.6KB +1.6KB

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @jughosta

@jughosta jughosta merged commit 7aa64b6 into elastic:main Sep 30, 2024
22 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/11110144397

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Sep 30, 2024
- Closes elastic#186156
- Closes elastic#189454

## Summary

This PR adds new EBT event type `discover_field_usage` which we use for
tracking adding and removing grid columns and adding filters via
+/-/exists buttons. Properties of the added events consist of:

`eventType`: `dataTableSelection`, `dataTableRemoval`, or
`filterAddition`
`fieldName`: name of the field if it's from ECS schema
`filterOperation`: `+`, `-`, or `_exists_`

<img width="1002" alt="Screenshot 2024-09-25 at 17 51 27"
src="https://github.com/user-attachments/assets/b3f3fb69-55e1-43b2-9683-a6d8884f56fe">

## Testing

Enable "Usage collection" global setting.

Navigate to Discover and observe `kibana-browser` requests in Network
tab.

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

(cherry picked from commit 7aa64b6)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Sep 30, 2024
…4457)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[OneDiscover] Add EBT event to track field usage
(#193996)](#193996)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Julia
Rechkunova","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-09-30T16:20:21Z","message":"[OneDiscover]
Add EBT event to track field usage (#193996)\n\n- Closes
https://github.com/elastic/kibana/issues/186156\r\n- Closes
https://github.com/elastic/kibana/issues/189454\r\n\r\n##
Summary\r\n\r\nThis PR adds new EBT event type `discover_field_usage`
which we use for\r\ntracking adding and removing grid columns and adding
filters via\r\n+/-/exists buttons. Properties of the added events
consist of:\r\n\r\n`eventType`: `dataTableSelection`,
`dataTableRemoval`, or\r\n`filterAddition`\r\n`fieldName`: name of the
field if it's from ECS schema\r\n`filterOperation`: `+`, `-`, or
`_exists_`\r\n\r\n\r\n<img width=\"1002\" alt=\"Screenshot 2024-09-25 at
17 51
27\"\r\nsrc=\"https://github.com/user-attachments/assets/b3f3fb69-55e1-43b2-9683-a6d8884f56fe\">\r\n\r\n##
Testing\r\n\r\nEnable \"Usage collection\" global
setting.\r\n\r\nNavigate to Discover and observe `kibana-browser`
requests in Network\r\ntab.\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"7aa64b6ed59488ab10a5136199b69de0c86668af","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:DataDiscovery","backport:prev-minor","Project:OneDiscover"],"title":"[OneDiscover]
Add EBT event to track field
usage","number":193996,"url":"https://github.com/elastic/kibana/pull/193996","mergeCommit":{"message":"[OneDiscover]
Add EBT event to track field usage (#193996)\n\n- Closes
https://github.com/elastic/kibana/issues/186156\r\n- Closes
https://github.com/elastic/kibana/issues/189454\r\n\r\n##
Summary\r\n\r\nThis PR adds new EBT event type `discover_field_usage`
which we use for\r\ntracking adding and removing grid columns and adding
filters via\r\n+/-/exists buttons. Properties of the added events
consist of:\r\n\r\n`eventType`: `dataTableSelection`,
`dataTableRemoval`, or\r\n`filterAddition`\r\n`fieldName`: name of the
field if it's from ECS schema\r\n`filterOperation`: `+`, `-`, or
`_exists_`\r\n\r\n\r\n<img width=\"1002\" alt=\"Screenshot 2024-09-25 at
17 51
27\"\r\nsrc=\"https://github.com/user-attachments/assets/b3f3fb69-55e1-43b2-9683-a6d8884f56fe\">\r\n\r\n##
Testing\r\n\r\nEnable \"Usage collection\" global
setting.\r\n\r\nNavigate to Discover and observe `kibana-browser`
requests in Network\r\ntab.\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"7aa64b6ed59488ab10a5136199b69de0c86668af"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/193996","number":193996,"mergeCommit":{"message":"[OneDiscover]
Add EBT event to track field usage (#193996)\n\n- Closes
https://github.com/elastic/kibana/issues/186156\r\n- Closes
https://github.com/elastic/kibana/issues/189454\r\n\r\n##
Summary\r\n\r\nThis PR adds new EBT event type `discover_field_usage`
which we use for\r\ntracking adding and removing grid columns and adding
filters via\r\n+/-/exists buttons. Properties of the added events
consist of:\r\n\r\n`eventType`: `dataTableSelection`,
`dataTableRemoval`, or\r\n`filterAddition`\r\n`fieldName`: name of the
field if it's from ECS schema\r\n`filterOperation`: `+`, `-`, or
`_exists_`\r\n\r\n\r\n<img width=\"1002\" alt=\"Screenshot 2024-09-25 at
17 51
27\"\r\nsrc=\"https://github.com/user-attachments/assets/b3f3fb69-55e1-43b2-9683-a6d8884f56fe\">\r\n\r\n##
Testing\r\n\r\nEnable \"Usage collection\" global
setting.\r\n\r\nNavigate to Discover and observe `kibana-browser`
requests in Network\r\ntab.\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"7aa64b6ed59488ab10a5136199b69de0c86668af"}}]}]
BACKPORT-->

Co-authored-by: Julia Rechkunova <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) Project:OneDiscover Enrich Discover with contextual awareness release_note:skip Skip the PR/issue when compiling release notes Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. v8.16.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[discover] Track field names when selected and removed [OneDiscover] Add EBT event to track field usage
5 participants