Skip to content
This repository has been archived by the owner on Jun 10, 2020. It is now read-only.

Commit

Permalink
Add new package for .NET Core WorkerServices (Adds GenericHost suppor…
Browse files Browse the repository at this point in the history
…t) (#975)
  • Loading branch information
cijothomas authored Sep 12, 2019
1 parent 1672611 commit 49fd6dd
Show file tree
Hide file tree
Showing 30 changed files with 1,759 additions and 366 deletions.
10 changes: 9 additions & 1 deletion .vsts/linux-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,21 @@ steps:
arguments: "--configuration Release -l trx"

- task: DotNetCoreCLI@1
displayName: Unit Tests
displayName: Unit Tests for AspNetCore
continueOnError: true
inputs:
command: "test"
projects: "test/**/*AspNetCore.Tests.csproj"
arguments: "--configuration Release -l trx"

- task: DotNetCoreCLI@1
displayName: Unit Tests + Func Tests for WorkerService
continueOnError: true
inputs:
command: "test"
projects: "test/**/*WorkerService.Tests.csproj"
arguments: "--configuration Release -l trx"


- task: PublishTestResults@2
inputs:
Expand Down
20 changes: 20 additions & 0 deletions ApplicationInsights.AspNetCore.sln
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,16 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestApp30", "test\TestApp30
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestApp30.Tests30", "test\TestApp30.Tests\TestApp30.Tests30.csproj", "{FE9DB9A7-D9AE-4188-945C-393D70022D9A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ApplicationInsights.WorkerService", "src\Microsoft.ApplicationInsights.WorkerService\Microsoft.ApplicationInsights.WorkerService.csproj", "{AECEE8DD-09AE-4DEA-8690-F76A37C0534B}"
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Shared", "src\Shared\Shared.shproj", "{D56F2979-D6BC-4EF2-BB9B-4077B3290599}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.ApplicationInsights.WorkerService.Tests", "test\Microsoft.ApplicationInsights.WorkerService.Tests\Microsoft.ApplicationInsights.WorkerService.Tests.csproj", "{A41D3299-5E41-4B73-8C8E-DD64824BC9E6}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
src\Shared\Shared.projitems*{d56f2979-d6bc-4ef2-bb9b-4077b3290599}*SharedItemsImports = 13
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
Expand Down Expand Up @@ -110,6 +119,14 @@ Global
{FE9DB9A7-D9AE-4188-945C-393D70022D9A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FE9DB9A7-D9AE-4188-945C-393D70022D9A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FE9DB9A7-D9AE-4188-945C-393D70022D9A}.Release|Any CPU.Build.0 = Release|Any CPU
{AECEE8DD-09AE-4DEA-8690-F76A37C0534B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AECEE8DD-09AE-4DEA-8690-F76A37C0534B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AECEE8DD-09AE-4DEA-8690-F76A37C0534B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AECEE8DD-09AE-4DEA-8690-F76A37C0534B}.Release|Any CPU.Build.0 = Release|Any CPU
{A41D3299-5E41-4B73-8C8E-DD64824BC9E6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A41D3299-5E41-4B73-8C8E-DD64824BC9E6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A41D3299-5E41-4B73-8C8E-DD64824BC9E6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A41D3299-5E41-4B73-8C8E-DD64824BC9E6}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -129,6 +146,9 @@ Global
{9DA7024F-216F-4FA5-9B6D-CE4216C2DD72} = {8B5230E5-8138-44D6-839F-DF9248F195EE}
{8E71FECF-E090-409E-8551-C597F9DFB91C} = {8B5230E5-8138-44D6-839F-DF9248F195EE}
{FE9DB9A7-D9AE-4188-945C-393D70022D9A} = {8B5230E5-8138-44D6-839F-DF9248F195EE}
{AECEE8DD-09AE-4DEA-8690-F76A37C0534B} = {2E6DDE9E-8C75-4F9C-8906-08EBDD6E73EF}
{D56F2979-D6BC-4EF2-BB9B-4077B3290599} = {2E6DDE9E-8C75-4F9C-8906-08EBDD6E73EF}
{A41D3299-5E41-4B73-8C8E-DD64824BC9E6} = {8B5230E5-8138-44D6-839F-DF9248F195EE}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {047855A4-470F-43B1-8B74-69651DD6B8A6}
Expand Down
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
- [Support correlation-context in absence of request-id or traceparent.](https://github.com/microsoft/ApplicationInsights-aspnetcore/issues/901)
- [Non Product - Asp.Net Core 3.0 Functional Tests Added. This leverages the built-in integration test capability of ASP.NET Core via Microsoft.AspNetCore.MVC.Testing](https://github.com/microsoft/ApplicationInsights-aspnetcore/issues/539)
- [Fix: System.NullReferenceException in WebSessionTelemetryInitializer.](https://github.com/microsoft/ApplicationInsights-aspnetcore/issues/903)
- Updated Base SDK version dependency to 2.11.0-beta2
- Updated Base SDK/Web SDK/Logging Adaptor SDK version dependency to 2.11.0-beta2
- Updated System.Diagnostics.DiagnosticSource to 4.6.0-preview8.

- [Add new package for .NET Core WorkerServices (Adds GenericHost support)](https://github.com/microsoft/ApplicationInsights-aspnetcore/issues/708)

## Version 2.8.0-beta2
- [Fix MVCBeforeAction property fetcher to work with .NET Core 3.0 changes.](https://github.com/microsoft/ApplicationInsights-aspnetcore/issues/936)
- [Catch generic exception from DiagnosticSourceListeners and log instead of failing user request.](https://github.com/microsoft/ApplicationInsights-aspnetcore/issues/957)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

namespace Microsoft.ApplicationInsights.AspNetCore.Extensibility.Implementation.Tracing
{
#if AI_ASPNETCORE_WEB
using Microsoft.ApplicationInsights.AspNetCore.Implementation;
#endif
using System;
using System.Diagnostics.CodeAnalysis;
using System.Diagnostics.Tracing;
Expand Down Expand Up @@ -115,21 +117,12 @@ public void LogHostingDiagnosticListenerOnHttpRequestInStartActivityNull(string
/// <summary>
/// Logs an event when a TelemetryModule is not found to configure.
/// </summary>
[Event(11, Message = "Unable to configure module {0} as it is not found in service collection.", Level = EventLevel.Warning, Keywords = Keywords.Diagnostics)]
[Event(11, Message = "Unable to configure module {0} as it is not found in service collection.", Level = EventLevel.Error, Keywords = Keywords.Diagnostics)]
public void UnableToFindModuleToConfigure(string moduleType, string appDomainName = "Incorrect")
{
this.WriteEvent(11, moduleType, this.ApplicationName);
}

/// <summary>
/// Logs an event when QuickPulseTelemetryModule is not found in service collection.
/// </summary>
[Event(12, Message = "Unable to find QuickPulseTelemetryModule in service collection. LiveMetrics feature will not be available. Please add QuickPulseTelemetryModule to services collection in the ConfigureServices method of your application Startup class.", Level = EventLevel.Error, Keywords = Keywords.Diagnostics)]
public void UnableToFindQuickPulseModuleInDI(string appDomainName = "Incorrect")
{
this.WriteEvent(12, this.ApplicationName);
}

/// <summary>
/// Logs an event when telemetry is not tracked as the Listener is not active.
/// </summary>
Expand Down Expand Up @@ -256,6 +249,18 @@ public void HostingListenerWarning(string message, string exception, string appD
this.WriteEvent(22, message, exception, this.ApplicationName);
}

/// <summary>
/// Logs an informational event.
/// </summary>
[Event(
23,
Message = "Message : {0}",
Level = EventLevel.Informational)]
public void LogInformational(string message, string appDomainName = "Incorrect")
{
this.WriteEvent(23, message, this.ApplicationName);
}

/// <summary>
/// Keywords for the AspNetEventSource.
/// </summary>
Expand Down
Loading

0 comments on commit 49fd6dd

Please sign in to comment.