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

Dashboard insights flyout with dashboard views #187993

Merged

Conversation

Dosant
Copy link
Contributor

@Dosant Dosant commented Jul 10, 2024

Summary

close #183687

Feature

  • Implement dashboard view stats UI on top of usage counter that counts dashboard views for last 90 day and shows weekly histogram.
    • (Even if there is not a lot of data, we still show it as a weekly histogram, so it can be pretty empty intially)

Screenshot 2024-08-15 at 13 00 11

Implementation

Server side

Dashboard plugin registers new routes to increase the view count and get stats. Routes are protected for users with dashboard access only. The implementation is located in @kbn/content-management-content-insights-server and internally uses usage counters. The retention is 90 days, so we can only show stats for last 90 days.

Client side

  • Dashboard uses the client from @kbn/content-management-content-insights-public to increase the view count every time a user opens a dashboard.
  • TableListView opens the flyout from @kbn/content-management-content-insights-publicto display the stats

How to test

@Dosant Dosant force-pushed the d/2024-07-10-kbn-usage-counter-dashboard-poc branch from adf914e to d3eef07 Compare July 17, 2024 09:26
@Dosant
Copy link
Contributor Author

Dosant commented Jul 17, 2024

/ci

2 similar comments
@Dosant
Copy link
Contributor Author

Dosant commented Jul 17, 2024

/ci

@Dosant
Copy link
Contributor Author

Dosant commented Jul 17, 2024

/ci

@Dosant
Copy link
Contributor Author

Dosant commented Jul 18, 2024

/ci

@Dosant Dosant force-pushed the d/2024-07-10-kbn-usage-counter-dashboard-poc branch from 6875057 to 2d91030 Compare July 19, 2024 13:05
@Dosant
Copy link
Contributor Author

Dosant commented Jul 19, 2024

/ci

@elasticmachine
Copy link
Contributor

elasticmachine commented Jul 19, 2024

💔 Build Failed

Failed CI Steps

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
dashboard 614 625 +11
eventAnnotationListing 619 628 +9
filesManagement 174 183 +9
graph 283 292 +9
maps 1213 1222 +9
visualizations 447 456 +9
total +56

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/content-management-content-insights - 4 +4
@kbn/content-management-table-list-view-table 33 34 +1
usageCollection 16 14 -2
total +3

Async chunks

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

id before after diff
dashboard 532.7KB 538.9KB +6.2KB
eventAnnotationListing 302.8KB 308.3KB +5.5KB
filesManagement 111.3KB 116.8KB +5.5KB
graph 403.8KB 409.5KB +5.7KB
maps 3.0MB 3.0MB +5.7KB
visualizations 292.8KB 298.3KB +5.5KB
total +34.1KB

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
@kbn/content-management-content-insights - 3 +3
@kbn/content-management-usage-counters - 1 +1
usageCollection 2 5 +3
total +7

Page load bundle

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

id before after diff
dashboard 43.2KB 43.3KB +57.0B
eventAnnotationListing 11.0KB 11.0KB +57.0B
graph 8.0KB 8.0KB +57.0B
maps 54.6KB 54.7KB +57.0B
visualizations 63.4KB 63.5KB +57.0B
total +285.0B
Unknown metric groups

API count

id before after diff
@kbn/content-management-content-insights - 8 +8
@kbn/content-management-table-list-view-table 49 50 +1
usageCollection 56 51 -5
total +4

async chunk count

id before after diff
dashboard 14 15 +1
eventAnnotationListing 6 7 +1
filesManagement 2 3 +1
graph 2 3 +1
maps 32 33 +1
visualizations 15 16 +1
total +6

ESLint disabled line counts

id before after diff
@kbn/content-management-usage-counters - 1 +1
dashboard 10 11 +1
total +2

Total ESLint disabled count

id before after diff
@kbn/content-management-usage-counters - 1 +1
dashboard 10 11 +1
total +2

History

  • 💔 Build #222342 failed 6875057629da791df311894135c5cf56749ab6e2
  • 💔 Build #222083 failed d2f42cec4dd60b011a6e215a6daa0f9efc8cd5bf
  • 💔 Build #222058 failed fc8061a8280a5870d9e379d459358f2f11c5aa4b
  • 💔 Build #222048 failed d3eef07d5db9c6ed2789635f5e3a2fd4a5ea23f1

