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

Commit

Permalink
Merge branch 'develop' into dev/DepColNoReactiveCore
Browse files Browse the repository at this point in the history
  • Loading branch information
Liudmila Molkova authored Apr 25, 2017
2 parents c851ccd + 23cf6a7 commit b0f225f
Show file tree
Hide file tree
Showing 83 changed files with 126 additions and 393 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Version 2.4.0-beta2
- [Handle breaking changes from DiagnosticSource](https://github.com/Microsoft/ApplicationInsights-dotnet-server/issues/480)
- [Exceptions statistics metrics uses `.Context.Operation.Name` instead of custom property `operationName`](https://github.com/Microsoft/ApplicationInsights-dotnet-server/issues/394)

## Version 2.4.0-beta1
- Report status code for the dependencies failed with non-protocol issue like DNS resolution or SSL shakeup problems.
- Implemented automatic telemetry correlation: all telemetry reported within the scope of the request is correlated to RequestTelemetry reported for the request.
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
<NugetVersionFilePath>$(MSBuildThisFileDirectory).nugetVersion</NugetVersionFilePath>
<BuildNugetVersion Condition="Exists($(NugetVersionFilePath))">$([System.IO.File]::ReadAllText($(NugetVersionFilePath)))</BuildNugetVersion>

<CoreSdkVersion>2.4.0-beta1</CoreSdkVersion>
<CoreSdkVersion>2.4.0-beta2</CoreSdkVersion>

<!-- Forces EventRegister target to generate ETW manifest file -->
<EtwManifestForceAll>true</EtwManifestForceAll>
Expand Down
2 changes: 1 addition & 1 deletion GlobalStaticVersion.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<SemanticVersionMajor>2</SemanticVersionMajor>
<SemanticVersionMinor>4</SemanticVersionMinor>
<SemanticVersionPatch>0</SemanticVersionPatch>
<PreReleaseMilestone>beta1</PreReleaseMilestone>
<PreReleaseMilestone>beta2</PreReleaseMilestone>
<!--
Date when Semantic Version was changed.
Update for every public release.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
<ItemGroup>
<Reference Include="Microsoft.ApplicationInsights">
<HintPath>..\..\..\..\packages\Microsoft.ApplicationInsights.2.4.0-beta1\lib\net40\Microsoft.ApplicationInsights.dll</HintPath>
<HintPath>..\..\..\..\packages\Microsoft.ApplicationInsights.2.4.0-beta2\lib\net40\Microsoft.ApplicationInsights.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Diagnostics.Tracing.EventSource, Version=1.1.28.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
Expand Down
2 changes: 1 addition & 1 deletion Src/DependencyCollector/Net40.Tests/packages.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.ApplicationInsights" version="2.4.0-beta1" targetFramework="net40" />
<package id="Microsoft.ApplicationInsights" version="2.4.0-beta2" targetFramework="net40" />
<package id="Microsoft.Bcl" version="1.1.10" targetFramework="net40" />
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net40" />
<package id="Microsoft.Bcl.Build" version="1.0.21" targetFramework="net40" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.ApplicationInsights">
<HintPath>..\..\..\..\packages\Microsoft.ApplicationInsights.2.4.0-beta1\lib\net40\Microsoft.ApplicationInsights.dll</HintPath>
<HintPath>..\..\..\..\packages\Microsoft.ApplicationInsights.2.4.0-beta2\lib\net40\Microsoft.ApplicationInsights.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Diagnostics.Tracing.EventSource, Version=1.1.28.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
Expand Down
2 changes: 1 addition & 1 deletion Src/DependencyCollector/Net40/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<package id="Desktop.Analyzers" version="1.1.0" targetFramework="net40" />
<package id="MicroBuild.Core" version="0.2.0" targetFramework="net40" developmentDependency="true" />
<package id="Microsoft.ApplicationInsights.Agent.Intercept" version="2.0.7" targetFramework="net40" />
<package id="Microsoft.ApplicationInsights" version="2.4.0-beta1" targetFramework="net40" />
<package id="Microsoft.ApplicationInsights" version="2.4.0-beta2" targetFramework="net40" />
<package id="Microsoft.Diagnostics.Tracing.EventRegister" version="1.1.28" targetFramework="net40" />
<package id="Microsoft.Diagnostics.Tracing.EventSource.Redist" version="1.1.28" targetFramework="net40" />
<package id="StyleCop.MSBuild" version="4.7.54.0" targetFramework="net40" developmentDependency="true" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.ApplicationInsights">
<HintPath>..\..\..\..\packages\Microsoft.ApplicationInsights.2.4.0-beta1\lib\net45\Microsoft.ApplicationInsights.dll</HintPath>
<HintPath>..\..\..\..\packages\Microsoft.ApplicationInsights.2.4.0-beta2\lib\net45\Microsoft.ApplicationInsights.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
Expand Down
2 changes: 1 addition & 1 deletion Src/DependencyCollector/Net45.Tests/packages.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.ApplicationInsights" version="2.4.0-beta1" targetFramework="net451" />
<package id="Microsoft.ApplicationInsights" version="2.4.0-beta2" targetFramework="net451" />
<package id="StyleCop.MSBuild" version="4.7.54.0" targetFramework="net451" developmentDependency="true" />
<package id="System.Diagnostics.DiagnosticSource" version="4.4.0-preview1-25214-03" targetFramework="net451" />
<package id="xunit" version="2.1.0" targetFramework="net451" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.ApplicationInsights">
<HintPath>..\..\..\..\packages\Microsoft.ApplicationInsights.2.4.0-beta1\lib\net45\Microsoft.ApplicationInsights.dll</HintPath>
<HintPath>..\..\..\..\packages\Microsoft.ApplicationInsights.2.4.0-beta2\lib\net45\Microsoft.ApplicationInsights.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
Expand Down
4 changes: 2 additions & 2 deletions Src/DependencyCollector/Net45/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<packages>
<package id="Desktop.Analyzers" version="1.1.0" targetFramework="net45" />
<package id="MicroBuild.Core" version="0.2.0" targetFramework="net45" developmentDependency="true" />
<package id="Microsoft.ApplicationInsights" version="2.4.0-beta1" targetFramework="net45" />
<package id="Microsoft.ApplicationInsights" version="2.4.0-beta2" targetFramework="net45" />
<package id="Microsoft.ApplicationInsights.Agent.Intercept" version="2.0.7" targetFramework="net45" />
<package id="StyleCop.MSBuild" version="4.7.54.0" targetFramework="net45" developmentDependency="true" />
<package id="System.Diagnostics.DiagnosticSource" version="4.4.0-preview1-25214-03" targetFramework="net45" />
</packages>
</packages>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'Test.props'))\Test.props" />
<PropertyGroup>
Expand Down Expand Up @@ -29,7 +29,7 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.ApplicationInsights">
<HintPath>..\..\..\..\packages\Microsoft.ApplicationInsights.2.4.0-beta1\lib\net46\Microsoft.ApplicationInsights.dll</HintPath>
<HintPath>..\..\..\..\packages\Microsoft.ApplicationInsights.2.4.0-beta2\lib\net46\Microsoft.ApplicationInsights.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
Expand Down Expand Up @@ -92,4 +92,4 @@
</PropertyGroup>
<Error Condition="!Exists('..\..\..\..\packages\StyleCop.MSBuild.4.7.54.0\build\StyleCop.MSBuild.Targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\StyleCop.MSBuild.4.7.54.0\build\StyleCop.MSBuild.Targets'))" />
</Target>
</Project>
</Project>
2 changes: 1 addition & 1 deletion Src/DependencyCollector/Net46.Tests/packages.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.ApplicationInsights" version="2.4.0-beta1" targetFramework="net46" />
<package id="Microsoft.ApplicationInsights" version="2.4.0-beta2" targetFramework="net46" />
<package id="StyleCop.MSBuild" version="4.7.54.0" targetFramework="net46" developmentDependency="true" />
<package id="System.Diagnostics.DiagnosticSource" version="4.4.0-preview1-25214-03" targetFramework="net46" />
<package id="xunit" version="2.1.0" targetFramework="net46" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Copyright>Copyright © Microsoft. All Rights Reserved.</Copyright>
<VersionPrefix>2.4.0-beta1</VersionPrefix>
<Copyright>Copyright © Microsoft. All Rights Reserved.</Copyright>
<VersionPrefix>2.4.0-beta2</VersionPrefix>
<Authors>Microsoft</Authors>
<TargetFramework>netstandard1.6</TargetFramework>
<DefineConstants>$(DefineConstants);NETCORE</DefineConstants>
Expand Down Expand Up @@ -47,7 +47,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.ApplicationInsights" Version="2.4.0-beta1" />
<PackageReference Include="Microsoft.ApplicationInsights" Version="2.4.0-beta2" />
<PackageReference Include="Microsoft.Extensions.DiagnosticAdapter" Version="1.1.0" />
<PackageReference Include="Microsoft.Extensions.PlatformAbstractions" Version="1.1.0" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="4.4.0-preview1-25214-03" />
<PackageReference Include="System.Diagnostics.StackTrace" Version="4.3.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'Package.targets'))\Package.targets" />
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'Common.targets'))\Common.targets" />
</Project>
</Project>
51 changes: 3 additions & 48 deletions Src/PerformanceCollector/Filtering/CollectionConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ internal class CollectionConfiguration
private readonly List<Tuple<string, AggregationType>> telemetryMetadata = new List<Tuple<string, AggregationType>>();

