diff --git a/.github/workflows/redfield-sanity-check.yml b/.github/workflows/redfield-sanity-check.yml new file mode 100644 index 0000000000..d9805fdd69 --- /dev/null +++ b/.github/workflows/redfield-sanity-check.yml @@ -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 }} diff --git a/.props/_GlobalStaticVersion.props b/.props/_GlobalStaticVersion.props index 9cc616c89d..dfb498f35c 100644 --- a/.props/_GlobalStaticVersion.props +++ b/.props/_GlobalStaticVersion.props @@ -14,6 +14,7 @@ 18 0 + redfield nightly true + + + $(DefineConstants);REDFIELD + + + + 5.0.0 + 4.7.0 + + + + + diff --git a/LOGGING/src/DiagnosticSourceListener/DiagnosticSourceListener.csproj b/LOGGING/src/DiagnosticSourceListener/DiagnosticSourceListener.csproj index c17a8a44ab..4e22038644 100644 --- a/LOGGING/src/DiagnosticSourceListener/DiagnosticSourceListener.csproj +++ b/LOGGING/src/DiagnosticSourceListener/DiagnosticSourceListener.csproj @@ -22,7 +22,7 @@ - + diff --git a/LOGGING/src/EventSource.Shared/EventSource.Shared/Implementation/EventSourceListenerEventSource.cs b/LOGGING/src/EventSource.Shared/EventSource.Shared/Implementation/EventSourceListenerEventSource.cs index 3a9d2d9d95..ca05846ef4 100644 --- a/LOGGING/src/EventSource.Shared/EventSource.Shared/Implementation/EventSourceListenerEventSource.cs +++ b/LOGGING/src/EventSource.Shared/EventSource.Shared/Implementation/EventSourceListenerEventSource.cs @@ -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; diff --git a/LOGGING/src/ILogger/ApplicationInsightsLoggerEventSource.cs b/LOGGING/src/ILogger/ApplicationInsightsLoggerEventSource.cs index 4307a69a32..d5c48f4520 100644 --- a/LOGGING/src/ILogger/ApplicationInsightsLoggerEventSource.cs +++ b/LOGGING/src/ILogger/ApplicationInsightsLoggerEventSource.cs @@ -13,7 +13,11 @@ namespace Microsoft.Extensions.Logging.ApplicationInsights /// /// EventSource for reporting errors and warnings from Logging module. /// +#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(); diff --git a/LOGGING/test/EtwCollector.Tests/EventSourceModuleDiagnosticListener.cs b/LOGGING/test/EtwCollector.Tests/EventSourceModuleDiagnosticListener.cs index 7dcdbfab8d..1a63ec0f02 100644 --- a/LOGGING/test/EtwCollector.Tests/EventSourceModuleDiagnosticListener.cs +++ b/LOGGING/test/EtwCollector.Tests/EventSourceModuleDiagnosticListener.cs @@ -25,7 +25,11 @@ protected override void OnEventWritten(EventWrittenEventArgs eventData) 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); } diff --git a/LOGGING/test/EventSourceListener.Tests/EventSourceModuleDiagnosticListener.cs b/LOGGING/test/EventSourceListener.Tests/EventSourceModuleDiagnosticListener.cs index f255685808..975053748c 100644 --- a/LOGGING/test/EventSourceListener.Tests/EventSourceModuleDiagnosticListener.cs +++ b/LOGGING/test/EventSourceListener.Tests/EventSourceModuleDiagnosticListener.cs @@ -26,7 +26,11 @@ protected override void OnEventWritten(EventWrittenEventArgs eventData) 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); } diff --git a/NETCORE/src/Microsoft.ApplicationInsights.AspNetCore/Extensibility/Implementation/Tracing/AspNetCoreEventSource.cs b/NETCORE/src/Microsoft.ApplicationInsights.AspNetCore/Extensibility/Implementation/Tracing/AspNetCoreEventSource.cs index 567dd881c8..815caa2b1c 100644 --- a/NETCORE/src/Microsoft.ApplicationInsights.AspNetCore/Extensibility/Implementation/Tracing/AspNetCoreEventSource.cs +++ b/NETCORE/src/Microsoft.ApplicationInsights.AspNetCore/Extensibility/Implementation/Tracing/AspNetCoreEventSource.cs @@ -11,7 +11,11 @@ /// /// Event source for Application Insights ASP.NET Core SDK. /// +#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 diff --git a/NETCORE/src/Microsoft.ApplicationInsights.WorkerService/Implementation/Tracing/WorkerServiceEventSource.cs b/NETCORE/src/Microsoft.ApplicationInsights.WorkerService/Implementation/Tracing/WorkerServiceEventSource.cs index b461062b40..2ff8ab7dbd 100644 --- a/NETCORE/src/Microsoft.ApplicationInsights.WorkerService/Implementation/Tracing/WorkerServiceEventSource.cs +++ b/NETCORE/src/Microsoft.ApplicationInsights.WorkerService/Implementation/Tracing/WorkerServiceEventSource.cs @@ -8,7 +8,11 @@ /// /// Event source for Application Insights Worker Service SDK. /// +#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 diff --git a/WEB/Src/DependencyCollector/DependencyCollector/DependencyCollector.csproj b/WEB/Src/DependencyCollector/DependencyCollector/DependencyCollector.csproj index bb0d5ff414..7bf11c5908 100644 --- a/WEB/Src/DependencyCollector/DependencyCollector/DependencyCollector.csproj +++ b/WEB/Src/DependencyCollector/DependencyCollector/DependencyCollector.csproj @@ -26,7 +26,7 @@ - + diff --git a/WEB/Src/DependencyCollector/DependencyCollector/DependencyTrackingTelemetryModule.cs b/WEB/Src/DependencyCollector/DependencyCollector/DependencyTrackingTelemetryModule.cs index 8fcea7abaa..dbf2b9ef3d 100644 --- a/WEB/Src/DependencyCollector/DependencyCollector/DependencyTrackingTelemetryModule.cs +++ b/WEB/Src/DependencyCollector/DependencyCollector/DependencyTrackingTelemetryModule.cs @@ -282,10 +282,9 @@ protected virtual void Dispose(bool disposing) [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 diff --git a/WEB/Src/DependencyCollector/DependencyCollector/Implementation/AppMapCorrelationEventSource.cs b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/AppMapCorrelationEventSource.cs index 9a1ffc0bbd..237b671709 100644 --- a/WEB/Src/DependencyCollector/DependencyCollector/Implementation/AppMapCorrelationEventSource.cs +++ b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/AppMapCorrelationEventSource.cs @@ -7,7 +7,11 @@ /// /// ETW EventSource tracing class. /// +#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 { } diff --git a/WEB/Src/DependencyCollector/DependencyCollector/Implementation/DependencyCollectorEventSource.cs b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/DependencyCollectorEventSource.cs index 13ae8b034a..a3e9583526 100644 --- a/WEB/Src/DependencyCollector/DependencyCollector/Implementation/DependencyCollectorEventSource.cs +++ b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/DependencyCollectorEventSource.cs @@ -10,7 +10,11 @@ /// /// ETW EventSource tracing class. /// +#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 { diff --git a/WEB/Src/EventCounterCollector/EventCounterCollector.Tests/EventCounterCollectorDiagnosticListener.cs b/WEB/Src/EventCounterCollector/EventCounterCollector.Tests/EventCounterCollectorDiagnosticListener.cs index f9299e8271..020be06b17 100644 --- a/WEB/Src/EventCounterCollector/EventCounterCollector.Tests/EventCounterCollectorDiagnosticListener.cs +++ b/WEB/Src/EventCounterCollector/EventCounterCollector.Tests/EventCounterCollectorDiagnosticListener.cs @@ -21,7 +21,11 @@ protected override void OnEventWritten(EventWrittenEventArgs eventData) 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); } diff --git a/WEB/Src/EventCounterCollector/EventCounterCollector/EventCounterCollectorEventSource.cs b/WEB/Src/EventCounterCollector/EventCounterCollector/EventCounterCollectorEventSource.cs index bc5bda743c..a7c7cf6eee 100644 --- a/WEB/Src/EventCounterCollector/EventCounterCollector/EventCounterCollectorEventSource.cs +++ b/WEB/Src/EventCounterCollector/EventCounterCollector/EventCounterCollectorEventSource.cs @@ -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 { diff --git a/WEB/Src/PerformanceCollector/PerformanceCollector/Implementation/PerformanceCollectorEventSource.cs b/WEB/Src/PerformanceCollector/PerformanceCollector/Implementation/PerformanceCollectorEventSource.cs index aff827ce3f..e54b08d4c3 100644 --- a/WEB/Src/PerformanceCollector/PerformanceCollector/Implementation/PerformanceCollectorEventSource.cs +++ b/WEB/Src/PerformanceCollector/PerformanceCollector/Implementation/PerformanceCollectorEventSource.cs @@ -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 { diff --git a/WEB/Src/PerformanceCollector/PerformanceCollector/Implementation/QuickPulse/QuickPulseEventSource.cs b/WEB/Src/PerformanceCollector/PerformanceCollector/Implementation/QuickPulse/QuickPulseEventSource.cs index 735c703c3b..d6132e13c0 100644 --- a/WEB/Src/PerformanceCollector/PerformanceCollector/Implementation/QuickPulse/QuickPulseEventSource.cs +++ b/WEB/Src/PerformanceCollector/PerformanceCollector/Implementation/QuickPulse/QuickPulseEventSource.cs @@ -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 { diff --git a/WEB/Src/Web/Web/Implementation/AppMapCorrelationEventSource.cs b/WEB/Src/Web/Web/Implementation/AppMapCorrelationEventSource.cs index 07f8ee4ac0..c789dc5cd4 100644 --- a/WEB/Src/Web/Web/Implementation/AppMapCorrelationEventSource.cs +++ b/WEB/Src/Web/Web/Implementation/AppMapCorrelationEventSource.cs @@ -7,7 +7,11 @@ /// /// ETW EventSource tracing class. /// +#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 { } diff --git a/WEB/Src/Web/Web/Implementation/WebEventSource.cs b/WEB/Src/Web/Web/Implementation/WebEventSource.cs index 80b659b4f1..5402b0a778 100644 --- a/WEB/Src/Web/Web/Implementation/WebEventSource.cs +++ b/WEB/Src/Web/Web/Implementation/WebEventSource.cs @@ -6,11 +6,15 @@ using System.Diagnostics.Tracing; #endif using Microsoft.ApplicationInsights.Common; - + /// /// ETW EventSource tracing class. /// +#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 { diff --git a/WEB/Src/Web/Web/Web.csproj b/WEB/Src/Web/Web/Web.csproj index ffedc9ea2b..61e8ce3ac0 100644 --- a/WEB/Src/Web/Web/Web.csproj +++ b/WEB/Src/Web/Web/Web.csproj @@ -21,7 +21,7 @@ - + diff --git a/WEB/Src/WindowsServer/WindowsServer/Implementation/WindowsServerEventSource.cs b/WEB/Src/WindowsServer/WindowsServer/Implementation/WindowsServerEventSource.cs index d4339488dd..8e19218a9b 100644 --- a/WEB/Src/WindowsServer/WindowsServer/Implementation/WindowsServerEventSource.cs +++ b/WEB/Src/WindowsServer/WindowsServer/Implementation/WindowsServerEventSource.cs @@ -8,7 +8,11 @@ /// /// ETW EventSource tracing class. /// +#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 { diff --git a/WEB/Src/WindowsServer/WindowsServer/WindowsServer.csproj b/WEB/Src/WindowsServer/WindowsServer/WindowsServer.csproj index b30d19c8e2..29d7c20f94 100644 --- a/WEB/Src/WindowsServer/WindowsServer/WindowsServer.csproj +++ b/WEB/Src/WindowsServer/WindowsServer/WindowsServer.csproj @@ -24,7 +24,7 @@ - +