@Dosant
Copy link
Contributor Author

Dosant commented Jul 31, 2024

/ci

1 similar comment
@Dosant
Copy link
Contributor Author

Dosant commented Jul 31, 2024

/ci

@Dosant
Copy link
Contributor Author

Dosant commented Jul 31, 2024

@elasticmachine merge upstream

@Dosant Dosant force-pushed the d/2024-07-10-kbn-usage-counter-dashboard-poc branch from c2dad49 to 2c8c588 Compare August 5, 2024 12:56
@Dosant
Copy link
Contributor Author

Dosant commented Aug 5, 2024

/ci

@Dosant Dosant force-pushed the d/2024-07-10-kbn-usage-counter-dashboard-poc branch from 9895d28 to c8386e2 Compare August 5, 2024 14:42
@Dosant
Copy link
Contributor Author

Dosant commented Aug 5, 2024

/ci

@Dosant
Copy link
Contributor Author

Dosant commented Aug 6, 2024

/ci

@Dosant Dosant changed the title D/2024 07 10 kbn usage counter dashboard poc Dashboard insights flyout with dashboard views Aug 6, 2024
@Dosant Dosant marked this pull request as ready for review August 6, 2024 11:51
@Dosant Dosant requested review from a team as code owners August 6, 2024 11:51
@Dosant Dosant added release_note:enhancement Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience) labels Aug 6, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/appex-sharedux (Team:SharedUX)

@Dosant Dosant requested a review from Heenawter August 6, 2024 11:52
Copy link
Contributor

@Heenawter Heenawter left a comment

Choose a reason for hiding this comment

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

Local test + code review. LGTM 👍

@Dosant
Copy link
Contributor Author

Dosant commented Aug 19, 2024

@elasticmachine merge upstream

1 similar comment
@Dosant
Copy link
Contributor Author

Dosant commented Aug 19, 2024

@elasticmachine merge upstream

@andreadelrio
Copy link
Contributor

@Dosant I was talking with @teresaalvarezsoler and we would like to add a single EuiTourStep to bring attention to the new info we have available under the Activity section in the Details flyout, like so:

Frame 70

@florent-leborgne can you please give us a hand with the copy? this is what we have:

Heading: New Activity section
Body: Now you can view who created a dashboard, who last updated it, and when. You’ll also have access to stats about the views on this dashboard in the last 90 days.

@florent-leborgne
Copy link
Contributor

@andreadelrio What do you think of something a bit shorter like this?:

View dashboard activity

The dashboard details now include more information about its creation, last edit, and usage statistics over the last 90 days.

@andreadelrio
Copy link
Contributor

@andreadelrio What do you think of something a bit shorter like this?:

View dashboard activity

The dashboard details now include more information about its creation, last edit, and usage statistics over the last 90 days.

I really like this! thanks @florent-leborgne !

Copy link
Contributor

@nickofthyme nickofthyme left a comment

Choose a reason for hiding this comment

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

Charts code looks generally great, just a few suggestions.

Copy link
Member

@tsullivan tsullivan left a comment

Choose a reason for hiding this comment

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

LGTM

@andreadelrio andreadelrio self-assigned this Aug 19, 2024
@Dosant
Copy link
Contributor Author

Dosant commented Aug 20, 2024

@andreadelrio, here is a poc how it would look like
Screenshot 2024-08-20 at 16 54 40

The thing with the tour is that we usually remember the "seen" state in local storage and I am afraid that this one could be a bit too intrusive for how not important it is with the risk of being shown again if the user cleans or changes the browser, or changes the deployment.
It also will have to be done in a bit hacky way because I don't want to change how actions in the table are registered. Might be a large change otherwise

I wonder if highlighting the feature with screenshots in the release note could be enough here? I'd suggest reconsidering or at least doing it in a separate pr

@Dosant
Copy link
Contributor Author

Dosant commented Aug 20, 2024

@elasticmachine merge upstream

@Dosant
Copy link
Contributor Author

Dosant commented Aug 20, 2024

@elasticmachine merge upstream

