Skip to content

Commit

Permalink
Merge pull request #1142 from microsoft/develop
Browse files Browse the repository at this point in the history
Develop to master 2.10.0
  • Loading branch information
Liudmila Molkova authored May 21, 2019
2 parents ac20bbb + dcd64ac commit e006fd1
Show file tree
Hide file tree
Showing 25 changed files with 281 additions and 65 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

This changelog will be used to generate documentation on [release notes page](http://azure.microsoft.com/documentation/articles/app-insights-release-notes-dotnet/).

## Version 2.10.0
- [SDKVersion modified to be dotnetc for NetCore. This helps identify the source of code path, as implementations are slightly different for NetCore.](https://github.com/microsoft/ApplicationInsights-dotnet/pull/1125)
- [Fix telemetry timestamp precision on .NET Framework](https://github.com/microsoft/ApplicationInsights-dotnet-server/issues/1175)
- [Fix: catch SecurityException when ApplicationInsights config is read in partial trust](https://github.com/microsoft/ApplicationInsights-dotnet/pull/1119)

## Version 2.10.0-beta4
- [Fix NullReferenceException in DiagnosticsEventListener.OnEventWritten](https://github.com/Microsoft/ApplicationInsights-dotnet/issues/1106)
- [Fix RichPayloadEventSource can get enabled at Verbose level](https://github.com/Microsoft/ApplicationInsights-dotnet/issues/1108)
Expand Down
2 changes: 1 addition & 1 deletion GlobalStaticVersion.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<SemanticVersionMinor>10</SemanticVersionMinor>
<SemanticVersionPatch>0</SemanticVersionPatch>
<!--Valid values: beta1, beta2, EMPTY for stable -->
<PreReleaseMilestone>beta4</PreReleaseMilestone>
<PreReleaseMilestone></PreReleaseMilestone>
<!--
Date when Semantic Version was changed.
Update for every public release.
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
![Build Status](https://mseng.visualstudio.com/DefaultCollection/_apis/public/build/definitions/96a62c4a-58c2-4dbb-94b6-5979ebc7f2af/1822/badge)
[![Build Status](https://mseng.visualstudio.com/AppInsights/_apis/build/status/ChuckNorris/AI-BaseSDK-develop-linux?branchName=develop)](https://mseng.visualstudio.com/AppInsights/_build/latest?definitionId=6237?branchName=develop)
[![Build Status](https://mseng.visualstudio.com/AppInsights/_apis/build/status/ChuckNorris/AI-BaseSDK-GitHub-Master?branchName=develop)](https://mseng.visualstudio.com/AppInsights/_build/latest?definitionId=1822?branchName=develop)
[![codecov.io](https://codecov.io/github/Microsoft/ApplicationInsights-dotnet/coverage.svg?branch=develop)](https://codecov.io/github/Microsoft/ApplicationInsights-dotnet?branch=develop)

## NuGet packages
Expand Down Expand Up @@ -77,7 +78,7 @@ Application Insights SDK defines the following layers: data collection, public A

**Data reduction pipeline** is a linked list of telemetry processors. Each telemetry processor may decide to pre-aggregate and filter telemetry item or pass it to the next processor. This way only interesting telemetry reaches to the end of the pipeline and being send to the telemetry sinks.

Each **Telemetry sink** is responsible to upload telemetry to the specific back-end. Default telemetry sink sends data to the Application Insights. Sinks may also differ in guarantees they provide while uploading to the same back end. One may implement reliable delivery with re-tries and persistance when another may implement send and forget type of upload. Every telemetry sink may have it's own pipeline for additional data filtering and pre-aggregation.
Each **Telemetry sink** is responsible to upload telemetry to the specific back-end. Default telemetry sink sends data to the Application Insights. Sinks may also differ in guarantees they provide while uploading to the same back end. One may implement reliable delivery with re-tries and persistence when another may implement send and forget type of upload. Every telemetry sink may have it's own pipeline for additional data filtering and pre-aggregation.

Set of telemetry initializers called synchronously for every telemetry item. So extra properties can be added to the item.
By this time telemetry item is fully initialized. Build pipeline to aggregate or filter telemetry.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
<ProjectReference Include="..\..\..\Test\Microsoft.ApplicationInsights.Test\ApplicationInsightsTypes\ApplicationInsightsTypes.csproj" />
<PackageReference Include="Microsoft.Diagnostics.Tracing.TraceEvent" Version="2.0.30" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="Microsoft.TestPlatform.TestHost" Version="15.9.0" />
<PackageReference Include="MSTest.TestAdapter" Version="1.3.2" />
<PackageReference Include="MSTest.TestFramework" Version="1.3.2" />
<PackageReference Include="CompareNETObjects" Version="3.12.0" />
<PackageReference Include="Microsoft.TestPlatform.TestHost" Version="16.1.0" />
<PackageReference Include="MSTest.TestAdapter" Version="1.4.0" />
<PackageReference Include="MSTest.TestFramework" Version="1.4.0" />
<PackageReference Include="CompareNETObjects" Version="4.59.0" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="4.5.0" />
<PackageReference Include="Moq" Version="4.8.2" />
<PackageReference Include="Moq" Version="4.10.0" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System" />
<Reference Include="System.Management" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
<ProjectReference Include="..\..\..\Test\Microsoft.ApplicationInsights.Test\ApplicationInsightsTypes\ApplicationInsightsTypes.csproj" />
<PackageReference Include="Microsoft.Diagnostics.Tracing.TraceEvent" Version="2.0.30" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="Microsoft.TestPlatform.TestHost" Version="15.9.0" />
<PackageReference Include="MSTest.TestAdapter" Version="1.3.2" />
<PackageReference Include="MSTest.TestFramework" Version="1.3.2" />
<PackageReference Include="CompareNETObjects" Version="3.12.0" />
<PackageReference Include="Microsoft.TestPlatform.TestHost" Version="16.1.0" />
<PackageReference Include="MSTest.TestAdapter" Version="1.4.0" />
<PackageReference Include="MSTest.TestFramework" Version="1.4.0" />
<PackageReference Include="CompareNETObjects" Version="4.59.0" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="4.5.0" />
<PackageReference Include="Moq" Version="4.8.2" />
<PackageReference Include="Moq" Version="4.10.0" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System" />
<Reference Include="System.Management" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,11 @@ public static void ValidateSdkVersionString(string versionMoniker)
Assert.IsNotNull(versionMoniker);

// Expected result example: "m-agg2:2.6.0-12552"

#if NETCOREAPP1_1 || NETCOREAPP2_0
const string expectedPrefix = "m-agg2c:";
#else
const string expectedPrefix = "m-agg2:";
#endif

string sdkRevisionComponentStr = versionMoniker.Substring(expectedPrefix.Length);
string expectedVersion = SdkVersionUtils.GetSdkVersion(String.Empty);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,37 @@ public void OperationTelemetryStopAssignsCurrentTimeAsStartTimeAndTimeStampWitho
Assert.AreEqual(telemetry.Duration, TimeSpan.Zero);
}

#if !NETCOREAPP1_1
/// <summary>
/// Tests the scenario if Start assigns current *precise* time to start time.
/// </summary>
[TestMethod]
public void StartTimeIsPrecise()
{
double [] timeStampDiff = new double[1000];
DateTimeOffset prevTimestamp = DateTimeOffset.MinValue;
for (int i = 0; i < timeStampDiff.Length; i ++)
{
var telemetry = new DependencyTelemetry();
telemetry.Start();

if (i > 0)
{
timeStampDiff[i] = telemetry.Timestamp.Subtract(prevTimestamp).TotalMilliseconds;
Debug.WriteLine(timeStampDiff[i]);

// if timestamp is NOT precise, we'll get precisely 0 which should not ever happen
Assert.IsTrue(timeStampDiff[i] != 0);
}

prevTimestamp = telemetry.Timestamp;

// waste a bit of time, assert result to prevent any optimizations
Assert.IsTrue(ComputeSomethingHeavy() > 0);
}
}
#endif

/// <summary>
/// Tests the scenario if Stop computes the duration of the telemetry when timestamps are supplied to Start and Stop.
/// </summary>
Expand Down Expand Up @@ -129,5 +160,17 @@ public void OperationTelemetryCanRecordPreciseDurations()
Assert.IsTrue(difference.Ticks < 10);
}
}

private double ComputeSomethingHeavy()
{
var random = new Random();
double res = 0;
for (int i = 0; i < 10000; i++)
{
res += Math.Sqrt(random.NextDouble());
}

return res;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,37 @@ public void InitializeSetsDateTime()
Assert.IsTrue(telemetry.Timestamp != default(DateTimeOffset));
}

#if !NETCOREAPP1_1
/// <summary>
/// Tests the scenario if Initialize assigns current precise time to start time.
/// </summary>
[TestMethod]
public void TimestampIsPrecise()
{
double[] timeStampDiff = new double[1000];
DateTimeOffset prevTimestamp = DateTimeOffset.MinValue;
for (int i = 0; i < timeStampDiff.Length; i++)
{
var telemetry = new DependencyTelemetry();
new TelemetryClient().Initialize(telemetry);

if (i > 0)
{
timeStampDiff[i] = telemetry.Timestamp.Subtract(prevTimestamp).TotalMilliseconds;
Debug.WriteLine(timeStampDiff[i]);

// if timestamp is NOT precise, we'll get precisely 0 which should not ever happen
Assert.IsTrue(timeStampDiff[i] != 0);
}

prevTimestamp = telemetry.Timestamp;

// waste a bit of time, assert result to prevent any optimizations
Assert.IsTrue(ComputeSomethingHeavy() > 0);
}
}
#endif

[TestMethod]
public void InitializeSetsRoleInstance()
{
Expand Down Expand Up @@ -2105,5 +2136,17 @@ private void ClearActiveTelemetryConfiguration()
{
TelemetryConfiguration.Active = null;
}

private double ComputeSomethingHeavy()
{
var random = new Random();
double res = 0;
for (int i = 0; i < 10000; i++)
{
res += Math.Sqrt(random.NextDouble());
}

return res;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
<Reference Include="System" />

<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="Microsoft.TestPlatform.TestHost" Version="15.9.0" />
<PackageReference Include="MSTest.TestAdapter" Version="1.3.2" />
<PackageReference Include="MSTest.TestFramework" Version="1.3.2" />
<PackageReference Include="Microsoft.TestPlatform.TestHost" Version="16.1.0" />
<PackageReference Include="MSTest.TestAdapter" Version="1.4.0" />
<PackageReference Include="MSTest.TestFramework" Version="1.4.0" />
<PackageReference Include="System.Collections.Immutable" Version="1.3.1" />
<Reference Include="System.ComponentModel.Composition" />
<PackageReference Include="System.Console" Version="4.3.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@
<TargetFrameworks>netcoreapp1.1</TargetFrameworks>
<DebugType>pdbonly</DebugType>
<DebugSymbols>true</DebugSymbols>
<DefineConstants>$(DefineConstants);NETCOREAPP</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DefineConstants>$(DefineConstants);NETCOREAPP;NETCOREAPP1_1</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\src\Microsoft.ApplicationInsights\Microsoft.ApplicationInsights.csproj" />
<ProjectReference Include="..\..\..\Test\Microsoft.ApplicationInsights.Test\ApplicationInsightsTypes\ApplicationInsightsTypes.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="Microsoft.TestPlatform.TestHost" Version="15.9.0" />
<PackageReference Include="Moq" Version="4.8.2" />
<PackageReference Include="MSTest.TestAdapter" Version="1.3.2" />
<PackageReference Include="MSTest.TestFramework" Version="1.3.2" />
<PackageReference Include="CompareNETObjects" Version="4.0.0" />
<PackageReference Include="Microsoft.TestPlatform.TestHost" Version="16.1.0" />
<PackageReference Include="Moq" Version="4.10.0" />
<PackageReference Include="MSTest.TestAdapter" Version="1.4.0" />
<PackageReference Include="MSTest.TestFramework" Version="1.4.0" />
<PackageReference Include="CompareNETObjects" Version="4.59.0" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="4.5.0" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
<ProjectReference Include="..\..\..\src\Microsoft.ApplicationInsights\Microsoft.ApplicationInsights.csproj" />
<ProjectReference Include="..\..\..\Test\Microsoft.ApplicationInsights.Test\ApplicationInsightsTypes\ApplicationInsightsTypes.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="Microsoft.TestPlatform.TestHost" Version="15.9.0" />
<PackageReference Include="Moq" Version="4.8.2" />
<PackageReference Include="MSTest.TestAdapter" Version="1.3.2" />
<PackageReference Include="MSTest.TestFramework" Version="1.3.2" />
<PackageReference Include="CompareNETObjects" Version="4.0.0" />
<PackageReference Include="Microsoft.TestPlatform.TestHost" Version="16.1.0" />
<PackageReference Include="Moq" Version="4.10.0" />
<PackageReference Include="MSTest.TestAdapter" Version="1.4.0" />
<PackageReference Include="MSTest.TestFramework" Version="1.4.0" />
<PackageReference Include="CompareNETObjects" Version="4.59.0" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="4.5.0" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@
<ProjectReference Include="..\..\..\src\Microsoft.ApplicationInsights\Microsoft.ApplicationInsights.csproj" />
<ProjectReference Include="..\..\..\Test\Microsoft.ApplicationInsights.Test\ApplicationInsightsTypes\ApplicationInsightsTypes.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="Microsoft.TestPlatform.TestHost" Version="15.9.0" />
<PackageReference Include="MSTest.TestAdapter" Version="1.3.2" />
<PackageReference Include="MSTest.TestFramework" Version="1.3.2" />
<PackageReference Include="CompareNETObjects" Version="3.12.0" />
<PackageReference Include="Microsoft.TestPlatform.TestHost" Version="16.1.0" />
<PackageReference Include="MSTest.TestAdapter" Version="1.4.0" />
<PackageReference Include="MSTest.TestFramework" Version="1.4.0" />
<PackageReference Include="CompareNETObjects" Version="4.59.0" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="4.5.0" />
<ProjectReference Include="..\..\..\src\ServerTelemetryChannel\TelemetryChannel.csproj">
<Project>{3273d899-d9b3-44fe-b3ab-578e18b2ef90}</Project>
<Name>TelemetryChannel</Name>
</ProjectReference>
<PackageReference Include="Moq" Version="4.8.2" />
<PackageReference Include="Moq" Version="4.10.0" />
<Reference Include="System.Web" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Web.Extensions" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
<ProjectReference Include="..\..\..\src\Microsoft.ApplicationInsights\Microsoft.ApplicationInsights.csproj" />
<ProjectReference Include="..\..\..\Test\Microsoft.ApplicationInsights.Test\ApplicationInsightsTypes\ApplicationInsightsTypes.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="Moq" Version="4.8.2" />
<PackageReference Include="MSTest.TestAdapter" Version="1.3.2" />
<PackageReference Include="MSTest.TestFramework" Version="1.3.2" />
<PackageReference Include="Moq" Version="4.10.0" />
<PackageReference Include="MSTest.TestAdapter" Version="1.4.0" />
<PackageReference Include="MSTest.TestFramework" Version="1.4.0" />
<PackageReference Include="System.Diagnostics.StackTrace" Version="4.3.0" />
<PackageReference Include="System.Diagnostics.Tracing" Version="4.3.0" />
<PackageReference Include="System.Diagnostics.TraceSource" Version="4.3.0" />
Expand All @@ -33,7 +33,7 @@
<PackageReference Include="System.Reflection.Primitives" Version="4.3.0" />
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.4.0" />
<PackageReference Include="System.Security.AccessControl" Version="4.3.0" />
<PackageReference Include="CompareNETObjects" Version="3.12.0" />
<PackageReference Include="CompareNETObjects" Version="4.59.0" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="4.5.0" />
<ProjectReference Include="..\..\..\src\ServerTelemetryChannel\TelemetryChannel.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="2.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="Moq" Version="4.8.2" />
<PackageReference Include="MSTest.TestAdapter" Version="1.3.2" />
<PackageReference Include="MSTest.TestFramework" Version="1.3.2" />
<PackageReference Include="Moq" Version="4.10.0" />
<PackageReference Include="MSTest.TestAdapter" Version="1.4.0" />
<PackageReference Include="MSTest.TestFramework" Version="1.4.0" />
<PackageReference Include="System.Diagnostics.StackTrace" Version="4.3.0" />
<PackageReference Include="System.Diagnostics.Tracing" Version="4.3.0" />
<PackageReference Include="System.Diagnostics.TraceSource" Version="4.3.0" />
Expand All @@ -39,7 +39,7 @@
<PackageReference Include="System.Reflection.Primitives" Version="4.3.0" />
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.4.0" />
<PackageReference Include="System.Security.AccessControl" Version="4.3.0" />
<PackageReference Include="CompareNETObjects" Version="3.12.0" />
<PackageReference Include="CompareNETObjects" Version="4.59.0" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="4.5.0" />
<ProjectReference Include="..\..\..\src\ServerTelemetryChannel\TelemetryChannel.csproj" />
</ItemGroup>
Expand Down
Loading

0 comments on commit e006fd1

Please sign in to comment.