mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-04 18:26:39 +02:00
Adding privacy event tags to each telemetry event. (#2879)
* Adding privacy event tags to each telemetry event. * Moving Privacy events to Telemetry base, Removing tag values, and fixing namespaces. * Adding documentation comments to fix style cop errors in release * UTCReplace_AppSessionGuid boolean property to all C# telemetry events. * Adding hardcoded version number to boot events. * Adding reference to telemetry in settings unittest * Adding Preview Pane events for loading w/ hardcoded version number * Adding telemetry.h to msi for svg and markdown events * removing unused explicit interface exception
This commit is contained in:
committed by
GitHub
parent
d4b56f99ff
commit
34f814717b
16
src/common/ManagedTelemetry/Telemetry/Events/EventBase.cs
Normal file
16
src/common/ManagedTelemetry/Telemetry/Events/EventBase.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.Tracing;
|
||||
using System.Text;
|
||||
|
||||
namespace Microsoft.PowerToys.Telemetry.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// A base class to implement properties that are common to all telemetry events.
|
||||
/// </summary>
|
||||
[EventData]
|
||||
public class EventBase
|
||||
{
|
||||
public bool UTCReplace_AppSessionGuid => true;
|
||||
}
|
||||
}
|
||||
11
src/common/ManagedTelemetry/Telemetry/Events/IEvent.cs
Normal file
11
src/common/ManagedTelemetry/Telemetry/Events/IEvent.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Microsoft.PowerToys.Telemetry.Events
|
||||
{
|
||||
public interface IEvent
|
||||
{
|
||||
PartA_PrivTags PartA_PrivTags { get; }
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,9 @@
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using Microsoft.PowerToys.Telemetry.Events;
|
||||
using System.Diagnostics.Tracing;
|
||||
using PreviewHandlerCommon.Telemetry;
|
||||
|
||||
|
||||
namespace Microsoft.PowerToys.Telemetry
|
||||
{
|
||||
@@ -12,7 +13,7 @@ namespace Microsoft.PowerToys.Telemetry
|
||||
/// </summary>
|
||||
public class PowerToysTelemetry : TelemetryBase
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Name for ETW event.
|
||||
/// </summary>
|
||||
@@ -34,7 +35,8 @@ namespace Microsoft.PowerToys.Telemetry
|
||||
/// <summary>
|
||||
/// Publishes ETW event when an action is triggered on
|
||||
/// </summary>
|
||||
public void WriteEvent<T>(T telemetryEvent)
|
||||
public void WriteEvent<T>(T telemetryEvent)
|
||||
where T : EventBase, IEvent
|
||||
{
|
||||
this.Write<T>(null, new EventSourceOptions()
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<Platforms>x64</Platforms>
|
||||
|
||||
@@ -4,8 +4,24 @@
|
||||
|
||||
using System.Diagnostics.Tracing;
|
||||
|
||||
namespace PreviewHandlerCommon.Telemetry
|
||||
namespace Microsoft.PowerToys.Telemetry
|
||||
{
|
||||
/// <summary>
|
||||
/// Privacy Tag values
|
||||
/// </summary>
|
||||
public enum PartA_PrivTags
|
||||
: ulong
|
||||
{
|
||||
/// <nodoc/>
|
||||
None = 0,
|
||||
|
||||
/// <nodoc/>
|
||||
ProductAndServicePerformance = 0x0u,
|
||||
|
||||
/// <nodoc/>
|
||||
ProductAndServiceUsage = 0x0u,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Base class for telemetry events.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user