-
Notifications
You must be signed in to change notification settings - Fork 16
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
Update Telemetry for Public Preview in MSAZ #251
Conversation
b2415bf
to
7f07524
Compare
Please search for "\todo telemetry" in the code base. We need telemetry for those too. Also please sync this branch before you make any further changes, because I have rebased it with the main branch. |
3fd8b1f
to
2e181bd
Compare
@daxian-dbw Thanks for comments~ Addressed all of them now. Please help review again when you get a chance. |
telemetry for msaz Remove unneeded changes to `CopilotResponse` Address Comments Minor fix set json serializer option
94ed1c4
to
d7a00ce
Compare
{ | ||
string azureConfigDir = Environment.GetEnvironmentVariable("AZURE_CONFIG_DIR"); | ||
string userProfile = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); | ||
string userProfilePath = Path.Combine(string.IsNullOrEmpty(azureConfigDir) ? userProfile : azureConfigDir, "azureProfile.json"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have the env variable AZURE_CONFIG_DIR
defined, and also don't have either the file C:\Users\dongbow\azureProfile.json
or the file C:\Users\dongbow\AzureRmContextSettings.json
. Are you sure we should look at those files and they are the right paths?
Also, we are using AzCLI login token today and the Az PowerShell login token doesn't work. In this case, aren't we supposed to use the AzCLI profile instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I made stupid mistakes here for the first issue. Please try again!!
Azure CLI and Azure PS share the same installation id. File azureconfig.json
contains the id generated by AzCLI Installation, and AzureRmContextSettings.json
is generated by AzPS Installation. If we are supposed to support Az PowerShell as individual dependency when in the future the login token is good, we can keep current code.
{ | ||
try | ||
{ | ||
Path.Combine(string.IsNullOrEmpty(azureConfigDir) ? userProfile : azureConfigDir, "AzureRmContextSettings.json"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You didn't assign this value to anything ...
You got to review your own changes before pushing a commit.
{ | ||
string azureConfigDir = Environment.GetEnvironmentVariable("AZURE_CONFIG_DIR"); | ||
string userProfile = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); | ||
string userProfilePath = string.IsNullOrEmpty(azureConfigDir) ? Path.Combine(userProfile, ".Azure", "azureProfile.json") : azureConfigDir; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still wrong:
- The folder is
.azure
, all in lower case..Azure
will not work on non-windows. - When
azureConfigDir
is set,userProfilePath
will be set to that folder, not to a file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have rewritten this piece.
{ | ||
try | ||
{ | ||
userProfilePath = string.IsNullOrEmpty(azureConfigDir) ? Path.Combine(userProfile, ".Azure", "AzureRmContextSettings.json") : azureConfigDir; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here. When azureConfigDir
is set, userProfilePath
will be set to that folder, not to a file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have rewritten this piece.
}; | ||
|
||
_telemetryClient.TrackTrace("AIShell", telemetryEvent); | ||
if (e != null) { _telemetryClient.TrackException(e); } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do you corelate the exception e
with the telemetryEvent
?
Also, we shouldn't call Flush
per every telemetry event, see https://devblogs.microsoft.com/premier-developer/application-insights-use-case-for-telemetryclient-flush-calls/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have fixed it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@NoriZC Things seem to be working in my manual tests. Can you please review all the change and also do your testing on the telemetry? Thanks
[Update] I need to have this PR merged to unblock the changes about plugin-store. But please do test the changes on your side to make sure the telemetries are captured as expected. If anything doesn't work, please submit and PR and let me know. Thanks
PR Summary
PR Context