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: show collected data under the toggle #8272

Merged
merged 1 commit into from
Feb 21, 2022

Conversation

Pothulapati
Copy link
Contributor

@Pothulapati Pothulapati commented Feb 17, 2022

Description

Currently, The service ping can be disabled by going into the
admin settings. Users are more likely to do that if they have
no clue what is being sent.

This PR tries to improve this experience, by showcasing the
exact data that is being sent below the option. This is possible
by creating a new TelemetryDataProvider and injecting that
both in the installation-admin-collector controller
and the gitpod-service (getTelemetryData func is added here
that can be used).

Related Issue(s)

Fixes #7891

How to test

  1. Run yarn telepresence in /server
  2. Head-over to the admin settings page, and view the new information below the service ping option

Release Notes

Show collected telemetry data below the telemetry toggle

Documentation

@Pothulapati Pothulapati requested a review from a team February 17, 2022 11:21
@github-actions github-actions bot added the team: webapp Issue belongs to the WebApp team label Feb 17, 2022
checked={adminSettings?.sendTelemetry ?? false}
onChange={(evt) => actuallySetTelemetryPrefs({
sendTelemetry: evt.target.checked,
})} />
</PageWithSubMenu>
<InfoBox>{JSON.stringify(telemetryData, null, 2)}</InfoBox>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Haven't done a lot of UI yet, Hence a newbie question. What's the nicest way to display this? 😬

Copy link
Contributor

Choose a reason for hiding this comment

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

As a first step, I would recommend using a pre block.

Suggested change
<InfoBox>{JSON.stringify(telemetryData, null, 2)}</InfoBox>
<InfoBox><pre>{JSON.stringify(telemetryData, null, 2)}</pre></InfoBox>
before after
image image

With this proposed change, in my opinion, it would be sufficient for a first increment (as an MVC/minimal viable change).

For a next iteration, we could think about a toggle that allows collapsing the box. For that, we should ask @gtsiolis for his always terrific input on UX design.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated this to use the pre block, and it already looks way better!

Copy link
Contributor

@gtsiolis gtsiolis Feb 17, 2022

Choose a reason for hiding this comment

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

Hey everyone!

issue: Using the alert component[1][2], also known asInfoBox, feels a bit misleading. Also, including the payload expanded looks a bit verbose and will not scale well in the long run as we add more information encapsulated in the payload. Lastly although a minor issue, the help links pattern (Learn more, Read our Privacy Policy, etc) is used at the end of sentences without any following text. Also, yes using a monospaced font for depicting such information sounds ideal.

suggestion: What do you think of using a modal to encapsulate this information to avoid injecting this kind of verbose information in the dashboard layout?

thought: We could also 🅰️ drop the gray background and default to the white background as well as 🅱️ re-use the cancel action button if that's easier to do in the spirit of MVC (minimum viable change) using the existing modal component[1]. Ideally, in the long run, this could use a markdown component which we could either show under a toggle element or within a modal like the proposal below. 💭

Button Modal
Button Modal

Thanks for the ping @corneliusludmann! 🏓

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for our input, @gtsiolis! I agree with your proposal. 👍

If you agree, I would like to move this part to a new issue and exclude these improvements from this PR for the following reasons:

  • It is functionally working now and I think it's very important that we get this into the February release.
  • For @Pothulapati, it would take some time to get familiar with the modal feature. Moving this into a follow-up PR would give him more time for this without jeopardizing the release (or someone else takes the new issue to implement this improvement—Tarun can decide).

Thus, my proposal would be:

  1. Let's merge this pull request as is.
  2. Move the UX proposals to a new issue and do the work in a follow-up PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@corneliusludmann Your suggestion, makes sense!

Copy link
Contributor

Choose a reason for hiding this comment

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

Took the liberty and created #8300.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks @corneliusludmann for opening the follow up issue. Agree! Re-posting from #8125 (comment):

153608231-bad67564-6781-477d-af76-a57d7cbc047a

@codecov
Copy link

codecov bot commented Feb 17, 2022

Codecov Report

Merging #8272 (b600fdf) into main (5f6114c) will decrease coverage by 1.13%.
The diff coverage is n/a.

❗ Current head b600fdf differs from pull request most recent head 185544a. Consider uploading reports for the commit 185544a to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #8272      +/-   ##
==========================================
- Coverage   12.31%   11.17%   -1.14%     
==========================================
  Files          20       18       -2     
  Lines        1161      993     -168     
