Skip to content

Manage telemetry opt-in via a dedicated document#22268

Merged
legrego merged 20 commits intoelastic:masterfrom
legrego:telemetry-document
Sep 10, 2018
Merged

Manage telemetry opt-in via a dedicated document#22268
legrego merged 20 commits intoelastic:masterfrom
legrego:telemetry-document

Conversation

@legrego
Copy link
Copy Markdown
Member

@legrego legrego commented Aug 22, 2018

This PR introduces a new telemetry document to the .kibana index. This document replaces the existing xpack:telemetryOptIn UI Setting as the authoritative source of the user's telemetry opt-in preference.

The existing UI setting is marked as readonly, so it will no longer appear in the Advanced UI Settings screen. Instead, this PR adds a new Telemetry Management screen to allow users to adjust their preference, and see an example of the type of information we collect.
Instead, this PR adds a section to the bottom of the Advanced Settings screen to allow users to adjust their preference, and see an example of the type of information we collect.

Latest Screenshot

settings screen with telemetry - take 2

Outdated Screenshot 2

settings screen with telemetry

Outdated Screenshot 1

telemetry screen

Migration Logic

This adds to the existing handle_old_settings logic, which previously migrated older UI settings to the current xpack:telemetryOptIn setting. I extended this to keep most of that existing logic, but instead of migrating to the UI setting, it will now create the new telemetry document to track their preference (if set):

  1. If the xpack:telemetryOptIn preference has been set, then the new telemetry document is created with that preference.
  2. Otherwise, if the legacy opt-in settings are present, then those are used to determine the value of the new telemetry document.
  3. If none of those settings have been set, then the telemetry document is not created by this migration process.
  4. If the old settings existed, then they are removed after successfully migrating to the new telemetry document. Otherwise, the telemetry document is not created by this migration process, and will instead be created the when the user first opts in.

Fixes #22144

@legrego
Copy link
Copy Markdown
Member Author

legrego commented Aug 23, 2018

@pickypg @chrisronline @kobelb @cchaos @gchaps
I took a stab at what the new telemetry management screen might look like. This is still a WIP, but I'm interested in getting your feedback on what I have so far here. Feel free to tag anyone else who might also have an interest in this.

@kobelb
Copy link
Copy Markdown
Contributor

kobelb commented Aug 23, 2018

My opinion on the design matters very little, but I think it's looks awesome.

@legrego legrego force-pushed the telemetry-document branch from 9037097 to 9bc393f Compare August 23, 2018 17:01
@elastic elastic deleted a comment from elasticmachine Aug 23, 2018
@legrego
Copy link
Copy Markdown
Member Author

legrego commented Aug 23, 2018

jenkins, test this

Copy link
Copy Markdown
Contributor

@cchaos cchaos left a comment

Choose a reason for hiding this comment

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

Just had a couple UI suggestions. Other than those. my one concern would be naming it "Telemetry" as I don't think most users will understand what that term means. I'd definitely get with @gchaps to come up with a better name.

Oh and I noticed you didn't touch this file, but the flyout in opt_in_details_component.js is way too small. Can you just remove the size="s" so it defaults to the medium size? And add the maxWidth prop so it doesn't get too wide on large screens.

/>
</EuiFormRow>
<EuiFormRow hasEmptyLabelSpace={true}>
<EuiLink onClick={this.toggleExample}>See an example of what we collect</EuiLink>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Move this link to be part of the form group description.

<Fragment>
  <p>{CONFIG_TELEMETRY_DESC}</p>
  <p><EuiLink>...</EuiLink></p>
</Fragment>