private readonly List<Tuple<string, string>> performanceCounters = new List<Tuple<string, string>>();

// (id, metricName, AggregationType)
private readonly List<Tuple<string, string, AggregationType>> metricMetrics = new List<Tuple<string, string, AggregationType>>();
#endregion

public CollectionConfiguration(
Expand All @@ -64,9 +61,6 @@ public CollectionConfiguration(
// create metrics based on descriptions in info
this.CreateTelemetryMetrics(info, out CollectionConfigurationError[] metricErrors);

// create Metric metrics
this.CreateMetricMetrics(out CollectionConfigurationError[] metricMetricsErrors);

// maintain a separate collection of all (Id, AggregationType) pairs with some additional data - to allow for uniform access to all types of metrics
// this includes both telemetry metrics and Metric metrics
this.CreateMetadata();
Expand All @@ -77,7 +71,7 @@ public CollectionConfiguration(
// create performance counters
this.CreatePerformanceCounters(out CollectionConfigurationError[] performanceCounterErrors);

errors = metricErrors.Concat(documentStreamErrors).Concat(performanceCounterErrors).Concat(metricMetricsErrors).ToArray();
errors = metricErrors.Concat(documentStreamErrors).Concat(performanceCounterErrors).ToArray();

foreach (var error in errors)
{
Expand Down Expand Up @@ -112,15 +106,7 @@ public CollectionConfiguration(
/// Performance counter name is stored in CalculatedMetricInfo.Projection.
/// </remarks>
public IEnumerable<Tuple<string, string>> PerformanceCounters => this.performanceCounters;

/// <summary>
/// Gets a list of Metric metrics.
/// </summary>
/// <remarks>
/// Metric name is stored in CalculatedMetricInfo.Projection.
/// </remarks>
public IEnumerable<Tuple<string, string, AggregationType>> MetricMetrics => this.metricMetrics;


public string ETag => this.info.ETag;

private static void AddMetric<TTelemetry>(
Expand Down Expand Up @@ -178,34 +164,7 @@ private void CreatePerformanceCounters(out CollectionConfigurationError[] errors

errors = errorList.ToArray();
}

private void CreateMetricMetrics(out CollectionConfigurationError[] errors)
{
var errorList = new List<CollectionConfigurationError>();

CalculatedMetricInfo[] metrics = (this.info.Metrics ?? new CalculatedMetricInfo[0]).Where(metric => metric.TelemetryType == TelemetryType.Metric).ToArray();

this.metricMetrics.AddRange(metrics.GroupBy(metric => metric.Id, StringComparer.Ordinal)
.Select(group => group.First())
.Select(m => Tuple.Create(m.Id, m.Projection, m.Aggregation)));

IEnumerable<string> duplicateMetricIds = metrics.GroupBy(m => m.Id, StringComparer.Ordinal)
.Where(group => group.Count() > 1)
.Select(group => group.Key);

foreach (var duplicateMetricId in duplicateMetricIds)
{
errorList.Add(
CollectionConfigurationError.CreateError(
CollectionConfigurationErrorType.MetricDuplicateIds,
string.Format(CultureInfo.InvariantCulture, "Duplicate metric id '{0}'", duplicateMetricId),
null,
Tuple.Create("MetricId", duplicateMetricId)));
}

errors = errorList.ToArray();
}


private void CreateDocumentStreams(
out CollectionConfigurationError[] errors,
Clock timeProvider,
Expand Down Expand Up @@ -320,10 +279,6 @@ private void CreateTelemetryMetrics(CollectionConfigurationInfo info, out Collec
case TelemetryType.Event:
CollectionConfiguration.AddMetric(metricInfo, this.eventTelemetryMetrics, out localErrors);
break;
case TelemetryType.Metric:
// no need to create a wrapper, we rely on the underlying CollectionConfigurationInfo to provide data about Metric metrics
// move on to the next metric
continue;
case TelemetryType.PerformanceCounter:
// no need to create a wrapper, we rely on the underlying CollectionConfigurationInfo to provide data about performance counters
// move on to the next metric
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public CollectionConfigurationAccumulator(CollectionConfiguration collectionConf
this.CollectionConfiguration = collectionConfiguration;

// prepare the accumulators based on the collection configuration
IEnumerable<Tuple<string, AggregationType>> allMetrics = collectionConfiguration?.TelemetryMetadata.Concat(collectionConfiguration.MetricMetrics.Select(metric => Tuple.Create(metric.Item1, metric.Item3)));
IEnumerable<Tuple<string, AggregationType>> allMetrics = collectionConfiguration?.TelemetryMetadata;
foreach (Tuple<string, AggregationType> metricId in allMetrics ?? Enumerable.Empty<Tuple<string, AggregationType>>())
{
var accumulatedValues = new AccumulatedValues(metricId.Item1, metricId.Item2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ internal enum TelemetryType

Event = 3,

Metric = 4,

PerformanceCounter = 5,

Trace = 6
Expand Down
2 changes: 1 addition & 1 deletion Src/PerformanceCollector/Net40/Perf.Net40.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
<ItemGroup>
<Reference Include="Microsoft.ApplicationInsights">
<HintPath>..\..\..\..\packages\Microsoft.ApplicationInsights.2.4.0-beta1\lib\net40\Microsoft.ApplicationInsights.dll</HintPath>
<HintPath>..\..\..\..\packages\Microsoft.ApplicationInsights.2.4.0-beta2\lib\net40\Microsoft.ApplicationInsights.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Diagnostics.Tracing.EventSource, Version=1.1.28.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
Expand Down
2 changes: 1 addition & 1 deletion Src/PerformanceCollector/Net40/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<packages>
<package id="Desktop.Analyzers" version="1.1.0" targetFramework="net40" />
<package id="MicroBuild.Core" version="0.2.0" targetFramework="net40" developmentDependency="true" />
<package id="Microsoft.ApplicationInsights" version="2.4.0-beta1" targetFramework="net40" />
<package id="Microsoft.ApplicationInsights" version="2.4.0-beta2" targetFramework="net40" />
<package id="Microsoft.Diagnostics.Tracing.EventRegister" version="1.1.28" targetFramework="net40" />
<package id="Microsoft.Diagnostics.Tracing.EventSource.Redist" version="1.1.28" targetFramework="net40" />
<package id="StyleCop.MSBuild" version="4.7.54.0" targetFramework="net40" developmentDependency="true" />
Expand Down
2 changes: 1 addition & 1 deletion Src/PerformanceCollector/Net45/Perf.Net45.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
<ItemGroup>
<Reference Include="Microsoft.ApplicationInsights">
<HintPath>..\..\..\..\packages\Microsoft.ApplicationInsights.2.4.0-beta1\lib\net45\Microsoft.ApplicationInsights.dll</HintPath>
<HintPath>..\..\..\..\packages\Microsoft.ApplicationInsights.2.4.0-beta2\lib\net45\Microsoft.ApplicationInsights.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
Expand Down
2 changes: 1 addition & 1 deletion Src/PerformanceCollector/Net45/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<packages>
<package id="Desktop.Analyzers" version="1.1.0" targetFramework="net45" />
<package id="MicroBuild.Core" version="0.2.0" targetFramework="net45" developmentDependency="true" />
<package id="Microsoft.ApplicationInsights" version="2.4.0-beta1" targetFramework="net45" />
<package id="Microsoft.ApplicationInsights" version="2.4.0-beta2" targetFramework="net45" />
<package id="StyleCop.MSBuild" version="4.7.54.0" targetFramework="net45" developmentDependency="true" />
</packages>
Loading

0 comments on commit b0f225f

Please sign in to comment.