==========================================
- Hits          143      111      -32     
+ Misses       1014      880     -134     
+ Partials        4        2       -2     
Flag Coverage Δ
components-gitpod-cli-app 11.17% <ø> (ø)
components-installation-telemetry-app ?
components-local-app-app-darwin-amd64 ?
components-local-app-app-darwin-arm64 ?
components-local-app-app-linux-amd64 ?
components-local-app-app-linux-arm64 ?
components-local-app-app-windows-386 ?
components-local-app-app-windows-amd64 ?
components-local-app-app-windows-arm64 ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
components/local-app/pkg/auth/pkce.go
components/local-app/pkg/auth/auth.go

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5f6114c...185544a. Read the comment docs.

Copy link
Contributor

@corneliusludmann corneliusludmann left a comment

Choose a reason for hiding this comment

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

Thanks for venturing into TypeScript and the depths of Gitpod Server. 🧗 Good work. 🥳 I left a few comments.

components/dashboard/src/admin/Settings.tsx Outdated Show resolved Hide resolved
components/server/src/workspace/gitpod-server-impl.ts Outdated Show resolved Hide resolved
@Pothulapati Pothulapati force-pushed the tar/telemetry-settings-data branch from 4034e46 to 78a1efd Compare February 17, 2022 12:22
@laushinka
Copy link
Contributor

@Pothulapati May I have admin access please? :)

@corneliusludmann
Copy link
Contributor

@Pothulapati @laushinka Gave you both admin access.

@gtsiolis
Copy link
Contributor

gtsiolis commented Feb 18, 2022

Triggered by the comment in #8272 (comment), cross-posting a link to some relevant docs for visibility.

💡 tip: You can give give another user, including your user, admin rights with a one-line command, see relevant docs (internal).

Cc @laushinka @Pothulapati @corneliusludmann

@roboquat roboquat added size/L and removed size/M labels Feb 19, 2022
})();
});

if (!user || !user?.rolesOrPermissions?.includes('admin')) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

After this new gaurd, admin/settings does not open when the user isn't a admin like you'd expect!

@Pothulapati Pothulapati force-pushed the tar/telemetry-settings-data branch from b600fdf to bfddc13 Compare February 21, 2022 10:18
Currently, The service ping can be disabled by going into the
admin settings. Users are more likely to do that if they have
no clue what is being sent.

This PR tries to improve this experience, by showcasing the
exact data that is being sent below the option. This is possible
by creating a new TelemetryDataProvider and injecting that
both in the `installation-admin-collector` controller
and the `gitpod-service` (`getTelemetryData` func is added here
that can be used).

This PR also adds a gaurd to the `/admin/settings` page which
was missing previously

Signed-off-by: Tarun Pothulapati <[email protected]>

replace cluster with gitpod instance in desc

Signed-off-by: Tarun Pothulapati <[email protected]>

easy nits around design and TelemetryData naming

Signed-off-by: Tarun Pothulapati <[email protected]>

gaurd telemetry method with admin access

Signed-off-by: Tarun Pothulapati <[email protected]>

replace TelemetryData at more places

Signed-off-by: Tarun Pothulapati <[email protected]>

gaurd access to `admin/settings` like other admin settings

Signed-off-by: Tarun Pothulapati <[email protected]>

call useEffect hook early

Signed-off-by: Tarun Pothulapati <[email protected]>
@Pothulapati Pothulapati force-pushed the tar/telemetry-settings-data branch from bfddc13 to 185544a Compare February 21, 2022 10:35
@roboquat roboquat merged commit 3be4e0b into main Feb 21, 2022
@roboquat roboquat deleted the tar/telemetry-settings-data branch February 21, 2022 12:12
@gtsiolis gtsiolis mentioned this pull request Mar 9, 2022
@jankeromnes
Copy link
Contributor

jankeromnes commented Mar 31, 2022

FYI, this is what this page currently looks like in staging:

Screenshot 2022-03-31 at 09 21 07

As a user, I find the empty info box slightly confusing/worrying. Is this okay to ship to Self-Hosted customers as is?

@Pothulapati Pothulapati mentioned this pull request Apr 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note size/L team: webapp Issue belongs to the WebApp team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[telemetry] Allow to see a preview of the telemetry data in the admin dashboard
6 participants