winget-cli

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit fb0db2ae4ef8d9216b2f501edd9a95b66a9ba423
parent 76d92152cb131572a1d5dbbec98e04f33bd2c985
Author: mapill-msft <58245272+mapill-msft@users.noreply.github.com>
Date:   Wed,  8 Apr 2020 13:25:33 -0700

Adding flag to differentiate install from local manifest and normalizing Part C fields in Telemetry. (#82)

* Normalizing Part C fields in Telemetry.

* Adding flag to differentiate local manifest install from source.

* Fixing PR comments.
Diffstat:
Msrc/AppInstallerCLICore/Workflows/WorkflowBase.cpp | 4++--
Msrc/AppInstallerCommonCore/AppInstallerTelemetry.cpp | 23++++++++++++-----------
Msrc/AppInstallerCommonCore/Public/AppInstallerTelemetry.h | 2+-
3 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/src/AppInstallerCLICore/Workflows/WorkflowBase.cpp b/src/AppInstallerCLICore/Workflows/WorkflowBase.cpp @@ -208,7 +208,7 @@ namespace AppInstaller::CLI::Workflow AICLI_TERMINATE_CONTEXT(APPINSTALLER_CLI_ERROR_NO_MANIFEST_FOUND); } - Logging::Telemetry().LogManifestFields(manifest->Id, manifest->Name, manifest->Version); + Logging::Telemetry().LogManifestFields(manifest->Id, manifest->Name, manifest->Version, false); context.Add<Execution::Data::Manifest>(std::move(manifest.value())); } @@ -236,7 +236,7 @@ namespace AppInstaller::CLI::Workflow [](Execution::Context& context) { Manifest::Manifest manifest = Manifest::Manifest::CreateFromPath(context.Args.GetArg(Execution::Args::Type::Manifest)); - Logging::Telemetry().LogManifestFields(manifest.Id, manifest.Name, manifest.Version); + Logging::Telemetry().LogManifestFields(manifest.Id, manifest.Name, manifest.Version, true); context.Add<Execution::Data::Manifest>(std::move(manifest)); }; } diff --git a/src/AppInstallerCommonCore/AppInstallerTelemetry.cpp b/src/AppInstallerCommonCore/AppInstallerTelemetry.cpp @@ -73,13 +73,13 @@ namespace AppInstaller::Logging "FailureInfo", GetActivityId(), nullptr, - TraceLoggingHResult(failure.hr, "hr"), - TraceLoggingWideString(failure.pszMessage, "message"), - TraceLoggingString(failure.pszModule, "module"), - TraceLoggingUInt32(failure.threadId, "threadId"), - TraceLoggingUInt32(static_cast<uint32_t>(failure.type), "type"), - TraceLoggingString(failure.pszFile, "file"), - TraceLoggingUInt32(failure.uLineNumber, "line"), + TraceLoggingHResult(failure.hr, "HResult"), + TraceLoggingWideString(failure.pszMessage, "Message"), + TraceLoggingString(failure.pszModule, "Module"), + TraceLoggingUInt32(failure.threadId, "ThreadId"), + TraceLoggingUInt32(static_cast<uint32_t>(failure.type), "Type"), + TraceLoggingString(failure.pszFile, "File"), + TraceLoggingUInt32(failure.uLineNumber, "Line"), TelemetryPrivacyDataTag(PDT_ProductAndServicePerformance), TraceLoggingKeyword(MICROSOFT_KEYWORD_CRITICAL_DATA)); } @@ -103,7 +103,7 @@ namespace AppInstaller::Logging GetActivityId(), nullptr, TraceLoggingCountedString(version.c_str(), static_cast<ULONG>(version.size()), "Version"), - TraceLoggingWideString(GetCommandLineW(), "commandlineargs"), + TraceLoggingWideString(GetCommandLineW(), "CommandlineArgs"), TelemetryPrivacyDataTag(PDT_ProductAndServicePerformance|PDT_ProductAndServiceUsage), TraceLoggingKeyword(MICROSOFT_KEYWORD_CRITICAL_DATA)); } @@ -151,7 +151,7 @@ namespace AppInstaller::Logging "CommandTermination", GetActivityId(), nullptr, - TraceLoggingHResult(hr, "hr"), + TraceLoggingHResult(hr, "HResult"), AICLI_TraceLoggingStringView(file, "File"), TraceLoggingUInt64(static_cast<UINT64>(line), "Line"), TelemetryPrivacyDataTag(PDT_ProductAndServicePerformance), @@ -179,7 +179,7 @@ namespace AppInstaller::Logging AICLI_LOG(CLI, Error, << "Caught " << type << ": " << message); } - void TelemetryTraceLogger::LogManifestFields(std::string_view id, std::string_view name, std::string_view version) noexcept + void TelemetryTraceLogger::LogManifestFields(std::string_view id, std::string_view name, std::string_view version, bool localManifest) noexcept { if (g_IsTelemetryProviderEnabled) { @@ -190,6 +190,7 @@ namespace AppInstaller::Logging AICLI_TraceLoggingStringView(id, "Id"), AICLI_TraceLoggingStringView(name,"Name"), AICLI_TraceLoggingStringView(version, "Version"), + TraceLoggingBool(localManifest, "IsManifestLocal"), TelemetryPrivacyDataTag(PDT_ProductAndServicePerformance|PDT_ProductAndServiceUsage), TraceLoggingKeyword(MICROSOFT_KEYWORD_CRITICAL_DATA)); } @@ -253,7 +254,7 @@ namespace AppInstaller::Logging GetActivityId(), nullptr, TraceLoggingInt32(arch, "Arch"), - AICLI_TraceLoggingStringView(url, "URL"), + AICLI_TraceLoggingStringView(url, "Url"), AICLI_TraceLoggingStringView(installerType, "InstallerType"), AICLI_TraceLoggingStringView(scope, "Scope"), AICLI_TraceLoggingStringView(language, "Language"), diff --git a/src/AppInstallerCommonCore/Public/AppInstallerTelemetry.h b/src/AppInstallerCommonCore/Public/AppInstallerTelemetry.h @@ -44,7 +44,7 @@ namespace AppInstaller::Logging void LogException(std::string_view commandName, std::string_view type, std::string_view message) noexcept; // Logs the Manifest fields. - void LogManifestFields(std::string_view id, std::string_view name, std::string_view version) noexcept; + void LogManifestFields(std::string_view id, std::string_view name, std::string_view version, bool localManifest) noexcept; // Logs when there is no matching App found for search void LogNoAppMatch() noexcept;