Skip to content

Commit

Permalink
Merge pull request #859 from Microsoft/tilee/merge_develop_to_master_…
Browse files Browse the repository at this point in the history
…prep_2.7.0-beta3

merge dev to master (prep 2.7.0-beta3)
  • Loading branch information
TimothyMothra authored Jul 6, 2018
2 parents 8799b92 + 9a7fbd3 commit 73770e7
Show file tree
Hide file tree
Showing 63 changed files with 752 additions and 312 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Changelog

This changelog will be used to generate documentation on [release notes page](http://azure.microsoft.com/en-us/documentation/articles/app-insights-release-notes-dotnet/).
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.7.0-beta3
- [Allow to set flags on event](https://github.com/Microsoft/ApplicationInsights-dotnet/issues/844). It will be used in conjunction with the feature that will allow to keep IP addresses.
- [Fix: SerializationException resolving Activity in cross app-domain calls](https://github.com/Microsoft/ApplicationInsights-dotnet-server/issues/613)
- [Make HttpClient instance static to avoid re-creating with every transmission. This had caused connection/memory leaks in .net core 2.1] (https://github.com/Microsoft/ApplicationInsights-dotnet/issues/594)
Related: (https://github.com/Microsoft/ApplicationInsights-aspnetcore/issues/690)

## Version 2.7.0-beta2
- [Fix: NullReferenceException if telemtery is tracked after TelemetryConfiguration is disposed](https://github.com/Microsoft/ApplicationInsights-dotnet-server/issues/928)
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>7</SemanticVersionMinor>
<SemanticVersionPatch>0</SemanticVersionPatch>
<!--Valid values: beta1, beta2, EMPTY for stable -->
<PreReleaseMilestone>beta2</PreReleaseMilestone>
<PreReleaseMilestone>beta3</PreReleaseMilestone>
<!--
Date when Semantic Version was changed.
Update for every public release.
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -277,4 +277,7 @@ static Microsoft.ApplicationInsights.Metrics.MetricIdentifier.DefaultMetricNames
static Microsoft.ApplicationInsights.Metrics.MetricIdentifier.DefaultMetricNamespace.set -> void
static Microsoft.ApplicationInsights.Metrics.TelemetryConfigurationExtensions.GetMetricManager(this Microsoft.ApplicationInsights.Extensibility.TelemetryConfiguration telemetryPipeline) -> Microsoft.ApplicationInsights.Metrics.MetricManager
static readonly Microsoft.ApplicationInsights.MetricConfigurations.Common -> Microsoft.ApplicationInsights.MetricConfigurations
virtual Microsoft.ApplicationInsights.Metrics.MetricConfiguration.Equals(Microsoft.ApplicationInsights.Metrics.MetricConfiguration other) -> bool
virtual Microsoft.ApplicationInsights.Metrics.MetricConfiguration.Equals(Microsoft.ApplicationInsights.Metrics.MetricConfiguration other) -> bool
Microsoft.ApplicationInsights.DataContracts.TelemetryContext.Flags.get -> long
Microsoft.ApplicationInsights.DataContracts.TelemetryContext.Flags.set -> void
const Microsoft.ApplicationInsights.DataContracts.TelemetryContext.FlagDropIdentifiers = 2097152 -> long
Original file line number Diff line number Diff line change
Expand Up @@ -277,4 +277,7 @@ static Microsoft.ApplicationInsights.Metrics.MetricIdentifier.DefaultMetricNames
static Microsoft.ApplicationInsights.Metrics.MetricIdentifier.DefaultMetricNamespace.set -> void
static Microsoft.ApplicationInsights.Metrics.TelemetryConfigurationExtensions.GetMetricManager(this Microsoft.ApplicationInsights.Extensibility.TelemetryConfiguration telemetryPipeline) -> Microsoft.ApplicationInsights.Metrics.MetricManager
static readonly Microsoft.ApplicationInsights.MetricConfigurations.Common -> Microsoft.ApplicationInsights.MetricConfigurations
virtual Microsoft.ApplicationInsights.Metrics.MetricConfiguration.Equals(Microsoft.ApplicationInsights.Metrics.MetricConfiguration other) -> bool
virtual Microsoft.ApplicationInsights.Metrics.MetricConfiguration.Equals(Microsoft.ApplicationInsights.Metrics.MetricConfiguration other) -> bool
Microsoft.ApplicationInsights.DataContracts.TelemetryContext.Flags.get -> long
Microsoft.ApplicationInsights.DataContracts.TelemetryContext.Flags.set -> void
const Microsoft.ApplicationInsights.DataContracts.TelemetryContext.FlagDropIdentifiers = 2097152 -> long
Original file line number Diff line number Diff line change
Expand Up @@ -278,4 +278,7 @@ static Microsoft.ApplicationInsights.Metrics.MetricIdentifier.DefaultMetricNames
static Microsoft.ApplicationInsights.Metrics.TelemetryConfigurationExtensions.GetMetricManager(this Microsoft.ApplicationInsights.Extensibility.TelemetryConfiguration telemetryPipeline) -> Microsoft.ApplicationInsights.Metrics.MetricManager
static readonly Microsoft.ApplicationInsights.MetricConfigurations.Common -> Microsoft.ApplicationInsights.MetricConfigurations
virtual Microsoft.ApplicationInsights.Metrics.MetricConfiguration.Equals(Microsoft.ApplicationInsights.Metrics.MetricConfiguration other) -> bool
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.SetParsedStack(System.Diagnostics.StackFrame[] frames) -> void
Microsoft.ApplicationInsights.DataContracts.ExceptionTelemetry.SetParsedStack(System.Diagnostics.StackFrame[] frames) -> void
Microsoft.ApplicationInsights.DataContracts.TelemetryContext.Flags.get -> long
Microsoft.ApplicationInsights.DataContracts.TelemetryContext.Flags.set -> void
const Microsoft.ApplicationInsights.DataContracts.TelemetryContext.FlagDropIdentifiers = 2097152 -> long
4 changes: 4 additions & 0 deletions Schema/PublicSchema/Envelope.bond
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ struct Envelope
[MaxStringLength("40")]
60: string iKey;

[Description("A collection of values bit-packed to represent how the event was processed. Currently represents whether IP address needs to be stripped out from event (set 0x200000) or should be preserved.")]
[Name("TelemetryProperties")]
70: int64 flags;

[Name("Tags")]
[TypeAlias("ContextTagKeys")]
[Description("Key/value collection of context properties. See ContextTagKeys for information on available properties.")]
Expand Down
4 changes: 4 additions & 0 deletions Schema/PublicSchema/MessageData.bond
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@ struct MessageData
[MaxValueLength("8192")]
100: map<string, string> properties;

[Description("Collection of custom measurements.")]
[MaxKeyLength("150")]
200: map<string, double> measurements;

}
1 change: 0 additions & 1 deletion Schema/PublicSchema/PageViewData.bond
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,4 @@ struct PageViewData
[ActAsRequired("Required field for correct correlation.")]
[Description("Identifier of a page view instance. Used for correlation between page view and other telemetry items.")]
50: required string id;

}
2 changes: 1 addition & 1 deletion Schema/PublicSchema/RequestData.bond
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct RequestData
60: required string responseCode;

[Description("Indication of successfull or unsuccessfull call.")]
70: required bool success;
70: required bool success = true;

[MaxStringLength("1024")]
[Description("Source of the request. Examples are the instrumentation key of the caller or the ip address of the caller.")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ public partial class Envelope
[global::Bond.Id(60)]
public string iKey { get; set; }

[global::Bond.Attribute("Description", "A collection of values bit-packed to represent how the event was processed. Currently represents whether IP address needs to be stripped out from event (set 0x200000) or should be preserved.")]
[global::Bond.Attribute("Name", "TelemetryProperties")]
[global::Bond.Id(70)]
public long flags { get; set; }

[global::Bond.Attribute("Name", "Tags")]
[global::Bond.Attribute("TypeAlias", "ContextTagKeys")]
[global::Bond.Attribute("Description", "Key/value collection of context properties. See ContextTagKeys for information on available properties.")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ public partial class MessageData
[global::Bond.Id(100), global::Bond.Type(typeof(Dictionary<string, string>))]
public IDictionary<string, string> properties { get; set; }

[global::Bond.Attribute("Description", "Collection of custom measurements.")]
[global::Bond.Attribute("MaxKeyLength", "150")]
[global::Bond.Id(200), global::Bond.Type(typeof(Dictionary<string, double>))]
public IDictionary<string, double> measurements { get; set; }

public MessageData()
: this("AI.MessageData", "MessageData")
{}
Expand All @@ -62,6 +67,7 @@ protected MessageData(string fullName, string name)
ver = 2;
message = "";
properties = new Dictionary<string, string>();
measurements = new Dictionary<string, double>();
}
}
} // AI
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ protected RequestData(string fullName, string name)
this.name = "";
duration = "";
responseCode = "";
success = true;
url = "";
properties = new Dictionary<string, string>();
measurements = new Dictionary<string, double>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<PackageReference Include="MSTest.TestFramework" Version="1.2.0" />
<PackageReference Include="CompareNETObjects" Version="3.12.0" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="4.4.0" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="4.5.0" />
<PackageReference Include="MicroBuild.Core" Version="0.3.0">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<PackageReference Include="MSTest.TestFramework" Version="1.2.0" />
<PackageReference Include="CompareNETObjects" Version="3.12.0" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="4.4.0" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="4.5.0" />
<PackageReference Include="Moq" Version="4.8.2" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ private void SerializeWritesTimestampAsExpectedByEndpoint()
var expected = new TTelemetry { Timestamp = DateTimeOffset.UtcNow };
expected.Sanitize();

TelemetryItem<TEndpointData> actual = TelemetryItemTestHelper.SerializeDeserializeTelemetryItem<TTelemetry, TEndpointData>(expected);
TelemetryItem<TEndpointData> actual = TelemetryItemTestHelper.SerializeDeserializeTelemetryItem<TEndpointData>(expected);


Assert.AreEqual<DateTimeOffset>(expected.Timestamp, DateTimeOffset.Parse(actual.time, null, System.Globalization.DateTimeStyles.AssumeUniversal));
Expand All @@ -166,7 +166,7 @@ private void SerializeWritesSequenceAsExpectedByEndpoint()
var expected = new TTelemetry { Sequence = "4:2" };
expected.Sanitize();

TelemetryItem<TEndpointData> actual = TelemetryItemTestHelper.SerializeDeserializeTelemetryItem<TTelemetry, TEndpointData>(expected);
TelemetryItem<TEndpointData> actual = TelemetryItemTestHelper.SerializeDeserializeTelemetryItem<TEndpointData>(expected);

Assert.AreEqual(expected.Sequence, actual.seq);
}
Expand All @@ -177,7 +177,7 @@ private void SerializeWritesInstrumentationKeyAsExpectedByEndpoint()
expected.Context.InstrumentationKey = Guid.NewGuid().ToString();
expected.Sanitize();

TelemetryItem<TEndpointData> actual = TelemetryItemTestHelper.SerializeDeserializeTelemetryItem<TTelemetry, TEndpointData>(expected);
TelemetryItem<TEndpointData> actual = TelemetryItemTestHelper.SerializeDeserializeTelemetryItem<TEndpointData>(expected);

Assert.AreEqual(expected.Context.InstrumentationKey, actual.iKey);
}
Expand All @@ -187,7 +187,7 @@ private void SerializeWritesDataBaseTypeAsExpectedByEndpoint()
var telemetry = new TTelemetry();
telemetry.Sanitize();

TelemetryItem<TEndpointData> envelope = TelemetryItemTestHelper.SerializeDeserializeTelemetryItem<TTelemetry, TEndpointData>(telemetry);
TelemetryItem<TEndpointData> envelope = TelemetryItemTestHelper.SerializeDeserializeTelemetryItem<TEndpointData>(telemetry);

string expectedBaseType = ExtractTelemetryNameFromType(typeof(TTelemetry)) + "Data";
Assert.AreEqual(expectedBaseType, envelope.data.baseType);
Expand All @@ -200,7 +200,7 @@ private void SerializeWritesTelemetryNameAsExpectedByEndpoint()
expected.Sanitize();

TelemetryItem<TEndpointData> actual = TelemetryItemTestHelper
.SerializeDeserializeTelemetryItem<TTelemetry, TEndpointData>(expected);
.SerializeDeserializeTelemetryItem<TEndpointData>(expected);

Assert.AreEqual(
Constants.TelemetryNamePrefix + "312cbd799dbb4c48a7da3cc2a931cb71." + this.ExtractTelemetryNameFromType(typeof(TTelemetry)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,32 @@
[TestClass]
public class AvailabilityTelemetryTest
{
[TestMethod]
public void AvailabilityTelemetryPropertiesFromContextAndItemSerializesToPropertiesInJson()
{
var expected = CreateAvailabilityTelemetry();

((ITelemetry)expected).Sanitize();

Assert.AreEqual(1, expected.Properties.Count);
Assert.AreEqual(1, expected.Context.GlobalProperties.Count);

Assert.IsTrue(expected.Properties.ContainsKey("TestProperty"));
Assert.IsTrue(expected.Context.GlobalProperties.ContainsKey("TestPropertyGlobal"));

var item = TelemetryItemTestHelper.SerializeDeserializeTelemetryItem<AI.AvailabilityData>(expected);

// Items added to both availability.Properties, and availability.Context.GlobalProperties are serialized to properties.
Assert.AreEqual(2, item.data.baseData.properties.Count);
Assert.IsTrue(item.data.baseData.properties.ContainsKey("TestPropertyGlobal"));
Assert.IsTrue(item.data.baseData.properties.ContainsKey("TestProperty"));
}

[TestMethod]
public void AvailabilityTelemetrySerializesToJson()
{
AvailabilityTelemetry expected = this.CreateAvailabilityTelemetry();
var item = TelemetryItemTestHelper.SerializeDeserializeTelemetryItem<AvailabilityTelemetry, AI.AvailabilityData>(expected);
var item = TelemetryItemTestHelper.SerializeDeserializeTelemetryItem<AI.AvailabilityData>(expected);

Assert.AreEqual<DateTimeOffset>(expected.Timestamp, DateTimeOffset.Parse(item.time, null, System.Globalization.DateTimeStyles.AssumeUniversal));
Assert.AreEqual(expected.Sequence, item.seq);
Expand Down Expand Up @@ -138,6 +159,7 @@ private AvailabilityTelemetry CreateAvailabilityTelemetry()
};
item.Context.InstrumentationKey = Guid.NewGuid().ToString();
item.Properties.Add("TestProperty", "TestValue");
item.Context.GlobalProperties.Add("TestPropertyGlobal", "TestValue");
item.Sequence = "12";

return item;
Expand Down
Loading

0 comments on commit 73770e7

Please sign in to comment.