return (
<EuiPage className="manageTelemetryPage">
<EuiPageBody>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Add restrictWidth prop to EuiPageBody

@@ -0,0 +1,4 @@
.manageTelemetryPage {
background-color: #f5f5f5;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Unnecessary background color because it's already applied via .euiPage

@@ -0,0 +1,4 @@
.manageTelemetryPage {
background-color: #f5f5f5;
min-height: 100vh;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you set the min-height to: min-height: calc(~"100vh - 70px"); This will incorporate the management tabs.

return (
<EuiPage className="manageTelemetryPage">
<EuiPageBody>
<EuiTitle size="l"><h1>Manage Telemetry</h1></EuiTitle>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Lowercase 't' in 'telemetry'

@legrego
Copy link
Copy Markdown
Member Author

legrego commented Aug 23, 2018

Thanks for the review, @cchaos!

Copy link
Copy Markdown
Contributor

@cchaos cchaos left a comment

Choose a reason for hiding this comment

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

Looks great, Thanks!

@elastic elastic deleted a comment from elasticmachine Aug 23, 2018
@elastic elastic deleted a comment from elasticmachine Aug 23, 2018
@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

@gchaps
Copy link
Copy Markdown
Contributor

gchaps commented Aug 23, 2018

My suggestion is that we name the tab "Usage Data" And then use the text shown in this screenshot.

screen shot 2018-08-23 at 12 34 23 pm

I removed the text "Opt-in"

Keep the "Help us improve" paragraph the same as the text on the opening screen. Adding a link to the privacy statement is a good idea.

The text for the toggle button is "Send usage data to Elastic"

@legrego
Copy link
Copy Markdown
Member Author

legrego commented Aug 28, 2018

Following a meeting with @AlonaNadler, @kobelb, @bmcconaghy, and @cchaos, we decided to stay with the current approach of shimming the Usage Data setting into the Advanced UI Settings screen.

We will also shim this setting to respond to the search bar, in a rather forceful way for now. As settings evolve, we may consider a more pluggable or holistic approach.

@elastic elastic deleted a comment from elasticmachine Aug 29, 2018
@elastic elastic deleted a comment from elasticmachine Aug 29, 2018
@elastic elastic deleted a comment from elasticmachine Aug 29, 2018
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Copy link
Copy Markdown
Contributor

@jen-huang jen-huang left a comment

Choose a reason for hiding this comment

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

I'm overall ok with this approach of including telemetry data in Advanced Settings, though I agree it would be nice to make this page extendable in the future. My main areas of concern are the following:

1) Visual difference between a regular setting and telemetry setting:

image

The spacing is not quite the same around the field and description. Functionally, a regular setting has "Save" and "Cancel" buttons to confirm changes, whereas the telemetry setting auto-saves on change.

This could potentially be addressed by exporting the settings' field component (/public/management/sections/settings/components/field/field.js) so it can be used in TelemetryForm. The Field component expects a certain structure for the setting prop, so some data wrangling will be needed, but it accepts a custom save function as a prop, as well as clear.

2) Visibility of telemetry setting is low, since it is at bottom of the page.

Typing a term in the search bar does work for bringing up telemetry, but Usage Data does not appear in the category filter. This could be addressed by using the settings component registry to append additional categories, which advanced_settings.js can retrieve. (I realize this isn't the intended use of the registry however, since it isn't a component! 😄)

Alternatively, PageFooter could be changed to PageHeader instead so that telemetry is the top category. I think it is an important enough setting to warrant a prime location.

I'm sure I'm repeating some thoughts which may have already been discussed, but let me know what you think! 🙂

@legrego
Copy link
Copy Markdown
Member Author

legrego commented Aug 30, 2018

Thanks, @jen-huang! I'll see what I can do to make this more visually and functionally similar to the rest of the settings on the page

@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

@@ -462,30 +462,40 @@ export class Field extends PureComponent {
}

renderDescription(setting) {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Sorry for the whitespace deltas in this file. The important change is here. The description used to always render html (dangerously, I might add), but now it will render a React element if one is provided. If not, then it falls back to the original behavior. I need this so that I can render EuiLinks within the usage data description

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@legrego
Copy link
Copy Markdown
Member Author

legrego commented Aug 31, 2018

@jen-huang I updated the look-and-feel so that it's much closer to the rest of the settings screen. I'm hesitant to add this to the category dropdown right now, but I think it's certainly worthwhile to do if/when we make this page more extensible for other plugins to add entries to this page.

settings screen with telemetry - take 2

@legrego legrego removed the WIP Work in progress label Aug 31, 2018
@legrego
Copy link
Copy Markdown
Member Author

legrego commented Sep 4, 2018

@jen-huang are you available for another review? I'd like to merge this sooner rather than later if possible, to unblock other work for Spaces.

Copy link
Copy Markdown
Contributor

@bmcconaghy bmcconaghy left a comment

Choose a reason for hiding this comment

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

Code LGTM

/**
* Link to the Elastic Telemetry privacy statement.
*/
export const PRIVACY_STATEMENT_URL = `https://www.elastic.co/legal/telemetry-privacy-statement`;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: these don't need to be backticks as it's just a string.

@legrego
Copy link
Copy Markdown
Member Author

legrego commented Sep 7, 2018

retest

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@legrego
Copy link
Copy Markdown
Member Author

legrego commented Sep 10, 2018

6.x/6.5 #22877

legrego added a commit that referenced this pull request Sep 10, 2018
Backports the following commits to 6.x:
 - Manage telemetry opt-in via a dedicated document  (#22268)
@legrego legrego deleted the telemetry-document branch September 18, 2018 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants