Enable SDK to create package for auto-instrumentation (#2365)
* Create downgraded DiagnosticSource version for Redfield * Remove Settings.Designer.cs, created by mistake * Fix tests * Fix tests * Fix tests * Remove hard-coded Redfield property * PR Comments * Rename yml file
This commit is contained in:
Родитель
91e1217eae
Коммит
0c25b41627
|
@ -0,0 +1,39 @@
|
|||
# Syntax: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
|
||||
# .NET CLI: https://docs.microsoft.com/dotnet/core/tools/
|
||||
# Description: The purpose of this build is to build and test with redfield flag.
|
||||
|
||||
name: Redfield Sanity Check
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master, develop ]
|
||||
pull_request:
|
||||
branches: [ master, develop ]
|
||||
|
||||
jobs:
|
||||
build-test:
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
framework: [netcoreapp3.1,net5.0]
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
args: "--filter TestCategory!=WindowsOnly"
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: restore (Base sln)
|
||||
run: dotnet restore ./BASE/Microsoft.ApplicationInsights.sln
|
||||
|
||||
- name: Build
|
||||
run: dotnet build -p:Redfield=True ./BASE/Microsoft.ApplicationInsights.sln --configuration Release --no-restore
|
||||
|
||||
- name: Test
|
||||
id: test1
|
||||
continue-on-error: true
|
||||
run: dotnet test ./BASE/Microsoft.ApplicationInsights.sln --framework ${{ matrix.framework }} --configuration Release --no-build --logger:"console;verbosity=detailed" ${{ matrix.args }}
|
|
@ -14,6 +14,7 @@
|
|||
<SemanticVersionMinor>18</SemanticVersionMinor> <!-- If changing the Minor version, also update the Date value. -->
|
||||
<SemanticVersionPatch>0</SemanticVersionPatch>
|
||||
<PreReleaseMilestone></PreReleaseMilestone> <!--Valid values: beta1, beta2, EMPTY for stable -->
|
||||
<PreReleaseMilestone Condition="'$(Redfield)' == 'True'">redfield</PreReleaseMilestone>
|
||||
<PreReleaseMilestone Condition="'$(NightlyBuild)' == 'True'">nightly</PreReleaseMilestone> <!-- Overwrite this property for nightly builds from the DEVELOP branch. -->
|
||||
<!--
|
||||
Date when Semantic Version was changed.
|
||||
|
|
|
@ -34,8 +34,9 @@
|
|||
var activity = new Activity("test");
|
||||
activity.AddTag("OperationName", "test me 1");
|
||||
activity.AddTag("OperationName", "test me 2");
|
||||
|
||||
#if !REDFIELD
|
||||
Assert.AreEqual("test me 1", activity.GetOperationName());
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
|
@ -22,7 +22,11 @@
|
|||
|
||||
protected override void OnEventSourceCreated(EventSource eventSource)
|
||||
{
|
||||
#if REDFIELD
|
||||
if (string.Equals(eventSource.Name, "Redfield-Microsoft-ApplicationInsights-Core", StringComparison.Ordinal))
|
||||
#else
|
||||
if (string.Equals(eventSource.Name, "Microsoft-ApplicationInsights-Core", StringComparison.Ordinal))
|
||||
#endif
|
||||
{
|
||||
var eventCounterArguments = new Dictionary<string, string>
|
||||
{
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
using Microsoft.ApplicationInsights.TestFramework;
|
||||
using System.Diagnostics.Tracing;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using System.Linq;
|
||||
|
||||
[TestClass]
|
||||
public class CoreEventSourceTest
|
||||
|
@ -25,5 +26,30 @@
|
|||
MethodInfo method = typeof(CoreEventSource).GetMethod(methodName);
|
||||
return method.GetCustomAttribute<EventAttribute>();
|
||||
}
|
||||
|
||||
#if REDFIELD
|
||||
/// <summary>
|
||||
/// This is a sanitiy check.
|
||||
/// The 'Redfield' compilation flag should switch the name of EventSource class.
|
||||
/// Devs can review the test log and confirm that this test runs and passes.
|
||||
/// This will serve as a verification that the Redfield compilation flag worked as expected.
|
||||
///
|
||||
/// To run this test:
|
||||
/// dotnet build /p:Redfield=True ".\dotnet\BASE\Microsoft.ApplicationInsights.sln"
|
||||
/// dotnet test ".\bin\Debug\test\Microsoft.ApplicationInsights.Tests\net5.0\Microsoft.ApplicationInsights.Tests.dll" --filter Name~VerifyRedfieldEventSourceName
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
public void VerifyRedfieldEventSourceName()
|
||||
{
|
||||
var expectedName = "Redfield-Microsoft-ApplicationInsights-Core";
|
||||
|
||||
var eventSourceAttribute = typeof(CoreEventSource)
|
||||
.GetCustomAttributes(typeof(EventSourceAttribute))
|
||||
.Single() as EventSourceAttribute;
|
||||
|
||||
Assert.IsNotNull(eventSourceAttribute);
|
||||
Assert.AreEqual(expectedName, eventSourceAttribute.Name);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
|
@ -2,7 +2,11 @@
|
|||
{
|
||||
using System.Diagnostics.Tracing;
|
||||
|
||||
#if REDFIELD
|
||||
[EventSource(Name = "Redfield-Microsoft-ApplicationInsights-Extensibility-Test")]
|
||||
#else
|
||||
[EventSource(Name = "Microsoft-ApplicationInsights-Extensibility-Test")]
|
||||
#endif
|
||||
internal class TestEventSource : EventSource
|
||||
{
|
||||
[Event(1, Message = "Error: {0}", Level = EventLevel.Error)]
|
||||
|
|
|
@ -52,7 +52,11 @@
|
|||
{
|
||||
try
|
||||
{
|
||||
#if REDFIELD
|
||||
Assembly.Load(new AssemblyName("System.Diagnostics.DiagnosticSource, Version=4.0.5.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51"));
|
||||
#else
|
||||
Assembly.Load(new AssemblyName("System.Diagnostics.DiagnosticSource, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51"));
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
catch (System.IO.FileNotFoundException)
|
||||
|
|
|
@ -21,7 +21,11 @@ namespace Microsoft.ApplicationInsights.Extensibility.Implementation
|
|||
internal readonly EventSource EventSourceInternal;
|
||||
|
||||
/// <summary>Event provider name.</summary>
|
||||
#if REDFIELD
|
||||
private const string EventProviderName = "Redfield-Microsoft-ApplicationInsights-Data";
|
||||
#else
|
||||
private const string EventProviderName = "Microsoft-ApplicationInsights-Data";
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the RichPayloadEventSource class.
|
||||
|
|
|
@ -4,7 +4,11 @@
|
|||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Diagnostics.Tracing;
|
||||
|
||||
#if REDFIELD
|
||||
[EventSource(Name = "Redfield-Microsoft-ApplicationInsights-Core")]
|
||||
#else
|
||||
[EventSource(Name = "Microsoft-ApplicationInsights-Core")]
|
||||
#endif
|
||||
[SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", Justification = "appDomainName is required")]
|
||||
internal sealed class CoreEventSource : EventSource
|
||||
{
|
||||
|
|
|
@ -86,6 +86,38 @@
|
|||
/// </summary>
|
||||
private static bool ShouldSubscribe(EventSource eventSource)
|
||||
{
|
||||
#if REDFIELD
|
||||
if (eventSource.Name.StartsWith("Redfield-Microsoft-A", StringComparison.Ordinal))
|
||||
{
|
||||
switch (eventSource.Name)
|
||||
{
|
||||
case "Redfield-Microsoft-ApplicationInsights-Core":
|
||||
case "Redfield-Microsoft-ApplicationInsights-WindowsServer-TelemetryChannel":
|
||||
|
||||
case "Redfield-Microsoft-ApplicationInsights-Extensibility-AppMapCorrelation-Dependency":
|
||||
case "Redfield-Microsoft-ApplicationInsights-Extensibility-AppMapCorrelation-Web":
|
||||
|
||||
case "Redfield-Microsoft-ApplicationInsights-Extensibility-DependencyCollector":
|
||||
case "Redfield-Microsoft-ApplicationInsights-Extensibility-EventCounterCollector":
|
||||
case "Redfield-Microsoft-ApplicationInsights-Extensibility-PerformanceCollector":
|
||||
case "Redfield-Microsoft-ApplicationInsights-Extensibility-PerformanceCollector-QuickPulse":
|
||||
case "Redfield-Microsoft-ApplicationInsights-Extensibility-Web":
|
||||
case "Redfield-Microsoft-ApplicationInsights-Extensibility-WindowsServer":
|
||||
case "Redfield-Microsoft-ApplicationInsights-WindowsServer-Core":
|
||||
case "Redfield-Microsoft-ApplicationInsights-Extensibility-EventSourceListener":
|
||||
case "Redfield-Microsoft-ApplicationInsights-AspNetCore":
|
||||
case "Redfield-Microsoft-ApplicationInsights-LoggerProvider":
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (eventSource.Name == "Microsoft-AspNet-Telemetry-Correlation")
|
||||
{
|
||||
return true;
|
||||
}
|
||||
#else
|
||||
if (eventSource.Name.StartsWith("Microsoft-A", StringComparison.Ordinal))
|
||||
{
|
||||
switch (eventSource.Name)
|
||||
|
@ -96,7 +128,7 @@
|
|||
// AppMapCorrelation has a shared partial class: https://github.com/microsoft/ApplicationInsights-dotnet/blob/master/WEB/Src/Common/AppMapCorrelationEventSource.cs
|
||||
case "Microsoft-ApplicationInsights-Extensibility-AppMapCorrelation-Dependency": // https://github.com/microsoft/ApplicationInsights-dotnet/blob/master/WEB/Src/DependencyCollector/DependencyCollector/Implementation/AppMapCorrelationEventSource.cs
|
||||
case "Microsoft-ApplicationInsights-Extensibility-AppMapCorrelation-Web": // https://github.com/microsoft/ApplicationInsights-dotnet/blob/master/WEB/Src/Web/Web/Implementation/AppMapCorrelationEventSource.cs
|
||||
|
||||
|
||||
case "Microsoft-ApplicationInsights-Extensibility-DependencyCollector": // https://github.com/microsoft/ApplicationInsights-dotnet/blob/master/WEB/Src/DependencyCollector/DependencyCollector/Implementation/DependencyCollectorEventSource.cs
|
||||
case "Microsoft-ApplicationInsights-Extensibility-EventCounterCollector": // https://github.com/microsoft/ApplicationInsights-dotnet/blob/master/WEB/Src/EventCounterCollector/EventCounterCollector/EventCounterCollectorEventSource.cs
|
||||
case "Microsoft-ApplicationInsights-Extensibility-PerformanceCollector": // https://github.com/microsoft/ApplicationInsights-dotnet/blob/master/WEB/Src/PerformanceCollector/PerformanceCollector/Implementation/PerformanceCollectorEventSource.cs
|
||||
|
@ -113,6 +145,7 @@
|
|||
return false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -8,8 +8,11 @@
|
|||
/// </summary>
|
||||
internal class DiagnosticsEventListener : EventListener
|
||||
{
|
||||
#if REDFIELD
|
||||
private const string EventSourceNamePrefix = "Redfield-Microsoft-ApplicationInsights-";
|
||||
#else
|
||||
private const string EventSourceNamePrefix = "Microsoft-ApplicationInsights-";
|
||||
|
||||
#endif
|
||||
private readonly EventKeywords keywords;
|
||||
|
||||
private readonly EventLevel logLevel;
|
||||
|
|
|
@ -13,7 +13,12 @@
|
|||
internal class TraceSourceForEventSource : TraceSource, IEventListener, IDisposable
|
||||
{
|
||||
private const long AllKeyword = -1;
|
||||
|
||||
#if REDFIELD
|
||||
private const string TraceSourceName = "Redfield.Microsoft.ApplicationInsights.Extensibility.TraceSource";
|
||||
#else
|
||||
private const string TraceSourceName = "Microsoft.ApplicationInsights.Extensibility.TraceSource";
|
||||
#endif
|
||||
|
||||
private DiagnosticsEventListener listener;
|
||||
|
||||
|
|
|
@ -13,8 +13,11 @@
|
|||
/// </summary>
|
||||
internal class SelfDiagnosticsEventListener : EventListener
|
||||
{
|
||||
#if REDFIELD
|
||||
private const string EventSourceNamePrefix = "Redfield-Microsoft-ApplicationInsights-";
|
||||
#else
|
||||
private const string EventSourceNamePrefix = "Microsoft-ApplicationInsights-";
|
||||
|
||||
#endif
|
||||
// Buffer size of the log line. A UTF-16 encoded character in C# can take up to 4 bytes if encoded in UTF-8.
|
||||
private const int BUFFERSIZE = 4 * 5120;
|
||||
private readonly ThreadLocal<byte[]> writeBuffer = new ThreadLocal<byte[]>(() => null);
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
<PackageReference Include="Microsoft.Diagnostics.Tracing.EventRegister" Version="1.1.28" Condition="$(OS) == 'Windows_NT'">
|
||||
<PrivateAssets>All</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="5.0.0" />
|
||||
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="$(SystemDiagnosticsDiagnosticSourcePkgVer)" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework)' != 'netstandard2.0'">
|
||||
|
@ -34,5 +34,5 @@
|
|||
<AdditionalFiles Include="$(PublicApiRoot)\$(AssemblyName).dll\$(TargetFramework)\PublicAPI.Shipped.txt" />
|
||||
<AdditionalFiles Include="$(PublicApiRoot)\$(AssemblyName).dll\$(TargetFramework)\PublicAPI.Unshipped.txt" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
</Project>
|
||||
|
|
|
@ -4,7 +4,11 @@
|
|||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Diagnostics.Tracing;
|
||||
|
||||
#if REDFIELD
|
||||
[EventSource(Name = "Redfield-Microsoft-ApplicationInsights-WindowsServer-TelemetryChannel")]
|
||||
#else
|
||||
[EventSource(Name = "Microsoft-ApplicationInsights-WindowsServer-TelemetryChannel")]
|
||||
#endif
|
||||
[SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", Justification = "appDomainName is required")]
|
||||
internal sealed class TelemetryChannelEventSource : EventSource
|
||||
{
|
||||
|
|
|
@ -7,8 +7,25 @@
|
|||
|
||||
<!-- This is used to disable some build properties. -->
|
||||
<IsExamplesSolution Condition="'$(SolutionName)' == 'Examples' ">true</IsExamplesSolution>
|
||||
|
||||
<!-- This is used to change EventSource names. -->
|
||||
<DefineConstants Condition="'$(Redfield)' == 'True'">$(DefineConstants);REDFIELD</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Label="Package versions for System.Diagnostics.DiagnosticSource">
|
||||
<SystemDiagnosticsDiagnosticSourcePkgVer>5.0.0</SystemDiagnosticsDiagnosticSourcePkgVer>
|
||||
<SystemDiagnosticsDiagnosticSourcePkgVer Condition="'$(Redfield)' == 'True'">4.7.0</SystemDiagnosticsDiagnosticSourcePkgVer>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="Info_Redfield" BeforeTargets="Build" Condition="'$(Redfield)' == 'True'">
|
||||
<!--
|
||||
This flag is reserved for Codeless Attach products.
|
||||
Redfield has some unique code changes to avoid conflicting with the real AI SDK.
|
||||
To use: dotnet build /p:Redfield=True
|
||||
-->
|
||||
<Message Text="Directory.Build.props: Redfield build detected." Importance="high"/>
|
||||
</Target>
|
||||
|
||||
<Target Name="Info_InternalSettings" BeforeTargets="Build">
|
||||
<Message Text="Directory.Build.props: Internal_Logging is set to $(Internal_Logging)." Importance="high"/>
|
||||
</Target>
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\BASE\src\Microsoft.ApplicationInsights\Microsoft.ApplicationInsights.csproj" />
|
||||
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="5.0.0" />
|
||||
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="$(SystemDiagnosticsDiagnosticSourcePkgVer)" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -16,7 +16,11 @@ namespace Microsoft.ApplicationInsights.TraceEvent.Shared.Implementation
|
|||
[EventSource(Name = ProviderName)]
|
||||
internal sealed class EventSourceListenerEventSource : EventSource
|
||||
{
|
||||
#if REDFIELD
|
||||
public const string ProviderName = "Redfield-Microsoft-ApplicationInsights-Extensibility-EventSourceListener";
|
||||
#else
|
||||
public const string ProviderName = "Microsoft-ApplicationInsights-Extensibility-EventSourceListener";
|
||||
#endif
|
||||
public static readonly EventSourceListenerEventSource Log = new EventSourceListenerEventSource();
|
||||
|
||||
public readonly string ApplicationName;
|
||||
|
|
|
@ -13,7 +13,11 @@ namespace Microsoft.Extensions.Logging.ApplicationInsights
|
|||
/// <summary>
|
||||
/// EventSource for reporting errors and warnings from Logging module.
|
||||
/// </summary>
|
||||
#if REDFIELD
|
||||
[EventSource(Name = "Redfield-Microsoft-ApplicationInsights-LoggerProvider")]
|
||||
#else
|
||||
[EventSource(Name = "Microsoft-ApplicationInsights-LoggerProvider")]
|
||||
#endif
|
||||
internal sealed class ApplicationInsightsLoggerEventSource : EventSource
|
||||
{
|
||||
public static readonly ApplicationInsightsLoggerEventSource Log = new ApplicationInsightsLoggerEventSource();
|
||||
|
|
|
@ -25,7 +25,11 @@ namespace Microsoft.ApplicationInsights.EtwTelemetryCollector.Tests
|
|||
|
||||
protected override void OnEventSourceCreated(EventSource eventSource)
|
||||
{
|
||||
#if REDFIELD
|
||||
if (string.Equals(eventSource.Name, "Redfield-Microsoft-ApplicationInsights-Extensibility-EventSourceListener", System.StringComparison.Ordinal))
|
||||
#else
|
||||
if (string.Equals(eventSource.Name, "Microsoft-ApplicationInsights-Extensibility-EventSourceListener", System.StringComparison.Ordinal))
|
||||
#endif
|
||||
{
|
||||
EnableEvents(eventSource, EventLevel.LogAlways);
|
||||
}
|
||||
|
|
|
@ -26,7 +26,11 @@ namespace Microsoft.ApplicationInsights.EventSourceListener.Tests
|
|||
|
||||
protected override void OnEventSourceCreated(EventSource eventSource)
|
||||
{
|
||||
#if REDFIELD
|
||||
if (string.Equals(eventSource.Name, "Redfield-Microsoft-ApplicationInsights-Extensibility-EventSourceListener", StringComparison.Ordinal))
|
||||
#else
|
||||
if (string.Equals(eventSource.Name, "Microsoft-ApplicationInsights-Extensibility-EventSourceListener", StringComparison.Ordinal))
|
||||
#endif
|
||||
{
|
||||
EnableEvents(eventSource, EventLevel.LogAlways);
|
||||
}
|
||||
|
|
|
@ -11,7 +11,11 @@
|
|||
/// <summary>
|
||||
/// Event source for Application Insights ASP.NET Core SDK.
|
||||
/// </summary>
|
||||
#if REDFIELD
|
||||
[EventSource(Name = "Redfield-Microsoft-ApplicationInsights-AspNetCore")]
|
||||
#else
|
||||
[EventSource(Name = "Microsoft-ApplicationInsights-AspNetCore")]
|
||||
#endif
|
||||
[SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", Justification = "appDomainName is required")]
|
||||
[SuppressMessage("", "SA1611:ElementParametersMustBeDocumented", Justification = "Internal only class.")]
|
||||
internal sealed class AspNetCoreEventSource : EventSource
|
||||
|
|
|
@ -8,7 +8,11 @@
|
|||
/// <summary>
|
||||
/// Event source for Application Insights Worker Service SDK.
|
||||
/// </summary>
|
||||
#if REDFIELD
|
||||
[EventSource(Name = "Redfield-Microsoft-ApplicationInsights-WorkerService")]
|
||||
#else
|
||||
[EventSource(Name = "Microsoft-ApplicationInsights-WorkerService")]
|
||||
#endif
|
||||
[SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", Justification = "appDomainName is required")]
|
||||
[SuppressMessage("", "SA1611:ElementParametersMustBeDocumented", Justification = "Internal only class.")]
|
||||
internal sealed class WorkerServiceEventSource : EventSource
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
<ItemGroup>
|
||||
<!--Common Dependencies-->
|
||||
<ProjectReference Include="..\..\..\..\BASE\src\Microsoft.ApplicationInsights\Microsoft.ApplicationInsights.csproj" />
|
||||
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="5.0.0" />
|
||||
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="$(SystemDiagnosticsDiagnosticSourcePkgVer)" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework)' == 'net452'">
|
||||
|
|
|
@ -282,10 +282,9 @@
|
|||
[MethodImpl(MethodImplOptions.NoOptimization | MethodImplOptions.NoInlining)]
|
||||
private static void PrepareFirstActivity()
|
||||
{
|
||||
using (var activity = new Activity("Microsoft.ApplicationInights.Init"))
|
||||
{
|
||||
activity.Start();
|
||||
}
|
||||
var activity = new Activity("Microsoft.ApplicationInsights.Init");
|
||||
activity.Start();
|
||||
activity.Stop();
|
||||
}
|
||||
|
||||
#if !NETSTANDARD
|
||||
|
|
|
@ -7,7 +7,11 @@
|
|||
/// <summary>
|
||||
/// ETW EventSource tracing class.
|
||||
/// </summary>
|
||||
#if REDFIELD
|
||||
[EventSource(Name = "Redfield-Microsoft-ApplicationInsights-Extensibility-AppMapCorrelation-Dependency")]
|
||||
#else
|
||||
[EventSource(Name = "Microsoft-ApplicationInsights-Extensibility-AppMapCorrelation-Dependency")]
|
||||
#endif
|
||||
internal sealed partial class AppMapCorrelationEventSource : EventSource
|
||||
{
|
||||
}
|
||||
|
|
|
@ -10,7 +10,11 @@
|
|||
/// <summary>
|
||||
/// ETW EventSource tracing class.
|
||||
/// </summary>
|
||||
#if REDFIELD
|
||||
[EventSource(Name = "Redfield-Microsoft-ApplicationInsights-Extensibility-DependencyCollector")]
|
||||
#else
|
||||
[EventSource(Name = "Microsoft-ApplicationInsights-Extensibility-DependencyCollector")]
|
||||
#endif
|
||||
[SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", Justification = "appDomainName is required")]
|
||||
internal sealed class DependencyCollectorEventSource : EventSource
|
||||
{
|
||||
|
|
|
@ -21,7 +21,11 @@ namespace EventCounterCollector.Tests
|
|||
|
||||
protected override void OnEventSourceCreated(EventSource eventSource)
|
||||
{
|
||||
#if REDFIELD
|
||||
if (string.Equals(eventSource.Name, "Redfield-Microsoft-ApplicationInsights-Extensibility-EventCounterCollector", StringComparison.Ordinal))
|
||||
#else
|
||||
if (string.Equals(eventSource.Name, "Microsoft-ApplicationInsights-Extensibility-EventCounterCollector", StringComparison.Ordinal))
|
||||
#endif
|
||||
{
|
||||
EnableEvents(eventSource, EventLevel.LogAlways);
|
||||
}
|
||||
|
|
|
@ -4,7 +4,11 @@
|
|||
using System.Diagnostics.Tracing;
|
||||
using Microsoft.ApplicationInsights.Common;
|
||||
|
||||
#if REDFIELD
|
||||
[EventSource(Name = "Redfield-Microsoft-ApplicationInsights-Extensibility-EventCounterCollector")]
|
||||
#else
|
||||
[EventSource(Name = "Microsoft-ApplicationInsights-Extensibility-EventCounterCollector")]
|
||||
#endif
|
||||
[SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", Justification = "appDomainName is required")]
|
||||
internal sealed class EventCounterCollectorEventSource : EventSource
|
||||
{
|
||||
|
|
|
@ -4,7 +4,11 @@
|
|||
using System.Diagnostics.Tracing;
|
||||
using Microsoft.ApplicationInsights.Common;
|
||||
|
||||
#if REDFIELD
|
||||
[EventSource(Name = "Redfield-Microsoft-ApplicationInsights-Extensibility-PerformanceCollector")]
|
||||
#else
|
||||
[EventSource(Name = "Microsoft-ApplicationInsights-Extensibility-PerformanceCollector")]
|
||||
#endif
|
||||
[SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", Justification = "appDomainName is required")]
|
||||
internal sealed class PerformanceCollectorEventSource : EventSource
|
||||
{
|
||||
|
|
|
@ -6,7 +6,11 @@
|
|||
using System.Reflection;
|
||||
using Microsoft.ApplicationInsights.Common;
|
||||
|
||||
#if REDFIELD
|
||||
[EventSource(Name = "Redfield-Microsoft-ApplicationInsights-Extensibility-PerformanceCollector-QuickPulse")]
|
||||
#else
|
||||
[EventSource(Name = "Microsoft-ApplicationInsights-Extensibility-PerformanceCollector-QuickPulse")]
|
||||
#endif
|
||||
[SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", Justification = "appDomainName is required")]
|
||||
internal sealed class QuickPulseEventSource : EventSource
|
||||
{
|
||||
|
|
|
@ -7,7 +7,11 @@
|
|||
/// <summary>
|
||||
/// ETW EventSource tracing class.
|
||||
/// </summary>
|
||||
#if REDFIELD
|
||||
[EventSource(Name = "Redfield-Microsoft-ApplicationInsights-Extensibility-AppMapCorrelation-Web")]
|
||||
#else
|
||||
[EventSource(Name = "Microsoft-ApplicationInsights-Extensibility-AppMapCorrelation-Web")]
|
||||
#endif
|
||||
internal sealed partial class AppMapCorrelationEventSource : EventSource
|
||||
{
|
||||
}
|
||||
|
|
|
@ -6,11 +6,15 @@
|
|||
using System.Diagnostics.Tracing;
|
||||
#endif
|
||||
using Microsoft.ApplicationInsights.Common;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ETW EventSource tracing class.
|
||||
/// </summary>
|
||||
#if REDFIELD
|
||||
[EventSource(Name = "Redfield-Microsoft-ApplicationInsights-Extensibility-Web")]
|
||||
#else
|
||||
[EventSource(Name = "Microsoft-ApplicationInsights-Extensibility-Web")]
|
||||
#endif
|
||||
[SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", Justification = "appDomainName is required")]
|
||||
internal sealed class WebEventSource : EventSource
|
||||
{
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
<!--Common Dependencies-->
|
||||
<ProjectReference Include="..\..\..\..\BASE\src\Microsoft.ApplicationInsights\Microsoft.ApplicationInsights.csproj" />
|
||||
<PackageReference Include="Microsoft.AspNet.TelemetryCorrelation" Version="1.0.8" />
|
||||
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="5.0.0" />
|
||||
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="$(SystemDiagnosticsDiagnosticSourcePkgVer)" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -8,7 +8,11 @@
|
|||
/// <summary>
|
||||
/// ETW EventSource tracing class.
|
||||
/// </summary>
|
||||
#if REDFIELD
|
||||
[EventSource(Name = "Redfield-Microsoft-ApplicationInsights-Extensibility-WindowsServer")]
|
||||
#else
|
||||
[EventSource(Name = "Microsoft-ApplicationInsights-Extensibility-WindowsServer")]
|
||||
#endif
|
||||
[SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", Justification = "appDomainName is required")]
|
||||
internal sealed class WindowsServerEventSource : EventSource
|
||||
{
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
<!--Common Dependencies-->
|
||||
<ProjectReference Include="..\..\..\..\BASE\src\Microsoft.ApplicationInsights\Microsoft.ApplicationInsights.csproj" />
|
||||
<ProjectReference Include="..\..\..\..\BASE\src\ServerTelemetryChannel\TelemetryChannel.csproj" />
|
||||
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="5.0.0" />
|
||||
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="$(SystemDiagnosticsDiagnosticSourcePkgVer)" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
|
||||
|
|
Загрузка…
Ссылка в новой задаче