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

[Telemetry] fix bug where uiStatsMetrics is not getting reported #54045

Merged
merged 2 commits into from
Jan 6, 2020

Conversation

Bamieh
Copy link
Member

@Bamieh Bamieh commented Jan 6, 2020

Summary

On kibana 7.6 and 8.0 UI metrics currently does not report the uiStatsMetrics part of the ui metrics report. This is happening due to wrapping the code in an if statement that always resolves to false.

Our test cases dont catch this since we mimic the report object instead of generating it directly from reportManager.assignReports as we do in production.

This PR fixes the bug and the tests to catch any similar cases in the future.

Reference: #52893

@Bamieh Bamieh requested a review from a team January 6, 2020 19:14
@Bamieh Bamieh added the release_note:skip Skip the PR/issue when compiling release notes label Jan 6, 2020
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

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

Copy link
Contributor

@TinaHeiligers TinaHeiligers left a comment

Choose a reason for hiding this comment

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

I reviewed the code and ran this locally with and without the fix.
With this PR, we get the uiStatsMetrics reported and I was able to log out the contents:

In route handler for reporting ui_metrics, report.uiStatsMetrics { 'Kibana_home-loaded-welcomeScreenMount':
   { key: 'Kibana_home-loaded-welcomeScreenMount',
     appName: 'Kibana_home',
     eventName: 'welcomeScreenMount',
     type: 'loaded',
     stats: { min: 0, max: 1, avg: 0.5, sum: 1 } },
  'Kibana_home-click-sampleDataConfirm':
   { key: 'Kibana_home-click-sampleDataConfirm',
     appName: 'Kibana_home',
     eventName: 'sampleDataConfirm',
     type: 'click',
     stats: { min: 0, max: 1, avg: 0.5, sum: 1 } },
  'visualize-click-lens':
   { key: 'visualize-click-lens',
     appName: 'visualize',
     eventName: 'lens',
     type: 'click',
     stats: { min: 0, max: 1, avg: 0.5, sum: 1 } } }
--> report.uiStatsMetrics { 'Kibana_home-loaded-welcomeScreenMount':
   { key: 'Kibana_home-loaded-welcomeScreenMount',
     appName: 'Kibana_home',
     eventName: 'welcomeScreenMount',
     type: 'loaded',
     stats: { min: 0, max: 1, avg: 0.5, sum: 1 } },
  'Kibana_home-click-sampleDataConfirm':
   { key: 'Kibana_home-click-sampleDataConfirm',
     appName: 'Kibana_home',
     eventName: 'sampleDataConfirm',
     type: 'click',
     stats: { min: 0, max: 1, avg: 0.5, sum: 1 } },
  'visualize-click-lens':
   { key: 'visualize-click-lens',
     appName: 'visualize',
     eventName: 'lens',
     type: 'click',
     stats: { min: 0, max: 1, avg: 0.5, sum: 1 } } }

Without the fix (or without running yarn-kbn-bootstrap, report.uiStatsMetrics is undefined

We also see uiStatsMetrics in the payload:
Screen Shot 2020-01-06 at 14 49 35

@Bamieh Bamieh merged commit ecab207 into elastic:master Jan 6, 2020
@Bamieh Bamieh deleted the telemetry/fix_ui_stats branch January 6, 2020 21:58
Bamieh added a commit to Bamieh/kibana that referenced this pull request Jan 6, 2020
…tic#54045)

* fix bug where uiStatsMetrics is not getting reported

* fix tests
@Bamieh Bamieh added the v7.5.2 label Jan 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Telemetry release_note:skip Skip the PR/issue when compiling release notes v7.5.2 v7.6.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants