Skip to content

Commit

Permalink
Merge pull request #1766 from microsoft/develop
Browse files Browse the repository at this point in the history
merge DEVELOP to MASTER (prep 2.14-beta5)
  • Loading branch information
TimothyMothra authored Apr 6, 2020
2 parents c19b0f4 + 66b38d5 commit 70aa94d
Show file tree
Hide file tree
Showing 17 changed files with 186 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .props/_GlobalStaticVersion.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<SemanticVersionMajor>2</SemanticVersionMajor>
<SemanticVersionMinor>14</SemanticVersionMinor> <!-- If changing the Minor version, also update the Date value. -->
<SemanticVersionPatch>0</SemanticVersionPatch>
<PreReleaseMilestone>beta4</PreReleaseMilestone> <!--Valid values: beta1, beta2, EMPTY for stable -->
<PreReleaseMilestone>beta5</PreReleaseMilestone> <!--Valid values: beta1, beta2, EMPTY for stable -->
<!--
Date when Semantic Version was changed.
Update for every MINOR release.
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Microsoft.ApplicationInsights.AspNetCore.JavaScriptSnippet.ScriptBody.get -> string
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## VNext

## Version 2.14.0-beta5
- [Stop collecting EventCounters from Microsoft.AspNetCore.Hosting](https://github.com/microsoft/ApplicationInsights-dotnet/issues/1759)
- [Enable ILogger provider for apps targetting .NET Framework](https://github.com/microsoft/ApplicationInsights-dotnet/issues/1312)

## Version 2.14.0-beta4
- [Fix: SQL dependency names are bloated when running under the .NET Framework and using Microsoft.Data.SqlClient package](https://github.com/microsoft/ApplicationInsights-dotnet/pull/1723)
- [Fix: Disabling HeartBeats in Asp.Net Core projects causes Error traces every heart beat interval (15 minutes defualt)](https://github.com/microsoft/ApplicationInsights-dotnet/issues/1681)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,7 @@ public static IServiceCollection AddApplicationInsightsTelemetry(this IServiceCo
AddTelemetryChannel(services);

#if NETSTANDARD2_0
ConfigureEventCounterModuleWithSystemCounters(services);
ConfigureEventCounterModuleWithAspNetCounters(services);
ConfigureEventCounterModuleWithSystemCounters(services);
#endif

services.TryAddSingleton<IConfigureOptions<ApplicationInsightsServiceOptions>,
Expand All @@ -155,7 +154,7 @@ public static IServiceCollection AddApplicationInsightsTelemetry(this IServiceCo

// NetStandard2.0 has a package reference to Microsoft.Extensions.Logging.ApplicationInsights, and
// enables ApplicationInsightsLoggerProvider by default.
#if NETSTANDARD2_0
#if NETSTANDARD2_0 || NET461
AddApplicationInsightsLoggerProvider(services);
#endif
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public RequestCollectionOptions()

// In NetStandard20, ApplicationInsightsLoggerProvider is enabled by default,
// which captures Exceptions. Disabling it in RequestCollectionModule to avoid duplication.
#if NETSTANDARD2_0
#if NETSTANDARD2_0 || NET461
this.TrackExceptions = false;
#else
this.TrackExceptions = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
[SuppressMessage("Documentation Rules", "SA1614:ElementParameterDocumentationMustHaveText", Justification = "This class is obsolete and will not be completely documented.")]
internal class ApplicationInsightsLogger : ILogger
{
#if NET451 || NET46
#if NET451 || NET46 || NET461
/// <summary>
/// SDK Version Prefix.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
/// <summary>
/// <see cref="ILoggerProvider"/> implementation that creates returns instances of <see cref="ApplicationInsightsLogger"/>.
/// </summary>
#if !NETSTANDARD2_0
// For NETSTANDARD2.0 We take dependency on Microsoft.Extensions.Logging.ApplicationInsights which has ApplicationInsightsProvider having the same ProviderAlias and don't want to clash with this ProviderAlias.
#if !NETSTANDARD2_0 && !NET461
// For NETSTANDARD2.0 and NET461 We take dependency on Microsoft.Extensions.Logging.ApplicationInsights which has ApplicationInsightsProvider having the same ProviderAlias and don't want to clash with this ProviderAlias.
[ProviderAlias("ApplicationInsights")]
#endif
[SuppressMessage("Documentation Rules", "SA1614:ElementParameterDocumentationMustHaveText", Justification = "This class is obsolete and will not be completely documented.")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<PropertyGroup>
<AssemblyName>Microsoft.ApplicationInsights.AspNetCore</AssemblyName>
<LangVersion>7.2</LangVersion>
<TargetFrameworks>netstandard2.0;net451;net46;netstandard1.6</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net451;net46;net461;netstandard1.6</TargetFrameworks>

<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netstandard1.6;netstandard2.0</TargetFrameworks>
<NetStandardImplicitPackageVersion Condition=" '$(TargetFramework)' == 'netstandard1.6' ">1.6.1</NetStandardImplicitPackageVersion>
Expand Down Expand Up @@ -72,12 +72,12 @@
<PackageReference Include="System.Memory" Version="4.5.4" /> <!-- This is a temporary explicit dependency. We're waiting on the next version of System.Diagnostics.DiagnosticSource. https://github.com/microsoft/ApplicationInsights-dotnet/issues/1707 -->
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' != 'netstandard2.0' ">
<ItemGroup Condition=" '$(TargetFramework)' != 'netstandard2.0' AND '$(TargetFramework)' != 'net461' ">
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="1.0.2" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="1.0.2" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFramework)' == 'net461' ">
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.1.0" />
<ProjectReference Include="..\..\..\LOGGING\src\ILogger\ILogger.csproj" />
<ProjectReference Include="..\..\..\WEB\Src\EventCounterCollector\EventCounterCollector\EventCounterCollector.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/// </summary>
internal class SdkVersionUtils
{
#if NET451 || NET46
#if NET451 || NET46 || NET461
/// <summary>
/// SDK Version Prefix.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ private static void ConfigureEventCounterModuleWithAspNetCounters(IServiceCollec
[SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", Justification = "services parameter is used in only NetStandard 2.0 build.")]
private static void AddApplicationInsightsLoggerProvider(IServiceCollection services)
{
#if NETSTANDARD2_0
#if NETSTANDARD2_0 || NET461
services.AddLogging(loggingBuilder =>
{
loggingBuilder.AddApplicationInsights();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ private string GetMachineName()
string hostName = Dns.GetHostName();

// Issue #61: For dnxcore machine name does not have domain name like in full framework
#if NET451 || NET46
#if NET451 || NET46 || NET461
string domainName = IPGlobalProperties.GetIPGlobalProperties().DomainName;
if (!hostName.EndsWith(domainName, StringComparison.OrdinalIgnoreCase))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -632,19 +632,13 @@ public static void RegistersTelemetryConfigurationFactoryMethodThatPopulatesEven
var eventCounterModule = modules.OfType<EventCounterCollectionModule>().Single();

//VALIDATE
Assert.Equal(23, eventCounterModule.Counters.Count);
Assert.Equal(19, eventCounterModule.Counters.Count);

// sanity check with a sample counter.
var cpuCounterRequest = eventCounterModule.Counters.FirstOrDefault<EventCounterCollectionRequest>(
eventCounterCollectionRequest => eventCounterCollectionRequest.EventSourceName == "System.Runtime"
&& eventCounterCollectionRequest.EventCounterName == "cpu-usage");
Assert.NotNull(cpuCounterRequest);

// sanity check - asp.net counters should be added
var aspnetCounterRequest = eventCounterModule.Counters.Where<EventCounterCollectionRequest>(
eventCounterCollectionRequest => eventCounterCollectionRequest.EventSourceName == "Microsoft.AspNetCore.Hosting");
Assert.NotNull(aspnetCounterRequest);
Assert.True(aspnetCounterRequest.Count() == 4);
Assert.NotNull(cpuCounterRequest);
}
#endif

Expand Down Expand Up @@ -989,7 +983,7 @@ public static void ConfigureRequestTrackingTelemetryDefaultOptions()
== typeof(RequestTrackingTelemetryModule));

Assert.True(requestTrackingModule.CollectionOptions.InjectResponseHeaders);
#if NETCOREAPP2_0
#if NETCOREAPP2_0 || NET461
Assert.False(requestTrackingModule.CollectionOptions.TrackExceptions);
#else
Assert.True(requestTrackingModule.CollectionOptions.TrackExceptions);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

<PropertyGroup>
<VersionPrefix>2.0.0</VersionPrefix>
<TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
<TargetFrameworks>netcoreapp2.0;net46;net461</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
<DelaySign Condition=" '$(OS)' == 'Windows_NT' ">true</DelaySign>
<PreserveCompilationContext>true</PreserveCompilationContext>
<AssemblyName>Microsoft.ApplicationInsights.AspNetCore.Tests</AssemblyName>
<PackageId>Microsoft.ApplicationInsights.AspNetCore.Tests</PackageId>
Expand All @@ -25,25 +26,25 @@
<ProjectReference Include="..\..\src\Microsoft.ApplicationInsights.AspNetCore\Microsoft.ApplicationInsights.AspNetCore.csproj" />
</ItemGroup>

<ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Hosting" Version="1.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Http" Version="1.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Http.Extensions" Version="1.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Http.Features" Version="1.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="1.0.3" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="1.0.2" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="1.0.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.7.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
<PackageReference Include="xunit" Version="2.3.1" />
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' != 'netcoreapp2.0' ">
<ItemGroup Condition=" '$(TargetFramework)' != 'netcoreapp2.0' AND '$(TargetFramework)' != 'net461' ">
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="1.0.2" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="1.0.2" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0' OR '$(TargetFramework)' == 'net461' ">
<PackageReference Include="Microsoft.AspNetCore.Hosting" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Http.Extensions" Version="2.0.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
public class SdkVersionTestUtils
{
#if NET451 || NET46
#if NET451 || NET46 || NET461
public const string VersionPrefix = "aspnet5f:";
#else
public const string VersionPrefix = "aspnet5c:";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public void RoleInstanceNameIsSetToDomainAndHost()

string hostName = Dns.GetHostName();

#if NET46
#if NET46 || NET461
string domainName = IPGlobalProperties.GetIPGlobalProperties().DomainName;
if (hostName.EndsWith(domainName, StringComparison.OrdinalIgnoreCase) == false)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public LoggerTests(ITestOutputHelper output) : base (output)
public void TestIloggerWarningOrAboveIsCapturedByDefault()
{

#if NETCOREAPP2_0
#if NETCOREAPP2_0 || NET461
using (var server = new InProcessServer(assemblyName, this.output))
{
// Make request to this path, which sents one log of each severity Error, Warning, Information, Trace
Expand All @@ -59,7 +59,7 @@ public void TestIloggerWarningOrAboveIsCapturedByDefault()
public void TestIloggerDefaultsCanBeOverridenByUserForAllCategories()
{

#if NETCOREAPP2_0
#if NETCOREAPP2_0 || NET461
void ConfigureServices(IServiceCollection services)
{
// ARRANGE
Expand Down Expand Up @@ -88,7 +88,7 @@ void ConfigureServices(IServiceCollection services)
public void TestIloggerDefaultsCanBeOverridenByUserForSpecificCategory()
{

#if NETCOREAPP2_0
#if NETCOREAPP2_0 || NET461
void ConfigureServices(IServiceCollection services)
{
// ARRANGE
Expand Down

0 comments on commit 70aa94d

Please sign in to comment.