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

Add telemetry to Todo #101

Merged
merged 10 commits into from
Sep 7, 2020
Merged

Conversation

larkox
Copy link
Contributor

@larkox larkox commented Jul 22, 2020

Summary

Add telemetry to Todo. The content of the todos is not registered.

Goals:

  • Collect information about user activity so we can prioritize improvements in the Todo plugin
  • Have an understanding of how many users interact with Todo once or multiple times and how many users as a percentage of the total number of seats at the Mattermost deployment use Todo Plugin.

Track:

  • Every command performed (even errors)
  • Every todo added
  • Every todo sent
  • Every todo completed
  • Every todo accepted
  • Every todo removed
  • Every todo bumped
  • Every click on the channel header button
  • Every click on the post action
  • Every click on the collapse-expand button of the lists
  • Every click on the custom post buttons
  • Every click on the "create new todo" button on the RHS
  • Every click on the buttons on the LHS

Ticket Link

None

@larkox larkox added 1: PM Review Requires review by a product manager Awaiting Submitter Action Blocked on the author labels Jul 22, 2020
@larkox larkox requested a review from aaronrothschild July 22, 2020 10:17
@larkox larkox self-assigned this Jul 22, 2020
@larkox larkox removed the Awaiting Submitter Action Blocked on the author label Aug 4, 2020
@codecov-commenter
Copy link

codecov-commenter commented Aug 5, 2020

Codecov Report

Merging #101 into master will decrease coverage by 0.25%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #101      +/-   ##
=========================================
- Coverage    3.81%   3.55%   -0.26%     
=========================================
  Files           9      10       +1     
  Lines         971    1042      +71     
=========================================
  Hits           37      37              
- Misses        933    1004      +71     
  Partials        1       1              
Impacted Files Coverage Δ
server/command.go 11.29% <0.00%> (-0.20%) ⬇️
server/configuration.go 0.00% <0.00%> (ø)
server/plugin.go 0.00% <0.00%> (ø)
server/telemetry.go 0.00% <0.00%> (ø)

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 b2a69b7...b34b25d. Read the comment docs.

Copy link

@aaronrothschild aaronrothschild left a comment

Choose a reason for hiding this comment

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

LGTM.

@aaronrothschild
Copy link

We should update the Telemetry docs to indicate what is tracked for this plugin.

@larkox larkox requested review from mickmister and hanzei August 28, 2020 16:36
@larkox larkox added 2: Dev Review Requires review by a core committer and removed 1: PM Review Requires review by a product manager labels Aug 28, 2020
Copy link
Contributor

@hanzei hanzei left a comment

Choose a reason for hiding this comment

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

LGTM. A few questions bellow, but nothing blocking.

Properties map[string]interface{}
}

func (p *Plugin) handleTelemetry(w http.ResponseWriter, r *http.Request) {
Copy link
Contributor

Choose a reason for hiding this comment

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

IIRC, in the core product the client does the requests the telemetry platform itself. Is is something we should adopt for plugins?

If not, can we move this code into the library as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My point is not sharing the key to the clients (my own concern, probably not a real concern) and to keep one single "source of truth" (the server). Also, it helps to keep some privacy for the clients, since other information (that might be useful or not) like carrier or so that probably is automatically fetched by rudder will not be fetched.

0/5 on whether or how this should be added to the library. We could add the whole handling like we are doing for the settings panel, or we can just add the handleTelemetry function and leave the routing to the plugin.

Choose a reason for hiding this comment

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

Personally, I like it with the server doing the reporting and one less moving part for people to track and more consistent across plugins.

Copy link
Contributor

@hanzei hanzei Sep 3, 2020

Choose a reason for hiding this comment

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

Good points @larkox 👍

Exporting handleTelemetry seams like a good first step until we figured out, what other things we need in the library.

@@ -219,6 +271,7 @@ func (p *Plugin) handleList(w http.ResponseWriter, r *http.Request) {
lt := time.Unix(lastReminderAt/1000, 0).In(timezone)
if nt.Sub(lt).Hours() >= 1 && (nt.Day() != lt.Day() || nt.Month() != lt.Month() || nt.Year() != lt.Year()) {
p.PostBotDM(userID, "Daily Reminder:\n\n"+issuesListToString(issues))
p.trackDailySummary(userID)
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the value we get from tracking this event?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Understanding how many daily summaries are being sent. May allow us to see errors in the code (more than one daily summary per user), or see how active are the users of the plugin.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it makes sense to add this because we now have the user setting to disable the reminders.

server/telemetry.go Outdated Show resolved Hide resolved
server/telemetry.go Show resolved Hide resolved
Copy link
Contributor

@mickmister mickmister left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@mickmister mickmister added 3: QA Review Requires review by a QA tester and removed 2: Dev Review Requires review by a core committer labels Sep 2, 2020
Copy link

@DHaussermann DHaussermann left a comment

Choose a reason for hiding this comment

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

Tested and passed

  • Tested that all events get logged
    • trackSendIssue
    • trackAddIssue
    • trackAcceptIssue
    • trackBumpIssue
    • trackCommand
    • trackCompleteIssue
    • trackRemoveIssue
    • trackFrontend (todo_frontend_rhs_add)
  • Data seems accurate
  • Ensured that plugin works normally when EnableDiagnostic is set to false with no crashes
    LGTM!

@DHaussermann DHaussermann added 4: Reviews Complete All reviewers have approved the pull request and removed 3: QA Review Requires review by a QA tester labels Sep 2, 2020
@hanzei hanzei added this to the v0.4.0 milestone Sep 3, 2020
@larkox larkox merged commit bfa5742 into mattermost-community:master Sep 7, 2020
@larkox larkox mentioned this pull request Sep 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4: Reviews Complete All reviewers have approved the pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants