Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upLakshanf/issue2066/telemetry #2145
Conversation
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
dnfclas
Mar 30, 2016
Hi @LakshanF, I'm your friendly neighborhood .NET Foundation Pull Request Bot (You can call me DNFBOT). Thanks for your contribution!
You've already signed the contribution license agreement. Thanks!
The agreement was validated by .NET Foundation and real humans are currently evaluating your PR.
TTYL, DNFBOT;
dnfclas
commented
Mar 30, 2016
|
Hi @LakshanF, I'm your friendly neighborhood .NET Foundation Pull Request Bot (You can call me DNFBOT). Thanks for your contribution! The agreement was validated by .NET Foundation and real humans are currently evaluating your PR. TTYL, DNFBOT; |
leecow
added
the
in progress
label
Mar 30, 2016
dnfclas
added
the
cla-already-signed
label
Mar 30, 2016
livarcocc
reviewed
Mar 31, 2016
| public Telemetry() | ||
| { | ||
| if (_isInitialized) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
livarcocc
reviewed
Mar 31, 2016
| bool optout = Env.GetEnvironmentVariableAsBool(TelemetryOptout); | ||
| if (optout) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
livarcocc
reviewed
Mar 31, 2016
| public void TrackCommand(string command, IDictionary<string, string> properties = null, IDictionary<string, double> measurements = null) | ||
| { | ||
| if (!_isInitialized) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
livarcocc
reviewed
Mar 31, 2016
| Dictionary<string, double> eventMeasurements = new Dictionary<string, double>(_commonMeasurements); | ||
| if (measurements != null) | ||
| { | ||
| foreach (var m in measurements) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
livarcocc
Mar 31, 2016
Member
change the name of m to measurement. There is no need to use these short variable names here.
livarcocc
Mar 31, 2016
Member
change the name of m to measurement. There is no need to use these short variable names here.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
livarcocc
reviewed
Mar 31, 2016
| { | ||
| foreach (var m in measurements) | ||
| { | ||
| if (eventMeasurements.ContainsKey(m.Key)) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
livarcocc
reviewed
Mar 31, 2016
| Dictionary<string, string> eventProperties = new Dictionary<string, string>(_commonProperties); | ||
| if (properties != null) | ||
| { | ||
| foreach (var p in properties) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
livarcocc
reviewed
Mar 31, 2016
| { | ||
| foreach (var p in properties) | ||
| { | ||
| if (eventProperties.ContainsKey(p.Key)) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
livarcocc
reviewed
Mar 31, 2016
| namespace Microsoft.DotNet.Cli.Utils | ||
| { | ||
| public class Telemetry |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
livarcocc
Mar 31, 2016
Member
Can you add an ITelemetry interface with the TrackCommand method and then use that in the dotnet Program? Then you can write a unit test that verifies that TrackCommand is being called with the appropriate parameters.
livarcocc
Mar 31, 2016
Member
Can you add an ITelemetry interface with the TrackCommand method and then use that in the dotnet Program? Then you can write a unit test that verifies that TrackCommand is being called with the appropriate parameters.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
eerhardt
reviewed
Apr 4, 2016
| @@ -45,7 +44,7 @@ public static int Main(string[] args) | ||
| } | ||
| private static int ProcessArgs(string[] args) | ||
| public int ProcessArgs(string[] args, ITelemetry telemetryClient) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
eerhardt
Apr 4, 2016
Member
Looks like it is public so it can be unit tested. How about using InternalsVisibleTo instead?
eerhardt
Apr 4, 2016
Member
Looks like it is public so it can be unit tested. How about using InternalsVisibleTo instead?
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
danquirk
Apr 5, 2016
Collaborator
Added InternalsVisibleTo but still verifying whether I did it correctly.
danquirk
Apr 5, 2016
Collaborator
Added InternalsVisibleTo but still verifying whether I did it correctly.
eerhardt
reviewed
Apr 4, 2016
| @@ -121,22 +120,39 @@ private static int ProcessArgs(string[] args) | ||
| ["test"] = TestCommand.Run | ||
| }; | ||
| int exitCode; | ||
| var arguments = string.Empty; |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
danquirk
Apr 4, 2016
Collaborator
correct, it was being passed to TrackEvent but now we're giving that no information on arguments so it's never used. We could delete this code but it's going to need to be re-added shortly after we figure out the correct scrubbing of argument values for PII. I could leave it there and add a comment on the TrackEvent call to this effect or I could just delete this stuff if you prefer.
danquirk
Apr 4, 2016
Collaborator
correct, it was being passed to TrackEvent but now we're giving that no information on arguments so it's never used. We could delete this code but it's going to need to be re-added shortly after we figure out the correct scrubbing of argument values for PII. I could leave it there and add a comment on the TrackEvent call to this effect or I could just delete this stuff if you prefer.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
eerhardt
Apr 4, 2016
Member
I'd prefer to just remove it for now. Add it back when it is needed/used.
eerhardt
Apr 4, 2016
Member
I'd prefer to just remove it for now. Add it back when it is needed/used.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
MichaelSimons
reviewed
Apr 4, 2016
| private static TelemetryClient _client = null; | ||
| private static Dictionary<string, string> _commonProperties = null; | ||
| private static Dictionary<string, double> _commonMeasurements = null; |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
MichaelSimons
Apr 4, 2016
Contributor
I am not seeing the point of having _isInitialized, _client, _commonProperties, and _commonMeasurements be static. The appear to be initialized each time the ctor is called and only referenced by instance members. Seems like this code would be holding references unnecessarily and prevent GC.
MichaelSimons
Apr 4, 2016
Contributor
I am not seeing the point of having _isInitialized, _client, _commonProperties, and _commonMeasurements be static. The appear to be initialized each time the ctor is called and only referenced by instance members. Seems like this code would be holding references unnecessarily and prevent GC.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
danquirk
Apr 4, 2016
Collaborator
Done, I think you're right, will change them to instance variables. The Telemetry class is functionally a singleton anyway so there aren't any savings from the statics.
danquirk
Apr 4, 2016
Collaborator
Done, I think you're right, will change them to instance variables. The Telemetry class is functionally a singleton anyway so there aren't any savings from the statics.
MichaelSimons
reviewed
Apr 4, 2016
| catch (Exception) | ||
| { | ||
| // we dont want to fail the tool if telemetry fais. We should be able to detect abnormalities from data | ||
| // at the server end |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
MichaelSimons
Apr 4, 2016
Contributor
I made a comment in the previous pull request that I didn't see a response on. "I agree with you that this should not fail and have a negative effect on what the end user is trying to achieve. That being said, do you think it would make sense to Debug.Fail or something like that so that there is a better chance issues will be caught during development in case something is wrong?"
MichaelSimons
Apr 4, 2016
Contributor
I made a comment in the previous pull request that I didn't see a response on. "I agree with you that this should not fail and have a negative effect on what the end user is trying to achieve. That being said, do you think it would make sense to Debug.Fail or something like that so that there is a better chance issues will be caught during development in case something is wrong?"
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
danquirk
Apr 4, 2016
Collaborator
Added a simple log statement with Debug.Fail here and to the other empty catch block
danquirk
Apr 4, 2016
Collaborator
Added a simple log statement with Debug.Fail here and to the other empty catch block
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
MichaelSimons
Apr 5, 2016
Contributor
Consider including the originating Exception in the message to make diagnostics easier.
MichaelSimons
Apr 5, 2016
Contributor
Consider including the originating Exception in the message to make diagnostics easier.
MichaelSimons
reviewed
Apr 4, 2016
| private Dictionary<string, string> GetEventProperties(IDictionary<string, string> properties) | ||
| { | ||
| Dictionary<string, string> eventProperties = new Dictionary<string, string>(_commonProperties); |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
MichaelSimons
Apr 4, 2016
Contributor
Is it necessary to declare the new dictionary in the case when no additional properties are specified? It seems heavy handed to be declaring and coping the commonProperties in this case. If I read the code correctly, this is the only code path that is exercised currently.
MichaelSimons
Apr 4, 2016
Contributor
Is it necessary to declare the new dictionary in the case when no additional properties are specified? It seems heavy handed to be declaring and coping the commonProperties in this case. If I read the code correctly, this is the only code path that is exercised currently.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
danquirk
Apr 4, 2016
Collaborator
Makes sense. Now just returns _commonProperties when properties is null, avoiding the allocation.
danquirk
Apr 4, 2016
Collaborator
Makes sense. Now just returns _commonProperties when properties is null, avoiding the allocation.
and others
added some commits
Mar 25, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
danquirk
Apr 5, 2016
Collaborator
Did a force push after rebasing as requested. Letting the CI server do its thing now.
|
Did a force push after rebasing as requested. Letting the CI server do its thing now. |
eerhardt
reviewed
Apr 5, 2016
| @@ -44,7 +43,7 @@ public static int Main(string[] args) | ||
| } | ||
| private static int ProcessArgs(string[] args) | ||
| internal int ProcessArgs(string[] args, ITelemetry telemetryClient) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
eerhardt
reviewed
Apr 5, 2016
| @@ -0,0 +1,3 @@ | ||
| using System.Runtime.CompilerServices; | ||
| [assembly: InternalsVisibleTo("dotnet.Tests")] |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
danquirk
Apr 5, 2016
Collaborator
Hm, wasn't sure, trying to run it locally now. I thought you only needed that if the target assembly was strong name signed and sn said this one wasn't. I'm probably wrong though.
Edit: looks like the CI server was happy without it
danquirk
Apr 5, 2016
Collaborator
Hm, wasn't sure, trying to run it locally now. I thought you only needed that if the target assembly was strong name signed and sn said this one wasn't. I'm probably wrong though.
Edit: looks like the CI server was happy without it
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
danquirk
Apr 5, 2016
Collaborator
What's with the Ubuntu x64 Debug Build failure? The results don't make much sense to me.
|
What's with the Ubuntu x64 Debug Build failure? The results don't make much sense to me. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
@dotnet-bot test Ubuntu x64 Debug Build |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Different set of CI failures with the last push =\ |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
eerhardt
Apr 5, 2016
Member
@dotnet-bot test RHEL7.2 x64 Release Build
@dotnet-bot test Windows_NT x86 Debug Build
|
@dotnet-bot test RHEL7.2 x64 Release Build |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
danquirk
Apr 5, 2016
Collaborator
@brthor do I still need that? The Windows build didn't fail on my previous push. Looks like you guys are used to some flakiness? Just wanted to make sure we didn't introduce anything new.
|
@brthor do I still need that? The Windows build didn't fail on my previous push. Looks like you guys are used to some flakiness? Just wanted to make sure we didn't introduce anything new. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
brthor
Apr 5, 2016
Contributor
@danquirk You don't need it, but it will remove the flakiness. I'll make a separate PR if you don't pick it up here.
|
@danquirk You don't need it, but it will remove the flakiness. I'll make a separate PR if you don't pick it up here. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
danquirk
Apr 6, 2016
Collaborator
Ok, I'm gonna wait to see what shakes out with release processes and whether I need to merge some of these PRs together. If I do that's probably a good time to cherry pick that. Otherwise I want to make sure this PR continues to look green for anyone looking to sign off.
|
Ok, I'm gonna wait to see what shakes out with release processes and whether I need to merge some of these PRs together. If I do that's probably a good time to cherry pick that. Otherwise I want to make sure this PR continues to look green for anyone looking to sign off. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
eerhardt
Apr 6, 2016
Member
@danquirk - I wouldn't mess around trying to merge them together. I would just merge all 3 PRs at the same time. Trying to cherry pick the changes into 1 PR is prone to errors. We have 3 separate PRs all green. Just go through each one and merge.
I've already signed off, but I will again. ![]()
|
@danquirk - I wouldn't mess around trying to merge them together. I would just merge all 3 PRs at the same time. Trying to cherry pick the changes into 1 PR is prone to errors. We have 3 separate PRs all green. Just go through each one and merge. I've already signed off, but I will again. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
danquirk
Apr 6, 2016
Collaborator
Yes I definitely agree but it is not up to me :) Waiting to hear exactly how to proceed.
|
Yes I definitely agree but it is not up to me :) Waiting to hear exactly how to proceed. |
eerhardt
merged commit 965547b
into
rel/1.0.0
Apr 6, 2016
7 checks passed
leecow
removed
the
in progress
label
Apr 6, 2016
TheRealPiotrP
deleted the
lakshanf/issue2066/telemetry
branch
Apr 6, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
guardrex
Apr 8, 2016
Contributor
I don't like the automatic "opt in" policy for this data sharing. I think you should ask the user with a checkbox in the MSI installer in addition to honoring the env var.
With regard to setting the env var, I just want to make it clear to others who stumble on to this (and it should have been in the Annoncements btw) ... set the value of DOTNET_CLI_TELEMETRY_OPTOUT to any of true, 1, or yes in order to opt-out.
|
I don't like the automatic "opt in" policy for this data sharing. I think you should ask the user with a checkbox in the MSI installer in addition to honoring the env var. With regard to setting the env var, I just want to make it clear to others who stumble on to this (and it should have been in the Annoncements btw) ... set the value of |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
guardrex
Apr 8, 2016
Contributor
... and I have to ask: Does this apply to servers where the shared framework is installed? The dotnet command will be run on servers, too.
|
... and I have to ask: Does this apply to servers where the shared framework is installed? The |
ghost
referenced this pull request
May 18, 2016
Closed
.NET core should not SPY on users by default #3093
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ghost
May 18, 2016
Very bad idea. This hidden "feature" will scare away users and developers. Must be disabled by default!
ghost
commented
May 18, 2016
|
Very bad idea. This hidden "feature" will scare away users and developers. Must be disabled by default! |
LakshanF commentedMar 30, 2016
.NET Core Tools Telemetry collection
Overview
In RC2 of the command line tools, we've started collecting usage telemetry. We've made this choice in order to help us better understand the usage patterns of the CLI tools, and will thus allow us to see which parts of the CLI should be improved first
The data collected will not have any personal data, such as usernames or emails or anything that can be used to identify the actual user. We will also not scan the code and we will not extract any project-level data that can be considered sensitive, such as name, repo or author (if you set those in your
project.json).The data that we collect will be shown publicly in due time. Due time here means when we have enough data to show and when we figure out how to make it accessible.
Behavior
The telemetry tracking is "on" by default.
There is a way to opt-out of the telemetry gathering process by setting an environment variable DOTNET_CLI_TELEMETRY_OPTOUT. Doing this will stop the collection process from running. In order to set the environment variable, please use the existing operating system mechanisms for this (e.g.
exporton OS X/Linux).What do we collect?
We collect the following pieces of data:
Questions, feedback, comments
If you have any questions, feedback or comment, please feel free to leave them either on our issues, in our Gitter channel. If you do file an issue for this, please be sure to tag @blackdwarf and @piotrMSFT so we would get notified.
This change is