mirror of
https://github.com/microsoft/terminal.git
synced 2025-12-10 17:53:06 -06:00
Add branding and unpackaged metadata to a few telemetry events (#18926)
Adds branding and distribution metadata to the following telemetry events: - ActionDispatched (branding only) - JsonSettingsChanged - UISettingsChanged - SessionBecameInteractive Also removes the settings logger output from the debugger and some leftover debugging functions. Adds a label to the XSettingsChanged settings value to make it easier to read on the backend. (cherry picked from commit b50eaa19e0cfa396d40d2359c1b64e73e2d6af4f) Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgaj8x8 Service-Version: 1.22
This commit is contained in:
parent
32e69d7163
commit
e21b2c6643
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
#include "ShortcutActionDispatch.h"
|
#include "ShortcutActionDispatch.h"
|
||||||
|
#include "WtExeUtils.h"
|
||||||
|
|
||||||
#include "ShortcutActionDispatch.g.cpp"
|
#include "ShortcutActionDispatch.g.cpp"
|
||||||
|
|
||||||
@ -53,11 +54,22 @@ namespace winrt::TerminalApp::implementation
|
|||||||
|
|
||||||
if (handled)
|
if (handled)
|
||||||
{
|
{
|
||||||
|
#if defined(WT_BRANDING_RELEASE)
|
||||||
|
constexpr uint8_t branding = 3;
|
||||||
|
#elif defined(WT_BRANDING_PREVIEW)
|
||||||
|
constexpr uint8_t branding = 2;
|
||||||
|
#elif defined(WT_BRANDING_CANARY)
|
||||||
|
constexpr uint8_t branding = 1;
|
||||||
|
#else
|
||||||
|
constexpr uint8_t branding = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
TraceLoggingWrite(
|
TraceLoggingWrite(
|
||||||
g_hTerminalAppProvider,
|
g_hTerminalAppProvider,
|
||||||
"ActionDispatched",
|
"ActionDispatched",
|
||||||
TraceLoggingDescription("Event emitted when an action was successfully performed"),
|
TraceLoggingDescription("Event emitted when an action was successfully performed"),
|
||||||
TraceLoggingValue(static_cast<int>(actionAndArgs.Action()), "Action"),
|
TraceLoggingValue(static_cast<int>(actionAndArgs.Action()), "Action"),
|
||||||
|
TraceLoggingValue(branding, "Branding"),
|
||||||
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES),
|
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES),
|
||||||
TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage));
|
TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,6 +27,7 @@
|
|||||||
#include "ProfileEntry.h"
|
#include "ProfileEntry.h"
|
||||||
#include "FolderEntry.h"
|
#include "FolderEntry.h"
|
||||||
#include "MatchProfilesEntry.h"
|
#include "MatchProfilesEntry.h"
|
||||||
|
#include "WtExeUtils.h"
|
||||||
|
|
||||||
using namespace winrt::Windows::Foundation::Collections;
|
using namespace winrt::Windows::Foundation::Collections;
|
||||||
using namespace winrt::Windows::ApplicationModel::AppExtensions;
|
using namespace winrt::Windows::ApplicationModel::AppExtensions;
|
||||||
@ -1668,10 +1669,22 @@ void CascadiaSettings::LogSettingChanges(bool isJsonLoad) const
|
|||||||
changes.insert(change);
|
changes.insert(change);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(WT_BRANDING_RELEASE)
|
||||||
|
constexpr uint8_t branding = 3;
|
||||||
|
#elif defined(WT_BRANDING_PREVIEW)
|
||||||
|
constexpr uint8_t branding = 2;
|
||||||
|
#elif defined(WT_BRANDING_CANARY)
|
||||||
|
constexpr uint8_t branding = 1;
|
||||||
|
#else
|
||||||
|
constexpr uint8_t branding = 0;
|
||||||
|
#endif
|
||||||
|
const uint8_t distribution = IsPackaged() ? 2 :
|
||||||
|
IsPortableMode() ? 1 :
|
||||||
|
0;
|
||||||
|
|
||||||
// report changes
|
// report changes
|
||||||
for (const auto& change : changes)
|
for (const auto& change : changes)
|
||||||
{
|
{
|
||||||
#ifndef _DEBUG
|
|
||||||
// A `isJsonLoad ? "JsonSettingsChanged" : "UISettingsChanged"`
|
// A `isJsonLoad ? "JsonSettingsChanged" : "UISettingsChanged"`
|
||||||
// would be nice, but that apparently isn't allowed in the macro below.
|
// would be nice, but that apparently isn't allowed in the macro below.
|
||||||
// Also, there's guidance to not send too much data all in one event,
|
// Also, there's guidance to not send too much data all in one event,
|
||||||
@ -1681,7 +1694,9 @@ void CascadiaSettings::LogSettingChanges(bool isJsonLoad) const
|
|||||||
TraceLoggingWrite(g_hSettingsModelProvider,
|
TraceLoggingWrite(g_hSettingsModelProvider,
|
||||||
"JsonSettingsChanged",
|
"JsonSettingsChanged",
|
||||||
TraceLoggingDescription("Event emitted when settings.json change"),
|
TraceLoggingDescription("Event emitted when settings.json change"),
|
||||||
TraceLoggingValue(change.data()),
|
TraceLoggingValue(change.data(), "Setting"),
|
||||||
|
TraceLoggingValue(branding, "Branding"),
|
||||||
|
TraceLoggingValue(distribution, "Distribution"),
|
||||||
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES),
|
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES),
|
||||||
TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage));
|
TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage));
|
||||||
}
|
}
|
||||||
@ -1690,14 +1705,11 @@ void CascadiaSettings::LogSettingChanges(bool isJsonLoad) const
|
|||||||
TraceLoggingWrite(g_hSettingsModelProvider,
|
TraceLoggingWrite(g_hSettingsModelProvider,
|
||||||
"UISettingsChanged",
|
"UISettingsChanged",
|
||||||
TraceLoggingDescription("Event emitted when settings change via the UI"),
|
TraceLoggingDescription("Event emitted when settings change via the UI"),
|
||||||
TraceLoggingValue(change.data()),
|
TraceLoggingValue(change.data(), "Setting"),
|
||||||
|
TraceLoggingValue(branding, "Branding"),
|
||||||
|
TraceLoggingValue(distribution, "Distribution"),
|
||||||
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES),
|
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES),
|
||||||
TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage));
|
TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage));
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
OutputDebugStringA(isJsonLoad ? "JsonSettingsChanged - " : "UISettingsChanged - ");
|
|
||||||
OutputDebugStringA(change.data());
|
|
||||||
OutputDebugStringA("\n");
|
|
||||||
#endif // !_DEBUG
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -195,10 +195,25 @@ int WindowThread::_messagePump()
|
|||||||
|
|
||||||
if (!_loggedInteraction && (message.message == WM_KEYDOWN || message.message == WM_SYSKEYDOWN))
|
if (!_loggedInteraction && (message.message == WM_KEYDOWN || message.message == WM_SYSKEYDOWN))
|
||||||
{
|
{
|
||||||
|
#if defined(WT_BRANDING_RELEASE)
|
||||||
|
constexpr uint8_t branding = 3;
|
||||||
|
#elif defined(WT_BRANDING_PREVIEW)
|
||||||
|
constexpr uint8_t branding = 2;
|
||||||
|
#elif defined(WT_BRANDING_CANARY)
|
||||||
|
constexpr uint8_t branding = 1;
|
||||||
|
#else
|
||||||
|
constexpr uint8_t branding = 0;
|
||||||
|
#endif
|
||||||
|
const uint8_t distribution = IsPackaged() ? 2 :
|
||||||
|
_appLogic.Settings().IsPortableMode() ? 1 :
|
||||||
|
0;
|
||||||
|
|
||||||
TraceLoggingWrite(
|
TraceLoggingWrite(
|
||||||
g_hWindowsTerminalProvider,
|
g_hWindowsTerminalProvider,
|
||||||
"SessionBecameInteractive",
|
"SessionBecameInteractive",
|
||||||
TraceLoggingDescription("Event emitted when the session was interacted with"),
|
TraceLoggingDescription("Event emitted when the session was interacted with"),
|
||||||
|
TraceLoggingValue(branding, "Branding"),
|
||||||
|
TraceLoggingValue(distribution, "Distribution"),
|
||||||
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES),
|
TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES),
|
||||||
TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage));
|
TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage));
|
||||||
_loggedInteraction = true;
|
_loggedInteraction = true;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user