@andreadelrio
Copy link
Contributor

@andreadelrio, here is a poc how it would look like Screenshot 2024-08-20 at 16 54 40

The thing with the tour is that we usually remember the "seen" state in local storage and I am afraid that this one could be a bit too intrusive for how not important it is with the risk of being shown again if the user cleans or changes the browser, or changes the deployment. It also will have to be done in a bit hacky way because I don't want to change how actions in the table are registered. Might be a large change otherwise

I wonder if highlighting the feature with screenshots in the release note could be enough here? I'd suggest reconsidering or at least doing it in a separate pr

@teresaalvarezsoler can you weigh in on how to proceed? I'm personally not sure this warrants a Tour (even it is a single-step tour).

@teresaalvarezsoler
Copy link

@andreadelrio, here is a poc how it would look like Screenshot 2024-08-20 at 16 54 40
The thing with the tour is that we usually remember the "seen" state in local storage and I am afraid that this one could be a bit too intrusive for how not important it is with the risk of being shown again if the user cleans or changes the browser, or changes the deployment. It also will have to be done in a bit hacky way because I don't want to change how actions in the table are registered. Might be a large change otherwise
I wonder if highlighting the feature with screenshots in the release note could be enough here? I'd suggest reconsidering or at least doing it in a separate pr

@teresaalvarezsoler can you weigh in on how to proceed? I'm personally not sure this warrants a Tour (even it is a single-step tour).

Ok, I thought this might be much more simpler. Let's not do this then. I hope users will find it through other means.

@Dosant
Copy link
Contributor Author

Dosant commented Aug 21, 2024

@elasticmachine merge upstream

@elasticmachine
Copy link
Contributor

expected head sha didn’t match current head ref.

@Dosant
Copy link
Contributor Author

Dosant commented Aug 21, 2024

buildkite test this

@Dosant Dosant force-pushed the d/2024-07-10-kbn-usage-counter-dashboard-poc branch from f28f91d to 2238ac4 Compare August 21, 2024 14:34
@Dosant Dosant enabled auto-merge (squash) August 21, 2024 15:18
@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
dashboard 628 637 +9
eventAnnotationListing 633 641 +8
filesManagement 183 191 +8
graph 292 300 +8
maps 1226 1234 +8
visualizations 458 466 +8
total +49

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/content-management-content-insights-public - 28 +28
@kbn/content-management-content-insights-server - 6 +6
total +34

Async chunks

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

id before after diff
dashboard 542.2KB 546.7KB +4.5KB
eventAnnotationListing 309.5KB 312.0KB +2.6KB
filesManagement 117.9KB 120.5KB +2.6KB
graph 410.5KB 413.1KB +2.6KB
maps 3.0MB 3.0MB +2.6KB
visualizations 299.5KB 302.1KB +2.6KB
total +17.4KB

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
@kbn/content-management-content-insights-server - 2 +2
usageCollection 4 5 +1
total +3

Page load bundle

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

id before after diff
dashboard 43.3KB 43.3KB +57.0B
eventAnnotationListing 11.0KB 11.0KB +57.0B
graph 8.0KB 8.0KB +57.0B
maps 54.3KB 54.4KB +57.0B
visualizations 63.4KB 63.5KB +57.0B
total +285.0B
Unknown metric groups

API count

id before after diff
@kbn/content-management-content-insights-public - 32 +32
@kbn/content-management-content-insights-server - 9 +9
@kbn/content-management-table-list-view-table 50 51 +1
usageCollection 51 52 +1
total +43

ESLint disabled line counts

id before after diff
@kbn/content-management-content-insights-public - 1 +1

Total ESLint disabled count

id before after diff
@kbn/content-management-content-insights-public - 1 +1

History

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

cc @andreadelrio

@Dosant Dosant merged commit 64e1116 into elastic:main Aug 21, 2024
38 checks passed
@kibanamachine kibanamachine added v8.16.0 backport:skip This commit does not require backporting labels Aug 21, 2024
Dosant added a commit that referenced this pull request Aug 29, 2024
## Summary

Follow up to #187993
Fix missing features in serverless API integration tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:enhancement Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience) v8.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[SharedUX] Dashboard engagement metrics