diff --git a/tracer/build/PackageVersionsGeneratorDefinitions.json b/tracer/build/PackageVersionsGeneratorDefinitions.json index c75f371239b0..aed37044c6f9 100644 --- a/tracer/build/PackageVersionsGeneratorDefinitions.json +++ b/tracer/build/PackageVersionsGeneratorDefinitions.json @@ -102,14 +102,18 @@ "SampleProjectName": "Samples.MongoDB", "NugetPackageSearchName": "MongoDB.Driver", "MinVersion": "2.0.0", - "MaxVersionExclusive": "3.0.0", + "MaxVersionExclusive": "4.0.0", "SpecificVersions": [ "2.0.*", "2.5.*", "2.14.*", - "2.*.*" + "2.*.*", + "3.*.*" ], "VersionConditions": [{ + "MinVersion": "3.0.0", + "ExcludeTargetFrameworks": ["net462", "netcoreapp2.1", "netcoreapp3.0", "netcoreapp3.1"] + },{ "MaxVersionExclusive": "2.3.0", "IncludeOnlyTargetFrameworks": ["net462"] }] diff --git a/tracer/build/PackageVersionsLatestMajors.g.props b/tracer/build/PackageVersionsLatestMajors.g.props index 5dbe4d812795..1227fbc46a5f 100644 --- a/tracer/build/PackageVersionsLatestMajors.g.props +++ b/tracer/build/PackageVersionsLatestMajors.g.props @@ -330,30 +330,60 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely All Samples.MongoDB + + ApiVersion=3.0.0;RestoreRecursive=false;BuildProjectReferences=false + net5.0 + All + Samples.MongoDB + ApiVersion=2.30.0;RestoreRecursive=false;BuildProjectReferences=false net6.0 All Samples.MongoDB + + ApiVersion=3.0.0;RestoreRecursive=false;BuildProjectReferences=false + net6.0 + All + Samples.MongoDB + ApiVersion=2.30.0;RestoreRecursive=false;BuildProjectReferences=false net7.0 All Samples.MongoDB + + ApiVersion=3.0.0;RestoreRecursive=false;BuildProjectReferences=false + net7.0 + All + Samples.MongoDB + ApiVersion=2.30.0;RestoreRecursive=false;BuildProjectReferences=false net8.0 All Samples.MongoDB + + ApiVersion=3.0.0;RestoreRecursive=false;BuildProjectReferences=false + net8.0 + All + Samples.MongoDB + ApiVersion=2.30.0;RestoreRecursive=false;BuildProjectReferences=false net9.0 All Samples.MongoDB + + ApiVersion=3.0.0;RestoreRecursive=false;BuildProjectReferences=false + net9.0 + All + Samples.MongoDB + ApiVersion=7.17.5;RestoreRecursive=false;BuildProjectReferences=false net462 diff --git a/tracer/build/PackageVersionsLatestMinors.g.props b/tracer/build/PackageVersionsLatestMinors.g.props index 4a20b435baf9..f82089733620 100644 --- a/tracer/build/PackageVersionsLatestMinors.g.props +++ b/tracer/build/PackageVersionsLatestMinors.g.props @@ -1866,6 +1866,12 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely All Samples.MongoDB + + ApiVersion=3.0.0;RestoreRecursive=false;BuildProjectReferences=false + net5.0 + All + Samples.MongoDB + ApiVersion=2.3.0;RestoreRecursive=false;BuildProjectReferences=false net6.0 @@ -2034,6 +2040,12 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely All Samples.MongoDB + + ApiVersion=3.0.0;RestoreRecursive=false;BuildProjectReferences=false + net6.0 + All + Samples.MongoDB + ApiVersion=2.3.0;RestoreRecursive=false;BuildProjectReferences=false net7.0 @@ -2202,6 +2214,12 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely All Samples.MongoDB + + ApiVersion=3.0.0;RestoreRecursive=false;BuildProjectReferences=false + net7.0 + All + Samples.MongoDB + ApiVersion=2.3.0;RestoreRecursive=false;BuildProjectReferences=false net8.0 @@ -2370,6 +2388,12 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely All Samples.MongoDB + + ApiVersion=3.0.0;RestoreRecursive=false;BuildProjectReferences=false + net8.0 + All + Samples.MongoDB + ApiVersion=2.3.0;RestoreRecursive=false;BuildProjectReferences=false net9.0 @@ -2538,6 +2562,12 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely All Samples.MongoDB + + ApiVersion=3.0.0;RestoreRecursive=false;BuildProjectReferences=false + net9.0 + All + Samples.MongoDB + ApiVersion=7.0.1;RestoreRecursive=false;BuildProjectReferences=false net462 diff --git a/tracer/build/PackageVersionsLatestSpecific.g.props b/tracer/build/PackageVersionsLatestSpecific.g.props index 9c3ff55bbefb..dab6855f3a97 100644 --- a/tracer/build/PackageVersionsLatestSpecific.g.props +++ b/tracer/build/PackageVersionsLatestSpecific.g.props @@ -744,6 +744,12 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely All Samples.MongoDB + + ApiVersion=3.0.0;RestoreRecursive=false;BuildProjectReferences=false + net5.0 + All + Samples.MongoDB + ApiVersion=2.5.1;RestoreRecursive=false;BuildProjectReferences=false net6.0 @@ -762,6 +768,12 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely All Samples.MongoDB + + ApiVersion=3.0.0;RestoreRecursive=false;BuildProjectReferences=false + net6.0 + All + Samples.MongoDB + ApiVersion=2.5.1;RestoreRecursive=false;BuildProjectReferences=false net7.0 @@ -780,6 +792,12 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely All Samples.MongoDB + + ApiVersion=3.0.0;RestoreRecursive=false;BuildProjectReferences=false + net7.0 + All + Samples.MongoDB + ApiVersion=2.5.1;RestoreRecursive=false;BuildProjectReferences=false net8.0 @@ -798,6 +816,12 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely All Samples.MongoDB + + ApiVersion=3.0.0;RestoreRecursive=false;BuildProjectReferences=false + net8.0 + All + Samples.MongoDB + ApiVersion=2.5.1;RestoreRecursive=false;BuildProjectReferences=false net9.0 @@ -816,6 +840,12 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely All Samples.MongoDB + + ApiVersion=3.0.0;RestoreRecursive=false;BuildProjectReferences=false + net9.0 + All + Samples.MongoDB + ApiVersion=7.0.1;RestoreRecursive=false;BuildProjectReferences=false net462 diff --git a/tracer/build/_build/Honeypot/IntegrationGroups.cs b/tracer/build/_build/Honeypot/IntegrationGroups.cs index b763811a0684..4909af83077e 100644 --- a/tracer/build/_build/Honeypot/IntegrationGroups.cs +++ b/tracer/build/_build/Honeypot/IntegrationGroups.cs @@ -54,6 +54,7 @@ static IntegrationMap() NugetPackages.Add("Microsoft.Extensions.Logging", new [] { "Microsoft.Extensions.Logging" }); NugetPackages.Add("Microsoft.Extensions.Telemetry", new [] { "Microsoft.Extensions.Telemetry" }); NugetPackages.Add("Confluent.Kafka", new [] { "Confluent.Kafka" }); + NugetPackages.Add("MongoDB.Driver", new [] { "MongoDB.Driver" }); NugetPackages.Add("MongoDB.Driver.Core", new [] { "MongoDB.Driver.Core", "MongoDB.Driver" }); NugetPackages.Add("Microsoft.VisualStudio.TestPlatform.TestFramework", new [] { "Microsoft.VisualStudio.TestPlatform" }); NugetPackages.Add("Microsoft.VisualStudio.TestPlatform.Common", new [] { "Microsoft.VisualStudio.TestPlatform" }); diff --git a/tracer/build/supported_calltargets.g.json b/tracer/build/supported_calltargets.g.json index 7f46537f12bc..6800cad1749c 100644 --- a/tracer/build/supported_calltargets.g.json +++ b/tracer/build/supported_calltargets.g.json @@ -7952,7 +7952,7 @@ }, { "IntegrationName": "MongoDb", - "AssemblyName": "MongoDB.Driver.Core", + "AssemblyName": "MongoDB.Driver", "TargetTypeName": "MongoDB.Driver.Core.WireProtocol.CommandUsingCommandMessageWireProtocol`1", "TargetMethodName": "Execute", "TargetReturnType": "!0", @@ -7966,7 +7966,307 @@ "Item3": 0 }, "MaximumVersion": { + "Item1": 3, + "Item2": 65535, + "Item3": 65535 + }, + "InstrumentationTypeName": "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration", + "IntegrationKind": 0, + "IsAdoNetIntegration": false, + "InstrumentationCategory": 1 + }, + { + "IntegrationName": "MongoDb", + "AssemblyName": "MongoDB.Driver", + "TargetTypeName": "MongoDB.Driver.Core.WireProtocol.CommandUsingCommandMessageWireProtocol`1", + "TargetMethodName": "ExecuteAsync", + "TargetReturnType": "System.Threading.Tasks.Task`1[!0]", + "TargetParameterTypes": [ + "MongoDB.Driver.Core.Connections.IConnection", + "System.Threading.CancellationToken" + ], + "MinimumVersion": { + "Item1": 2, + "Item2": 1, + "Item3": 0 + }, + "MaximumVersion": { + "Item1": 3, + "Item2": 65535, + "Item3": 65535 + }, + "InstrumentationTypeName": "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration", + "IntegrationKind": 0, + "IsAdoNetIntegration": false, + "InstrumentationCategory": 1 + }, + { + "IntegrationName": "MongoDb", + "AssemblyName": "MongoDB.Driver", + "TargetTypeName": "MongoDB.Driver.Core.WireProtocol.CommandUsingQueryMessageWireProtocol`1", + "TargetMethodName": "Execute", + "TargetReturnType": "!0", + "TargetParameterTypes": [ + "MongoDB.Driver.Core.Connections.IConnection", + "System.Threading.CancellationToken" + ], + "MinimumVersion": { + "Item1": 2, + "Item2": 2, + "Item3": 0 + }, + "MaximumVersion": { + "Item1": 3, + "Item2": 65535, + "Item3": 65535 + }, + "InstrumentationTypeName": "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration", + "IntegrationKind": 0, + "IsAdoNetIntegration": false, + "InstrumentationCategory": 1 + }, + { + "IntegrationName": "MongoDb", + "AssemblyName": "MongoDB.Driver", + "TargetTypeName": "MongoDB.Driver.Core.WireProtocol.CommandUsingQueryMessageWireProtocol`1", + "TargetMethodName": "ExecuteAsync", + "TargetReturnType": "System.Threading.Tasks.Task`1[!0]", + "TargetParameterTypes": [ + "MongoDB.Driver.Core.Connections.IConnection", + "System.Threading.CancellationToken" + ], + "MinimumVersion": { + "Item1": 2, + "Item2": 1, + "Item3": 0 + }, + "MaximumVersion": { + "Item1": 3, + "Item2": 65535, + "Item3": 65535 + }, + "InstrumentationTypeName": "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration", + "IntegrationKind": 0, + "IsAdoNetIntegration": false, + "InstrumentationCategory": 1 + }, + { + "IntegrationName": "MongoDb", + "AssemblyName": "MongoDB.Driver", + "TargetTypeName": "MongoDB.Driver.Core.WireProtocol.CommandWireProtocol`1", + "TargetMethodName": "Execute", + "TargetReturnType": "!0", + "TargetParameterTypes": [ + "MongoDB.Driver.Core.Connections.IConnection", + "System.Threading.CancellationToken" + ], + "MinimumVersion": { + "Item1": 2, + "Item2": 2, + "Item3": 0 + }, + "MaximumVersion": { + "Item1": 3, + "Item2": 65535, + "Item3": 65535 + }, + "InstrumentationTypeName": "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration", + "IntegrationKind": 0, + "IsAdoNetIntegration": false, + "InstrumentationCategory": 1 + }, + { + "IntegrationName": "MongoDb", + "AssemblyName": "MongoDB.Driver", + "TargetTypeName": "MongoDB.Driver.Core.WireProtocol.CommandWireProtocol`1", + "TargetMethodName": "ExecuteAsync", + "TargetReturnType": "System.Threading.Tasks.Task`1[!0]", + "TargetParameterTypes": [ + "MongoDB.Driver.Core.Connections.IConnection", + "System.Threading.CancellationToken" + ], + "MinimumVersion": { + "Item1": 2, + "Item2": 1, + "Item3": 0 + }, + "MaximumVersion": { + "Item1": 3, + "Item2": 65535, + "Item3": 65535 + }, + "InstrumentationTypeName": "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration", + "IntegrationKind": 0, + "IsAdoNetIntegration": false, + "InstrumentationCategory": 1 + }, + { + "IntegrationName": "MongoDb", + "AssemblyName": "MongoDB.Driver", + "TargetTypeName": "MongoDB.Driver.Core.WireProtocol.GetMoreWireProtocol`1", + "TargetMethodName": "Execute", + "TargetReturnType": "!0", + "TargetParameterTypes": [ + "MongoDB.Driver.Core.Connections.IConnection", + "System.Threading.CancellationToken" + ], + "MinimumVersion": { + "Item1": 2, + "Item2": 2, + "Item3": 0 + }, + "MaximumVersion": { + "Item1": 3, + "Item2": 65535, + "Item3": 65535 + }, + "InstrumentationTypeName": "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration", + "IntegrationKind": 0, + "IsAdoNetIntegration": false, + "InstrumentationCategory": 1 + }, + { + "IntegrationName": "MongoDb", + "AssemblyName": "MongoDB.Driver", + "TargetTypeName": "MongoDB.Driver.Core.WireProtocol.GetMoreWireProtocol`1", + "TargetMethodName": "ExecuteAsync", + "TargetReturnType": "System.Threading.Tasks.Task`1[!0]", + "TargetParameterTypes": [ + "MongoDB.Driver.Core.Connections.IConnection", + "System.Threading.CancellationToken" + ], + "MinimumVersion": { + "Item1": 2, + "Item2": 1, + "Item3": 0 + }, + "MaximumVersion": { + "Item1": 3, + "Item2": 65535, + "Item3": 65535 + }, + "InstrumentationTypeName": "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration", + "IntegrationKind": 0, + "IsAdoNetIntegration": false, + "InstrumentationCategory": 1 + }, + { + "IntegrationName": "MongoDb", + "AssemblyName": "MongoDB.Driver", + "TargetTypeName": "MongoDB.Driver.Core.WireProtocol.QueryWireProtocol`1", + "TargetMethodName": "Execute", + "TargetReturnType": "!0", + "TargetParameterTypes": [ + "MongoDB.Driver.Core.Connections.IConnection", + "System.Threading.CancellationToken" + ], + "MinimumVersion": { + "Item1": 2, + "Item2": 2, + "Item3": 0 + }, + "MaximumVersion": { + "Item1": 3, + "Item2": 65535, + "Item3": 65535 + }, + "InstrumentationTypeName": "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration", + "IntegrationKind": 0, + "IsAdoNetIntegration": false, + "InstrumentationCategory": 1 + }, + { + "IntegrationName": "MongoDb", + "AssemblyName": "MongoDB.Driver", + "TargetTypeName": "MongoDB.Driver.Core.WireProtocol.QueryWireProtocol`1", + "TargetMethodName": "ExecuteAsync", + "TargetReturnType": "System.Threading.Tasks.Task`1[!0]", + "TargetParameterTypes": [ + "MongoDB.Driver.Core.Connections.IConnection", + "System.Threading.CancellationToken" + ], + "MinimumVersion": { + "Item1": 2, + "Item2": 1, + "Item3": 0 + }, + "MaximumVersion": { + "Item1": 3, + "Item2": 65535, + "Item3": 65535 + }, + "InstrumentationTypeName": "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration", + "IntegrationKind": 0, + "IsAdoNetIntegration": false, + "InstrumentationCategory": 1 + }, + { + "IntegrationName": "MongoDb", + "AssemblyName": "MongoDB.Driver", + "TargetTypeName": "MongoDB.Driver.Core.WireProtocol.WriteWireProtocolBase`1", + "TargetMethodName": "Execute", + "TargetReturnType": "!0", + "TargetParameterTypes": [ + "MongoDB.Driver.Core.Connections.IConnection", + "System.Threading.CancellationToken" + ], + "MinimumVersion": { + "Item1": 2, + "Item2": 2, + "Item3": 0 + }, + "MaximumVersion": { + "Item1": 3, + "Item2": 65535, + "Item3": 65535 + }, + "InstrumentationTypeName": "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration", + "IntegrationKind": 0, + "IsAdoNetIntegration": false, + "InstrumentationCategory": 1 + }, + { + "IntegrationName": "MongoDb", + "AssemblyName": "MongoDB.Driver", + "TargetTypeName": "MongoDB.Driver.Core.WireProtocol.WriteWireProtocolBase`1", + "TargetMethodName": "ExecuteAsync", + "TargetReturnType": "System.Threading.Tasks.Task`1[!0]", + "TargetParameterTypes": [ + "MongoDB.Driver.Core.Connections.IConnection", + "System.Threading.CancellationToken" + ], + "MinimumVersion": { + "Item1": 2, + "Item2": 1, + "Item3": 0 + }, + "MaximumVersion": { + "Item1": 3, + "Item2": 65535, + "Item3": 65535 + }, + "InstrumentationTypeName": "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration", + "IntegrationKind": 0, + "IsAdoNetIntegration": false, + "InstrumentationCategory": 1 + }, + { + "IntegrationName": "MongoDb", + "AssemblyName": "MongoDB.Driver.Core", + "TargetTypeName": "MongoDB.Driver.Core.WireProtocol.CommandUsingCommandMessageWireProtocol`1", + "TargetMethodName": "Execute", + "TargetReturnType": "!0", + "TargetParameterTypes": [ + "MongoDB.Driver.Core.Connections.IConnection", + "System.Threading.CancellationToken" + ], + "MinimumVersion": { "Item1": 2, + "Item2": 2, + "Item3": 0 + }, + "MaximumVersion": { + "Item1": 3, "Item2": 65535, "Item3": 65535 }, @@ -7991,7 +8291,7 @@ "Item3": 0 }, "MaximumVersion": { - "Item1": 2, + "Item1": 3, "Item2": 65535, "Item3": 65535 }, @@ -8016,7 +8316,7 @@ "Item3": 0 }, "MaximumVersion": { - "Item1": 2, + "Item1": 3, "Item2": 65535, "Item3": 65535 }, @@ -8041,7 +8341,7 @@ "Item3": 0 }, "MaximumVersion": { - "Item1": 2, + "Item1": 3, "Item2": 65535, "Item3": 65535 }, @@ -8066,7 +8366,7 @@ "Item3": 0 }, "MaximumVersion": { - "Item1": 2, + "Item1": 3, "Item2": 65535, "Item3": 65535 }, @@ -8091,7 +8391,7 @@ "Item3": 0 }, "MaximumVersion": { - "Item1": 2, + "Item1": 3, "Item2": 65535, "Item3": 65535 }, @@ -8116,7 +8416,7 @@ "Item3": 0 }, "MaximumVersion": { - "Item1": 2, + "Item1": 3, "Item2": 65535, "Item3": 65535 }, @@ -8141,7 +8441,7 @@ "Item3": 0 }, "MaximumVersion": { - "Item1": 2, + "Item1": 3, "Item2": 65535, "Item3": 65535 }, @@ -8216,7 +8516,7 @@ "Item3": 0 }, "MaximumVersion": { - "Item1": 2, + "Item1": 3, "Item2": 65535, "Item3": 65535 }, @@ -8241,7 +8541,7 @@ "Item3": 0 }, "MaximumVersion": { - "Item1": 2, + "Item1": 3, "Item2": 65535, "Item3": 65535 }, @@ -8266,7 +8566,7 @@ "Item3": 0 }, "MaximumVersion": { - "Item1": 2, + "Item1": 3, "Item2": 65535, "Item3": 65535 }, @@ -8291,7 +8591,7 @@ "Item3": 0 }, "MaximumVersion": { - "Item1": 2, + "Item1": 3, "Item2": 65535, "Item3": 65535 }, diff --git a/tracer/build/supported_versions.json b/tracer/build/supported_versions.json index e0b28293e5a8..b76b381778bd 100644 --- a/tracer/build/supported_versions.json +++ b/tracer/build/supported_versions.json @@ -804,7 +804,7 @@ "minVersionTestedInclusive": "2.0.2", "maxVersionSupportedInclusive": "2.30.0", "maxVersionAvailableInclusive": "3.0.0", - "maxVersionTestedInclusive": "2.30.0" + "maxVersionTestedInclusive": "3.0.0" }, { "name": "MongoDB.Driver.Core", diff --git a/tracer/dependabot/Datadog.Dependabot.Integrations.csproj b/tracer/dependabot/Datadog.Dependabot.Integrations.csproj index 665c8863511b..f09aaa4e415c 100644 --- a/tracer/dependabot/Datadog.Dependabot.Integrations.csproj +++ b/tracer/dependabot/Datadog.Dependabot.Integrations.csproj @@ -206,7 +206,7 @@ - + diff --git a/tracer/src/Datadog.Trace.Trimming/build/Datadog.Trace.Trimming.xml b/tracer/src/Datadog.Trace.Trimming/build/Datadog.Trace.Trimming.xml index 8712f01fda36..1fa053f8bb96 100644 --- a/tracer/src/Datadog.Trace.Trimming/build/Datadog.Trace.Trimming.xml +++ b/tracer/src/Datadog.Trace.Trimming/build/Datadog.Trace.Trimming.xml @@ -109,6 +109,7 @@ + diff --git a/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/MongoDb/BsonSerialization/BsonSerializationHelper.cs b/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/MongoDb/BsonSerialization/BsonSerializationHelper.cs index fa6f16720210..192aa9c2c191 100644 --- a/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/MongoDb/BsonSerialization/BsonSerializationHelper.cs +++ b/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/MongoDb/BsonSerialization/BsonSerializationHelper.cs @@ -72,11 +72,22 @@ private static void SerializeWithCustomWriter(object obj, StringBuilder sb, Bson // Create a "real" JsonWriter var jsonWriterSettings = helper.JsonWriterSettingsProxy.Defaults; - var jsonWriter = helper.CreateJsonWriterFunc(stringWriter, jsonWriterSettings).DuckCast(); + var realJsonWriter = helper.CreateJsonWriterFunc(stringWriter, jsonWriterSettings); // Wrap the real writer with our custom proxy that has extra behaviours - var customBsonWriter = new MongoBsonWriter(jsonWriter, jsonWriterSettings); - var customWriterProxy = customBsonWriter.DuckImplement(helper.IBsonWriterType); + object customWriterProxy; + if (helper.IsV3Bson) + { + var jsonWriter = realJsonWriter.DuckCast(); + var customBsonWriter = new MongoBsonWriterV3(jsonWriter, jsonWriterSettings); + customWriterProxy = customBsonWriter.DuckImplement(helper.IBsonWriterType); + } + else + { + var jsonWriter = realJsonWriter.DuckCast(); + var customBsonWriter = new MongoBsonWriter(jsonWriter, jsonWriterSettings); + customWriterProxy = customBsonWriter.DuckImplement(helper.IBsonWriterType); + } // Find the serializer and serializer var nominalType = obj.GetType(); @@ -97,6 +108,7 @@ private class BsonHelper internal readonly Func CreateJsonWriterFunc; internal readonly Func CreateBsonSerializationArgsFunc; internal readonly Type IBsonWriterType; + internal readonly bool IsV3Bson; private BsonHelper( IBsonSerializationContextProxy bsonSerializationContextProxy, @@ -104,7 +116,8 @@ private BsonHelper( IBsonSerializerLookupProxy bsonSerializerLookupProxy, Func createJsonWriterFunc, Func createBsonSerializationArgsFunc, - Type ibsonWriterType) + Type ibsonWriterType, + bool isV3Bson) { BsonSerializationContextProxy = bsonSerializationContextProxy; JsonWriterSettingsProxy = jsonWriterSettingsProxy; @@ -112,6 +125,7 @@ private BsonHelper( CreateJsonWriterFunc = createJsonWriterFunc; CreateBsonSerializationArgsFunc = createBsonSerializationArgsFunc; IBsonWriterType = ibsonWriterType; + IsV3Bson = isV3Bson; } public static BsonHelper? Create() @@ -167,6 +181,9 @@ private BsonHelper( return null; } + // in v3+ IBsonWriter has extra methods, so we need to handle that differently + var isV3Bson = ibsonWriterType.GetMethod(nameof(IBsonWriterProxyV3.WriteGuid), [typeof(Guid)]) is not null; + // We found all the required types, now try to create the proxies/activators var proxyResult = DuckType.GetOrCreateProxyType(typeof(IBsonSerializerLookupProxy), bsonSerializerType); if (!proxyResult.Success) @@ -237,7 +254,8 @@ private BsonHelper( bsonSerializerLookupProxy: bsonSerializerLookupProxy, createJsonWriterFunc: createJsonWriterFunc, createBsonSerializationArgsFunc: createBsonSerializationArgsFunc, - ibsonWriterType: ibsonWriterType); + ibsonWriterType: ibsonWriterType, + isV3Bson: isV3Bson); // smoke test - we don't verify the Duck types until we actually try to create a proxy, // so we do it once here, just to confirm that it will work later diff --git a/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/MongoDb/BsonSerialization/IBsonWriterProxyV3.cs b/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/MongoDb/BsonSerialization/IBsonWriterProxyV3.cs new file mode 100644 index 000000000000..7d04fdd627f0 --- /dev/null +++ b/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/MongoDb/BsonSerialization/IBsonWriterProxyV3.cs @@ -0,0 +1,31 @@ +// +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc. +// + +#nullable enable + +using System; +using Datadog.Trace.DuckTyping; + +namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.BsonSerialization; + +/// +/// Duck Typing interface proxy for: https://github.com/mongodb/mongo-csharp-driver/blob/5edf5ba9941f170ecc6956005398a8736f12e38a/src/MongoDB.Bson/IO/IBsonWriter.cs +/// +internal interface IBsonWriterProxyV3 : IBsonWriterProxy +{ + /// + /// Writes a Guid in Standard representation to the writer. + /// + /// The Guid value. + void WriteGuid(Guid guid); + + /// + /// Writes a Guid in the specified representation to the writer. + /// + /// The Guid value. + /// The GuidRepresentation. + [Duck(ParameterTypeNames = [ClrNames.Guid, "MongoDB.Bson.GuidRepresentation"])] + void WriteGuid(Guid guid, int guidRepresentation); +} diff --git a/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/MongoDb/BsonSerialization/MongoBsonWriterV3.cs b/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/MongoDb/BsonSerialization/MongoBsonWriterV3.cs new file mode 100644 index 000000000000..0cc2fa494c7c --- /dev/null +++ b/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/MongoDb/BsonSerialization/MongoBsonWriterV3.cs @@ -0,0 +1,146 @@ +// +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc. +// + +#nullable enable + +using System; +using Datadog.Trace.DuckTyping; + +namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.BsonSerialization; + +/// +/// Reverse duck Typing interface proxy for: https://github.com/mongodb/mongo-csharp-driver/blob/5edf5ba9941f170ecc6956005398a8736f12e38a/src/MongoDB.Bson/IO/IBsonWriter.cs +/// +internal class MongoBsonWriterV3 +{ + private readonly IBsonWriterProxyV3 _bsonWriterProxy; + private readonly MongoBsonWriter _innerWriter; + + public MongoBsonWriterV3(IBsonWriterProxyV3 bsonWriterProxy, object jsonWriterSettings) + { + _bsonWriterProxy = bsonWriterProxy; + // To avoid duplicating implementation, we delegate to the existing v2 implementation for most of the behaviour + _innerWriter = new MongoBsonWriter(bsonWriterProxy, jsonWriterSettings); + } + + [DuckReverseMethod] + public long Position => _innerWriter.Position; + + [DuckReverseMethod] + public int SerializationDepth => _innerWriter.SerializationDepth; + + [DuckReverseMethod] + public object State => _innerWriter.State; + + [DuckReverseMethod] + public object Settings => _innerWriter.Settings; + + // These are the only two v3-specific methods + [DuckReverseMethod] + public void WriteGuid(Guid guid) => _bsonWriterProxy.WriteGuid(guid); + + [DuckReverseMethod(ParameterTypeNames = [ClrNames.Guid, "MongoDB.Bson.GuidRepresentation"])] + public void WriteGuid(Guid guid, int guidRepresentation) => _bsonWriterProxy.WriteGuid(guid); + + // The rest of these are wrappers around the v2 behaviour, just to avoid duplication + [DuckReverseMethod] + public void Close() => _innerWriter.Close(); + + [DuckReverseMethod] + public void Flush() => _innerWriter.Flush(); + + [DuckReverseMethod] + public void PopElementNameValidator() => _innerWriter.PopElementNameValidator(); + + [DuckReverseMethod] + public void PopSettings() => _innerWriter.PopSettings(); + + [DuckReverseMethod] + public void PushElementNameValidator(object validator) => _innerWriter.PushElementNameValidator(validator); + + [DuckReverseMethod] + public void PushSettings(object configurator) => _innerWriter.PushSettings(configurator); + + [DuckReverseMethod] + public void WriteBinaryData(IBsonBinaryDataProxy binaryData) => _innerWriter.WriteBinaryData(binaryData); + + [DuckReverseMethod] + public void WriteBoolean(bool value) => _innerWriter.WriteBoolean(value); + + [DuckReverseMethod] + public void WriteBytes(byte[] bytes) => _innerWriter.WriteBytes(bytes); + + [DuckReverseMethod] + public void WriteDateTime(long value) => _innerWriter.WriteDateTime(value); + + [DuckReverseMethod] + public void WriteDecimal128(object value) => _innerWriter.WriteDecimal128(value); + + [DuckReverseMethod] + public void WriteDouble(double value) => _innerWriter.WriteDouble(value); + + [DuckReverseMethod] + public void WriteEndArray() => _innerWriter.WriteEndArray(); + + [DuckReverseMethod] + public void WriteEndDocument() => _innerWriter.WriteEndDocument(); + + [DuckReverseMethod] + public void WriteInt32(int value) => _innerWriter.WriteInt32(value); + + [DuckReverseMethod] + public void WriteInt64(long value) => _innerWriter.WriteInt64(value); + + [DuckReverseMethod] + public void WriteJavaScript(string code) => _innerWriter.WriteJavaScript(code); + + [DuckReverseMethod] + public void WriteJavaScriptWithScope(string code) => _innerWriter.WriteJavaScriptWithScope(code); + + [DuckReverseMethod] + public void WriteMaxKey() => _innerWriter.WriteMaxKey(); + + [DuckReverseMethod] + public void WriteMinKey() => _innerWriter.WriteMinKey(); + + [DuckReverseMethod] + public void WriteName(string name) => _innerWriter.WriteName(name); + + [DuckReverseMethod] + public void WriteNull() => _innerWriter.WriteNull(); + + [DuckReverseMethod] + public void WriteObjectId(object objectId) => _innerWriter.WriteObjectId(objectId); + + [DuckReverseMethod] + public void WriteRawBsonArray(object slice) => _innerWriter.WriteRawBsonArray(slice); + + [DuckReverseMethod] + public void WriteRawBsonDocument(object slice) => _innerWriter.WriteRawBsonDocument(slice); + + [DuckReverseMethod] + public void WriteRegularExpression(object regex) => _innerWriter.WriteRegularExpression(regex); + + [DuckReverseMethod] + public void WriteStartArray() => _innerWriter.WriteStartArray(); + + [DuckReverseMethod] + public void WriteStartDocument() => _innerWriter.WriteStartDocument(); + + [DuckReverseMethod] + public void WriteString(string value) => _innerWriter.WriteString(value); + + [DuckReverseMethod] + public void WriteSymbol(string value) => _innerWriter.WriteSymbol(value); + + [DuckReverseMethod] + public void WriteTimestamp(long value) => _innerWriter.WriteTimestamp(value); + + [DuckReverseMethod] + public void WriteUndefined() => _innerWriter.WriteUndefined(); + + [DuckReverseMethod] + public void Dispose() => _innerWriter.Dispose(); +} diff --git a/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/MongoDb/IWireProtocol_ExecuteAsync_Integration.cs b/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/MongoDb/IWireProtocol_ExecuteAsync_Integration.cs index 807b506a05ca..6c29811ed908 100644 --- a/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/MongoDb/IWireProtocol_ExecuteAsync_Integration.cs +++ b/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/MongoDb/IWireProtocol_ExecuteAsync_Integration.cs @@ -17,10 +17,10 @@ namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb /// #pragma warning disable SA1118 // parameter spans multiple lines [InstrumentMethod( - AssemblyName = MongoDbIntegration.MongoDbClientAssembly, + AssemblyNames = [MongoDbIntegration.MongoDbClientV2Assembly, MongoDbIntegration.MongoDbClientV3Assembly], IntegrationName = MongoDbIntegration.IntegrationName, MinimumVersion = MongoDbIntegration.Major2Minor1, - MaximumVersion = MongoDbIntegration.Major2, + MaximumVersion = MongoDbIntegration.Major3, MethodName = "ExecuteAsync", ParameterTypeNames = new[] { "MongoDB.Driver.Core.Connections.IConnection", ClrNames.CancellationToken }, ReturnTypeName = ClrNames.GenericTaskWithGenericClassParameter, @@ -35,10 +35,10 @@ namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb })] #pragma warning restore SA1118 [InstrumentMethod( - AssemblyName = MongoDbIntegration.MongoDbClientAssembly, + AssemblyName = MongoDbIntegration.MongoDbClientV2Assembly, IntegrationName = MongoDbIntegration.IntegrationName, MinimumVersion = MongoDbIntegration.Major2Minor1, - MaximumVersion = MongoDbIntegration.Major2, + MaximumVersion = MongoDbIntegration.Major2, // not available in 2.15+ so not available in 3.x MethodName = "ExecuteAsync", ParameterTypeNames = new[] { "MongoDB.Driver.Core.Connections.IConnection", ClrNames.CancellationToken }, ReturnTypeName = "System.Threading.Tasks.Task", diff --git a/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/MongoDb/IWireProtocol_Execute_Integration.cs b/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/MongoDb/IWireProtocol_Execute_Integration.cs index a90277b7abbc..ba438c000c70 100644 --- a/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/MongoDb/IWireProtocol_Execute_Integration.cs +++ b/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/MongoDb/IWireProtocol_Execute_Integration.cs @@ -16,10 +16,10 @@ namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb /// MongoDB.Driver.Core.WireProtocol.IWireProtocol instrumentation /// [InstrumentMethod( - AssemblyName = MongoDbIntegration.MongoDbClientAssembly, + AssemblyName = MongoDbIntegration.MongoDbClientV2Assembly, IntegrationName = MongoDbIntegration.IntegrationName, MinimumVersion = MongoDbIntegration.Major2Minor2, - MaximumVersion = MongoDbIntegration.Major2, + MaximumVersion = MongoDbIntegration.Major2, // not available in 2.15+ so not available in 3.x MethodName = "Execute", ParameterTypeNames = new[] { "MongoDB.Driver.Core.Connections.IConnection", ClrNames.CancellationToken }, TypeName = "MongoDB.Driver.Core.WireProtocol.KillCursorsWireProtocol", diff --git a/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/MongoDb/IWireProtocol_Generic_Execute_Integration.cs b/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/MongoDb/IWireProtocol_Generic_Execute_Integration.cs index d4e11e126c01..c9298d87a52f 100644 --- a/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/MongoDb/IWireProtocol_Generic_Execute_Integration.cs +++ b/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/MongoDb/IWireProtocol_Generic_Execute_Integration.cs @@ -17,10 +17,10 @@ namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb /// #pragma warning disable SA1118 // parameter shouldn't span multiple lines [InstrumentMethod( - AssemblyName = MongoDbIntegration.MongoDbClientAssembly, + AssemblyNames = [MongoDbIntegration.MongoDbClientV2Assembly, MongoDbIntegration.MongoDbClientV3Assembly], IntegrationName = MongoDbIntegration.IntegrationName, MinimumVersion = MongoDbIntegration.Major2Minor2, - MaximumVersion = MongoDbIntegration.Major2, + MaximumVersion = MongoDbIntegration.Major3, MethodName = "Execute", ParameterTypeNames = new[] { "MongoDB.Driver.Core.Connections.IConnection", ClrNames.CancellationToken }, ReturnTypeName = "!0", diff --git a/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/MongoDb/MongoDbIntegration.cs b/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/MongoDb/MongoDbIntegration.cs index 826dc6a1d520..f1949001921a 100644 --- a/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/MongoDb/MongoDbIntegration.cs +++ b/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/MongoDb/MongoDbIntegration.cs @@ -22,9 +22,11 @@ internal static class MongoDbIntegration internal const string IntegrationName = nameof(Configuration.IntegrationId.MongoDb); internal const string Major2 = "2"; + internal const string Major3 = "3"; internal const string Major2Minor1 = "2.1"; internal const string Major2Minor2 = "2.2"; // Synchronous methods added in 2.2 - internal const string MongoDbClientAssembly = "MongoDB.Driver.Core"; + internal const string MongoDbClientV2Assembly = "MongoDB.Driver.Core"; + internal const string MongoDbClientV3Assembly = "MongoDB.Driver"; private const string DatabaseType = "mongodb"; diff --git a/tracer/src/Datadog.Trace/ClrProfiler/ClrNames.cs b/tracer/src/Datadog.Trace/ClrProfiler/ClrNames.cs index 4e599025f669..b82976274b29 100644 --- a/tracer/src/Datadog.Trace/ClrProfiler/ClrNames.cs +++ b/tracer/src/Datadog.Trace/ClrProfiler/ClrNames.cs @@ -13,6 +13,7 @@ internal static class ClrNames public const string Object = "System.Object"; public const string Bool = "System.Boolean"; public const string String = "System.String"; + public const string Guid = "System.Guid"; public const string SByte = "System.SByte"; public const string Byte = "System.Byte"; diff --git a/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs b/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs index 81cc78c0c3a1..aa81faa1d5cb 100644 --- a/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs +++ b/tracer/src/Datadog.Trace/Generated/net461/Datadog.Trace.SourceGenerators/InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs @@ -38,6 +38,7 @@ internal static bool IsInstrumentedAssembly(string assemblyName) || assemblyName.StartsWith("Grpc.Core,", StringComparison.Ordinal) || assemblyName.StartsWith("HotChocolate.Execution,", StringComparison.Ordinal) || assemblyName.StartsWith("log4net,", StringComparison.Ordinal) + || assemblyName.StartsWith("MongoDB.Driver,", StringComparison.Ordinal) || assemblyName.StartsWith("MongoDB.Driver.Core,", StringComparison.Ordinal) || assemblyName.StartsWith("MySql.Data,", StringComparison.Ordinal) || assemblyName.StartsWith("MySqlConnector,", StringComparison.Ordinal) @@ -352,6 +353,18 @@ internal static bool IsInstrumentedAssembly(string assemblyName) or "Datadog.Trace.ClrProfiler.AutoInstrumentation.Log4Net.AppenderAttachedImplIntegration" => Datadog.Trace.Configuration.IntegrationId.Log4Net, "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration" or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration" or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration" or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration" diff --git a/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs b/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs index d592030b9744..056c1887a9e9 100644 --- a/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs +++ b/tracer/src/Datadog.Trace/Generated/net6.0/Datadog.Trace.SourceGenerators/InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs @@ -41,6 +41,7 @@ internal static bool IsInstrumentedAssembly(string assemblyName) || assemblyName.StartsWith("Grpc.Net.Client,", StringComparison.Ordinal) || assemblyName.StartsWith("HotChocolate.Execution,", StringComparison.Ordinal) || assemblyName.StartsWith("log4net,", StringComparison.Ordinal) + || assemblyName.StartsWith("MongoDB.Driver,", StringComparison.Ordinal) || assemblyName.StartsWith("MongoDB.Driver.Core,", StringComparison.Ordinal) || assemblyName.StartsWith("MySql.Data,", StringComparison.Ordinal) || assemblyName.StartsWith("MySqlConnector,", StringComparison.Ordinal) @@ -381,6 +382,18 @@ internal static bool IsInstrumentedAssembly(string assemblyName) or "Datadog.Trace.ClrProfiler.AutoInstrumentation.Log4Net.AppenderAttachedImplIntegration" => Datadog.Trace.Configuration.IntegrationId.Log4Net, "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration" or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration" or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration" or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration" diff --git a/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs b/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs index 273482fcafb9..22772501bac7 100644 --- a/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs +++ b/tracer/src/Datadog.Trace/Generated/netcoreapp3.1/Datadog.Trace.SourceGenerators/InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs @@ -40,6 +40,7 @@ internal static bool IsInstrumentedAssembly(string assemblyName) || assemblyName.StartsWith("Grpc.Net.Client,", StringComparison.Ordinal) || assemblyName.StartsWith("HotChocolate.Execution,", StringComparison.Ordinal) || assemblyName.StartsWith("log4net,", StringComparison.Ordinal) + || assemblyName.StartsWith("MongoDB.Driver,", StringComparison.Ordinal) || assemblyName.StartsWith("MongoDB.Driver.Core,", StringComparison.Ordinal) || assemblyName.StartsWith("MySql.Data,", StringComparison.Ordinal) || assemblyName.StartsWith("MySqlConnector,", StringComparison.Ordinal) @@ -376,6 +377,18 @@ internal static bool IsInstrumentedAssembly(string assemblyName) or "Datadog.Trace.ClrProfiler.AutoInstrumentation.Log4Net.AppenderAttachedImplIntegration" => Datadog.Trace.Configuration.IntegrationId.Log4Net, "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration" or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration" or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration" or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration" diff --git a/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs b/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs index 273482fcafb9..22772501bac7 100644 --- a/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs +++ b/tracer/src/Datadog.Trace/Generated/netstandard2.0/Datadog.Trace.SourceGenerators/InstrumentationDefinitionsGenerator/InstrumentationDefinitions.g.cs @@ -40,6 +40,7 @@ internal static bool IsInstrumentedAssembly(string assemblyName) || assemblyName.StartsWith("Grpc.Net.Client,", StringComparison.Ordinal) || assemblyName.StartsWith("HotChocolate.Execution,", StringComparison.Ordinal) || assemblyName.StartsWith("log4net,", StringComparison.Ordinal) + || assemblyName.StartsWith("MongoDB.Driver,", StringComparison.Ordinal) || assemblyName.StartsWith("MongoDB.Driver.Core,", StringComparison.Ordinal) || assemblyName.StartsWith("MySql.Data,", StringComparison.Ordinal) || assemblyName.StartsWith("MySqlConnector,", StringComparison.Ordinal) @@ -376,6 +377,18 @@ internal static bool IsInstrumentedAssembly(string assemblyName) or "Datadog.Trace.ClrProfiler.AutoInstrumentation.Log4Net.AppenderAttachedImplIntegration" => Datadog.Trace.Configuration.IntegrationId.Log4Net, "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration" + or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration" or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration" or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration" or "Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration" diff --git a/tracer/src/Datadog.Tracer.Native/Generated/generated_calltargets.g.h b/tracer/src/Datadog.Tracer.Native/Generated/generated_calltargets.g.h index 728665f3e648..79f50343daaa 100644 --- a/tracer/src/Datadog.Tracer.Native/Generated/generated_calltargets.g.h +++ b/tracer/src/Datadog.Tracer.Native/Generated/generated_calltargets.g.h @@ -639,20 +639,32 @@ std::vector g_callTargets= {(WCHAR*)WStr("log4net"),(WCHAR*)WStr("log4net.Appender.AppenderCollection"),(WCHAR*)WStr("ToArray"),g_callTargets_Sig_054,1,2,0,0,3,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.Logging.Log4Net.DirectSubmission.AppenderCollectionIntegration"),CallTargetKind::Default,1,165}, {(WCHAR*)WStr("log4net"),(WCHAR*)WStr("log4net.Appender.AppenderCollection"),(WCHAR*)WStr("ToArray"),g_callTargets_Sig_054,1,1,0,0,1,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.Logging.Log4Net.DirectSubmission.AppenderCollectionLegacyIntegration"),CallTargetKind::Default,1,165}, {(WCHAR*)WStr("log4net"),(WCHAR*)WStr("log4net.Util.AppenderAttachedImpl"),(WCHAR*)WStr("AppendLoopOnAppenders"),g_callTargets_Sig_118,2,1,0,0,3,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.Log4Net.AppenderAttachedImplIntegration"),CallTargetKind::Default,1,165}, -{(WCHAR*)WStr("MongoDB.Driver.Core"),(WCHAR*)WStr("MongoDB.Driver.Core.WireProtocol.CommandUsingCommandMessageWireProtocol`1"),(WCHAR*)WStr("Execute"),g_callTargets_Sig_006,3,2,2,0,2,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration"),CallTargetKind::Default,1,165}, -{(WCHAR*)WStr("MongoDB.Driver.Core"),(WCHAR*)WStr("MongoDB.Driver.Core.WireProtocol.CommandUsingCommandMessageWireProtocol`1"),(WCHAR*)WStr("ExecuteAsync"),g_callTargets_Sig_178,3,2,1,0,2,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration"),CallTargetKind::Default,1,165}, -{(WCHAR*)WStr("MongoDB.Driver.Core"),(WCHAR*)WStr("MongoDB.Driver.Core.WireProtocol.CommandUsingQueryMessageWireProtocol`1"),(WCHAR*)WStr("Execute"),g_callTargets_Sig_006,3,2,2,0,2,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration"),CallTargetKind::Default,1,165}, -{(WCHAR*)WStr("MongoDB.Driver.Core"),(WCHAR*)WStr("MongoDB.Driver.Core.WireProtocol.CommandUsingQueryMessageWireProtocol`1"),(WCHAR*)WStr("ExecuteAsync"),g_callTargets_Sig_178,3,2,1,0,2,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration"),CallTargetKind::Default,1,165}, -{(WCHAR*)WStr("MongoDB.Driver.Core"),(WCHAR*)WStr("MongoDB.Driver.Core.WireProtocol.CommandWireProtocol`1"),(WCHAR*)WStr("Execute"),g_callTargets_Sig_006,3,2,2,0,2,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration"),CallTargetKind::Default,1,165}, -{(WCHAR*)WStr("MongoDB.Driver.Core"),(WCHAR*)WStr("MongoDB.Driver.Core.WireProtocol.CommandWireProtocol`1"),(WCHAR*)WStr("ExecuteAsync"),g_callTargets_Sig_178,3,2,1,0,2,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration"),CallTargetKind::Default,1,165}, -{(WCHAR*)WStr("MongoDB.Driver.Core"),(WCHAR*)WStr("MongoDB.Driver.Core.WireProtocol.GetMoreWireProtocol`1"),(WCHAR*)WStr("Execute"),g_callTargets_Sig_006,3,2,2,0,2,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration"),CallTargetKind::Default,1,165}, -{(WCHAR*)WStr("MongoDB.Driver.Core"),(WCHAR*)WStr("MongoDB.Driver.Core.WireProtocol.GetMoreWireProtocol`1"),(WCHAR*)WStr("ExecuteAsync"),g_callTargets_Sig_178,3,2,1,0,2,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration"),CallTargetKind::Default,1,165}, +{(WCHAR*)WStr("MongoDB.Driver"),(WCHAR*)WStr("MongoDB.Driver.Core.WireProtocol.CommandUsingCommandMessageWireProtocol`1"),(WCHAR*)WStr("Execute"),g_callTargets_Sig_006,3,2,2,0,3,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration"),CallTargetKind::Default,1,165}, +{(WCHAR*)WStr("MongoDB.Driver"),(WCHAR*)WStr("MongoDB.Driver.Core.WireProtocol.CommandUsingCommandMessageWireProtocol`1"),(WCHAR*)WStr("ExecuteAsync"),g_callTargets_Sig_178,3,2,1,0,3,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration"),CallTargetKind::Default,1,165}, +{(WCHAR*)WStr("MongoDB.Driver"),(WCHAR*)WStr("MongoDB.Driver.Core.WireProtocol.CommandUsingQueryMessageWireProtocol`1"),(WCHAR*)WStr("Execute"),g_callTargets_Sig_006,3,2,2,0,3,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration"),CallTargetKind::Default,1,165}, +{(WCHAR*)WStr("MongoDB.Driver"),(WCHAR*)WStr("MongoDB.Driver.Core.WireProtocol.CommandUsingQueryMessageWireProtocol`1"),(WCHAR*)WStr("ExecuteAsync"),g_callTargets_Sig_178,3,2,1,0,3,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration"),CallTargetKind::Default,1,165}, +{(WCHAR*)WStr("MongoDB.Driver"),(WCHAR*)WStr("MongoDB.Driver.Core.WireProtocol.CommandWireProtocol`1"),(WCHAR*)WStr("Execute"),g_callTargets_Sig_006,3,2,2,0,3,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration"),CallTargetKind::Default,1,165}, +{(WCHAR*)WStr("MongoDB.Driver"),(WCHAR*)WStr("MongoDB.Driver.Core.WireProtocol.CommandWireProtocol`1"),(WCHAR*)WStr("ExecuteAsync"),g_callTargets_Sig_178,3,2,1,0,3,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration"),CallTargetKind::Default,1,165}, +{(WCHAR*)WStr("MongoDB.Driver"),(WCHAR*)WStr("MongoDB.Driver.Core.WireProtocol.GetMoreWireProtocol`1"),(WCHAR*)WStr("Execute"),g_callTargets_Sig_006,3,2,2,0,3,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration"),CallTargetKind::Default,1,165}, +{(WCHAR*)WStr("MongoDB.Driver"),(WCHAR*)WStr("MongoDB.Driver.Core.WireProtocol.GetMoreWireProtocol`1"),(WCHAR*)WStr("ExecuteAsync"),g_callTargets_Sig_178,3,2,1,0,3,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration"),CallTargetKind::Default,1,165}, +{(WCHAR*)WStr("MongoDB.Driver"),(WCHAR*)WStr("MongoDB.Driver.Core.WireProtocol.QueryWireProtocol`1"),(WCHAR*)WStr("Execute"),g_callTargets_Sig_006,3,2,2,0,3,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration"),CallTargetKind::Default,1,165}, +{(WCHAR*)WStr("MongoDB.Driver"),(WCHAR*)WStr("MongoDB.Driver.Core.WireProtocol.QueryWireProtocol`1"),(WCHAR*)WStr("ExecuteAsync"),g_callTargets_Sig_178,3,2,1,0,3,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration"),CallTargetKind::Default,1,165}, +{(WCHAR*)WStr("MongoDB.Driver"),(WCHAR*)WStr("MongoDB.Driver.Core.WireProtocol.WriteWireProtocolBase`1"),(WCHAR*)WStr("Execute"),g_callTargets_Sig_006,3,2,2,0,3,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration"),CallTargetKind::Default,1,165}, +{(WCHAR*)WStr("MongoDB.Driver"),(WCHAR*)WStr("MongoDB.Driver.Core.WireProtocol.WriteWireProtocolBase`1"),(WCHAR*)WStr("ExecuteAsync"),g_callTargets_Sig_178,3,2,1,0,3,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration"),CallTargetKind::Default,1,165}, +{(WCHAR*)WStr("MongoDB.Driver.Core"),(WCHAR*)WStr("MongoDB.Driver.Core.WireProtocol.CommandUsingCommandMessageWireProtocol`1"),(WCHAR*)WStr("Execute"),g_callTargets_Sig_006,3,2,2,0,3,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration"),CallTargetKind::Default,1,165}, +{(WCHAR*)WStr("MongoDB.Driver.Core"),(WCHAR*)WStr("MongoDB.Driver.Core.WireProtocol.CommandUsingCommandMessageWireProtocol`1"),(WCHAR*)WStr("ExecuteAsync"),g_callTargets_Sig_178,3,2,1,0,3,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration"),CallTargetKind::Default,1,165}, +{(WCHAR*)WStr("MongoDB.Driver.Core"),(WCHAR*)WStr("MongoDB.Driver.Core.WireProtocol.CommandUsingQueryMessageWireProtocol`1"),(WCHAR*)WStr("Execute"),g_callTargets_Sig_006,3,2,2,0,3,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration"),CallTargetKind::Default,1,165}, +{(WCHAR*)WStr("MongoDB.Driver.Core"),(WCHAR*)WStr("MongoDB.Driver.Core.WireProtocol.CommandUsingQueryMessageWireProtocol`1"),(WCHAR*)WStr("ExecuteAsync"),g_callTargets_Sig_178,3,2,1,0,3,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration"),CallTargetKind::Default,1,165}, +{(WCHAR*)WStr("MongoDB.Driver.Core"),(WCHAR*)WStr("MongoDB.Driver.Core.WireProtocol.CommandWireProtocol`1"),(WCHAR*)WStr("Execute"),g_callTargets_Sig_006,3,2,2,0,3,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration"),CallTargetKind::Default,1,165}, +{(WCHAR*)WStr("MongoDB.Driver.Core"),(WCHAR*)WStr("MongoDB.Driver.Core.WireProtocol.CommandWireProtocol`1"),(WCHAR*)WStr("ExecuteAsync"),g_callTargets_Sig_178,3,2,1,0,3,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration"),CallTargetKind::Default,1,165}, +{(WCHAR*)WStr("MongoDB.Driver.Core"),(WCHAR*)WStr("MongoDB.Driver.Core.WireProtocol.GetMoreWireProtocol`1"),(WCHAR*)WStr("Execute"),g_callTargets_Sig_006,3,2,2,0,3,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration"),CallTargetKind::Default,1,165}, +{(WCHAR*)WStr("MongoDB.Driver.Core"),(WCHAR*)WStr("MongoDB.Driver.Core.WireProtocol.GetMoreWireProtocol`1"),(WCHAR*)WStr("ExecuteAsync"),g_callTargets_Sig_178,3,2,1,0,3,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration"),CallTargetKind::Default,1,165}, {(WCHAR*)WStr("MongoDB.Driver.Core"),(WCHAR*)WStr("MongoDB.Driver.Core.WireProtocol.KillCursorsWireProtocol"),(WCHAR*)WStr("Execute"),g_callTargets_Sig_248,3,2,2,0,2,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Execute_Integration"),CallTargetKind::Default,1,165}, {(WCHAR*)WStr("MongoDB.Driver.Core"),(WCHAR*)WStr("MongoDB.Driver.Core.WireProtocol.KillCursorsWireProtocol"),(WCHAR*)WStr("ExecuteAsync"),g_callTargets_Sig_163,3,2,1,0,2,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration"),CallTargetKind::Default,1,165}, -{(WCHAR*)WStr("MongoDB.Driver.Core"),(WCHAR*)WStr("MongoDB.Driver.Core.WireProtocol.QueryWireProtocol`1"),(WCHAR*)WStr("Execute"),g_callTargets_Sig_006,3,2,2,0,2,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration"),CallTargetKind::Default,1,165}, -{(WCHAR*)WStr("MongoDB.Driver.Core"),(WCHAR*)WStr("MongoDB.Driver.Core.WireProtocol.QueryWireProtocol`1"),(WCHAR*)WStr("ExecuteAsync"),g_callTargets_Sig_178,3,2,1,0,2,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration"),CallTargetKind::Default,1,165}, -{(WCHAR*)WStr("MongoDB.Driver.Core"),(WCHAR*)WStr("MongoDB.Driver.Core.WireProtocol.WriteWireProtocolBase`1"),(WCHAR*)WStr("Execute"),g_callTargets_Sig_006,3,2,2,0,2,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration"),CallTargetKind::Default,1,165}, -{(WCHAR*)WStr("MongoDB.Driver.Core"),(WCHAR*)WStr("MongoDB.Driver.Core.WireProtocol.WriteWireProtocolBase`1"),(WCHAR*)WStr("ExecuteAsync"),g_callTargets_Sig_178,3,2,1,0,2,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration"),CallTargetKind::Default,1,165}, +{(WCHAR*)WStr("MongoDB.Driver.Core"),(WCHAR*)WStr("MongoDB.Driver.Core.WireProtocol.QueryWireProtocol`1"),(WCHAR*)WStr("Execute"),g_callTargets_Sig_006,3,2,2,0,3,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration"),CallTargetKind::Default,1,165}, +{(WCHAR*)WStr("MongoDB.Driver.Core"),(WCHAR*)WStr("MongoDB.Driver.Core.WireProtocol.QueryWireProtocol`1"),(WCHAR*)WStr("ExecuteAsync"),g_callTargets_Sig_178,3,2,1,0,3,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration"),CallTargetKind::Default,1,165}, +{(WCHAR*)WStr("MongoDB.Driver.Core"),(WCHAR*)WStr("MongoDB.Driver.Core.WireProtocol.WriteWireProtocolBase`1"),(WCHAR*)WStr("Execute"),g_callTargets_Sig_006,3,2,2,0,3,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_Generic_Execute_Integration"),CallTargetKind::Default,1,165}, +{(WCHAR*)WStr("MongoDB.Driver.Core"),(WCHAR*)WStr("MongoDB.Driver.Core.WireProtocol.WriteWireProtocolBase`1"),(WCHAR*)WStr("ExecuteAsync"),g_callTargets_Sig_178,3,2,1,0,3,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.MongoDb.IWireProtocol_ExecuteAsync_Integration"),CallTargetKind::Default,1,165}, {(WCHAR*)WStr("System.Messaging"),(WCHAR*)WStr("System.Messaging.MessageQueue"),(WCHAR*)WStr("Purge"),g_callTargets_Sig_231,1,4,0,0,4,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.Msmq.MessageQueue_Purge_Integration"),CallTargetKind::Default,1,165}, {(WCHAR*)WStr("System.Messaging"),(WCHAR*)WStr("System.Messaging.MessageQueue"),(WCHAR*)WStr("ReceiveCurrent"),g_callTargets_Sig_124,7,4,0,0,4,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.Msmq.MessageQueue_ReceiveCurrent_Integration"),CallTargetKind::Default,1,165}, {(WCHAR*)WStr("System.Messaging"),(WCHAR*)WStr("System.Messaging.MessageQueue"),(WCHAR*)WStr("SendInternal"),g_callTargets_Sig_275,4,4,0,0,4,65535,65535,assemblyName,(WCHAR*)WStr("Datadog.Trace.ClrProfiler.AutoInstrumentation.Msmq.MessageQueue_SendInternal_Integration"),CallTargetKind::Default,1,165}, diff --git a/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/MongoDbTests.cs b/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/MongoDbTests.cs index 17bda5afdb23..2f04a21a9258 100644 --- a/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/MongoDbTests.cs +++ b/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/MongoDbTests.cs @@ -25,6 +25,8 @@ public class MongoDbTests : TracingIntegrationTest { private static readonly Regex OsRegex = new(@"""os"" : \{.*?\} "); private static readonly Regex ObjectIdRegex = new(@"ObjectId\("".*?""\)"); + private static readonly Regex OIdRegex = new("""\{\s*"\$oid" : "[0-9a-f]+" \}"""); + private static readonly Regex Base64Regex = new("""base64"\s*:\s*"[a-zA-Z0-9+\\]+=*","""); public MongoDbTests(ITestOutputHelper output) : base("MongoDB", output) @@ -60,7 +62,8 @@ public async Task SubmitsTraces(string packageVersion, string metadataSchemaVers var snapshotSuffix = version switch { null => "2_7", // default is version 2.8.0 - { Major: >= 3 } or { Major: 2, Minor: >= 15 } => "2_15", // A bunch of stuff was removed in 2.15.0 + { Major: >= 3 } => "3_0", // The default JSON serialization changed in 3.0 + { Major: 2, Minor: >= 15 } => "2_15", // A bunch of stuff was removed in 2.15.0 { Major: 2, Minor: >= 7 } => "2_7", // default is version 2.8.0 { Major: 2, Minor: >= 5 } => "2_5", // version 2.5 + 2.6 include additional info on queries compared to 2.2 { Major: 2, Minor: >= 2 } => "2_2", @@ -72,6 +75,9 @@ public async Task SubmitsTraces(string packageVersion, string metadataSchemaVers settings.AddRegexScrubber(OsRegex, @"""os"" : {} "); // v2.5.x records additional info in the insert query which is execution-specific settings.AddRegexScrubber(ObjectIdRegex, @"ObjectId(""ABC123"")"); + // v3 changes how the object ID is written + settings.AddRegexScrubber(OIdRegex, """{ "$oid": "ABC123" }"""); + settings.AddRegexScrubber(Base64Regex, """base64": "abc123ABC==","""); // normalise between running directly against localhost and against mongo container settings.AddSimpleScrubber("out.host: localhost", "out.host: mongo"); settings.AddSimpleScrubber("out.host: mongo_arm64", "out.host: mongo"); diff --git a/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/PackageVersionsLatestMajors.g.cs b/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/PackageVersionsLatestMajors.g.cs index 50e59d28389a..de6790713500 100644 --- a/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/PackageVersionsLatestMajors.g.cs +++ b/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/PackageVersionsLatestMajors.g.cs @@ -244,18 +244,23 @@ public class PackageVersionsLatestMajors #endif #if NET5_0 new object[] { "2.30.0" }, + new object[] { "3.0.0" }, #endif #if NET6_0 new object[] { "2.30.0" }, + new object[] { "3.0.0" }, #endif #if NET7_0 new object[] { "2.30.0" }, + new object[] { "3.0.0" }, #endif #if NET8_0 new object[] { "2.30.0" }, + new object[] { "3.0.0" }, #endif #if NET9_0 new object[] { "2.30.0" }, + new object[] { "3.0.0" }, #endif #endif }; diff --git a/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/PackageVersionsLatestMinors.g.cs b/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/PackageVersionsLatestMinors.g.cs index 9ec0c0ea8640..1b6d646baa2e 100644 --- a/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/PackageVersionsLatestMinors.g.cs +++ b/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/PackageVersionsLatestMinors.g.cs @@ -500,6 +500,7 @@ public class PackageVersionsLatestMinors new object[] { "2.28.0" }, new object[] { "2.29.0" }, new object[] { "2.30.0" }, + new object[] { "3.0.0" }, #endif #if NET6_0 new object[] { "2.3.0" }, @@ -530,6 +531,7 @@ public class PackageVersionsLatestMinors new object[] { "2.28.0" }, new object[] { "2.29.0" }, new object[] { "2.30.0" }, + new object[] { "3.0.0" }, #endif #if NET7_0 new object[] { "2.3.0" }, @@ -560,6 +562,7 @@ public class PackageVersionsLatestMinors new object[] { "2.28.0" }, new object[] { "2.29.0" }, new object[] { "2.30.0" }, + new object[] { "3.0.0" }, #endif #if NET8_0 new object[] { "2.3.0" }, @@ -590,6 +593,7 @@ public class PackageVersionsLatestMinors new object[] { "2.28.0" }, new object[] { "2.29.0" }, new object[] { "2.30.0" }, + new object[] { "3.0.0" }, #endif #if NET9_0 new object[] { "2.3.0" }, @@ -620,6 +624,7 @@ public class PackageVersionsLatestMinors new object[] { "2.28.0" }, new object[] { "2.29.0" }, new object[] { "2.30.0" }, + new object[] { "3.0.0" }, #endif #endif }; diff --git a/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/PackageVersionsLatestSpecific.g.cs b/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/PackageVersionsLatestSpecific.g.cs index e0c8718cd9fc..213666e7f739 100644 --- a/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/PackageVersionsLatestSpecific.g.cs +++ b/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/PackageVersionsLatestSpecific.g.cs @@ -313,26 +313,31 @@ public class PackageVersionsLatestSpecific new object[] { "2.5.1" }, new object[] { "2.14.1" }, new object[] { "2.30.0" }, + new object[] { "3.0.0" }, #endif #if NET6_0 new object[] { "2.5.1" }, new object[] { "2.14.1" }, new object[] { "2.30.0" }, + new object[] { "3.0.0" }, #endif #if NET7_0 new object[] { "2.5.1" }, new object[] { "2.14.1" }, new object[] { "2.30.0" }, + new object[] { "3.0.0" }, #endif #if NET8_0 new object[] { "2.5.1" }, new object[] { "2.14.1" }, new object[] { "2.30.0" }, + new object[] { "3.0.0" }, #endif #if NET9_0 new object[] { "2.5.1" }, new object[] { "2.14.1" }, new object[] { "2.30.0" }, + new object[] { "3.0.0" }, #endif #endif }; diff --git a/tracer/test/Datadog.Trace.ClrProfiler.Managed.Tests/TypeNameTests.cs b/tracer/test/Datadog.Trace.ClrProfiler.Managed.Tests/TypeNameTests.cs index 57a84df0ba5b..cfa641b37924 100644 --- a/tracer/test/Datadog.Trace.ClrProfiler.Managed.Tests/TypeNameTests.cs +++ b/tracer/test/Datadog.Trace.ClrProfiler.Managed.Tests/TypeNameTests.cs @@ -20,6 +20,7 @@ public static IEnumerable GetConstTypeAssociations() yield return new object[] { ClrNames.Ignore, "_" }; yield return new object[] { ClrNames.Void, typeof(void) }; yield return new object[] { ClrNames.Object, typeof(object) }; + yield return new object[] { ClrNames.Guid, typeof(Guid) }; yield return new object[] { ClrNames.Bool, typeof(bool) }; yield return new object[] { ClrNames.String, typeof(string) }; yield return new object[] { ClrNames.SByte, typeof(sbyte) }; diff --git a/tracer/test/snapshots/MongoDbTests.SubmitsTraces_packageVersion=3_0.SchemaV0.verified.txt b/tracer/test/snapshots/MongoDbTests.SubmitsTraces_packageVersion=3_0.SchemaV0.verified.txt new file mode 100644 index 000000000000..8b014bc9bf78 --- /dev/null +++ b/tracer/test/snapshots/MongoDbTests.SubmitsTraces_packageVersion=3_0.SchemaV0.verified.txt @@ -0,0 +1,455 @@ +[ + { + TraceId: Id_1, + SpanId: Id_2, + Name: internal, + Resource: Main(), + Service: Samples.MongoDB, + Type: custom, + Tags: { + env: integration_tests, + language: dotnet, + otel.library.name: Samples.MongoDB, + otel.status_code: STATUS_CODE_UNSET, + otel.trace_id: Guid_1, + runtime-id: Guid_2, + span.kind: internal, + version: 1.0.0 + }, + Metrics: { + process_id: 0, + _dd.top_level: 1.0, + _dd.tracer_kr: 1.0, + _sampling_priority_v1: 1.0 + } + }, + { + TraceId: Id_1, + SpanId: Id_3, + Name: internal, + Resource: sync-calls, + Service: Samples.MongoDB, + Type: custom, + ParentId: Id_2, + Tags: { + env: integration_tests, + language: dotnet, + otel.library.name: Samples.MongoDB, + otel.status_code: STATUS_CODE_UNSET, + otel.trace_id: Guid_1, + span.kind: internal, + version: 1.0.0 + } + }, + { + TraceId: Id_1, + SpanId: Id_4, + Name: internal, + Resource: async-calls, + Service: Samples.MongoDB, + Type: custom, + ParentId: Id_2, + Tags: { + env: integration_tests, + language: dotnet, + otel.library.name: Samples.MongoDB, + otel.status_code: STATUS_CODE_UNSET, + otel.trace_id: Guid_1, + span.kind: internal, + version: 1.0.0 + } + }, + { + TraceId: Id_1, + SpanId: Id_5, + Name: internal, + Resource: sync-calls, + Service: Samples.MongoDB, + Type: custom, + ParentId: Id_2, + Tags: { + env: integration_tests, + language: dotnet, + otel.library.name: Samples.MongoDB, + otel.status_code: STATUS_CODE_UNSET, + otel.trace_id: Guid_1, + span.kind: internal, + version: 1.0.0 + } + }, + { + TraceId: Id_1, + SpanId: Id_6, + Name: mongodb.query, + Resource: find test-db, + Service: Samples.MongoDB-mongodb, + Type: mongodb, + ParentId: Id_2, + Tags: { + component: MongoDb, + db.name: test-db, + env: integration_tests, + language: dotnet, + mongodb.collection: employees, + mongodb.query: { "find" : "employees", "filter" : { "_id" : { "$oid": "ABC123" }, "name" : "MongoDB", "type" : "Database", "count" : 1, "info" : { "x" : 203, "y" : 102 }, "genericBinary" : "", "uuidLegacyBinary" : { "$binary" : { "base64": "abc123ABC==", "subType" : "03" } }, "largeKey" : "Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test , + out.host: mongo, + out.port: 27017, + runtime-id: Guid_2, + span.kind: client, + _dd.base_service: Samples.MongoDB + }, + Metrics: { + _dd.top_level: 1.0 + } + }, + { + TraceId: Id_1, + SpanId: Id_7, + Name: mongodb.query, + Resource: delete test-db, + Service: Samples.MongoDB-mongodb, + Type: mongodb, + ParentId: Id_3, + Tags: { + component: MongoDb, + db.name: test-db, + env: integration_tests, + language: dotnet, + mongodb.collection: employees, + mongodb.query: { "delete" : "employees", "ordered" : true }, + out.host: mongo, + out.port: 27017, + runtime-id: Guid_2, + span.kind: client, + _dd.base_service: Samples.MongoDB + }, + Metrics: { + _dd.top_level: 1.0 + } + }, + { + TraceId: Id_1, + SpanId: Id_8, + Name: mongodb.query, + Resource: insert test-db, + Service: Samples.MongoDB-mongodb, + Type: mongodb, + ParentId: Id_3, + Tags: { + component: MongoDb, + db.name: test-db, + env: integration_tests, + language: dotnet, + mongodb.collection: employees, + mongodb.query: { "insert" : "employees", "ordered" : true }, + out.host: mongo, + out.port: 27017, + runtime-id: Guid_2, + span.kind: client, + _dd.base_service: Samples.MongoDB + }, + Metrics: { + _dd.top_level: 1.0 + } + }, + { + TraceId: Id_1, + SpanId: Id_9, + Name: mongodb.query, + Resource: aggregate test-db, + Service: Samples.MongoDB-mongodb, + Type: mongodb, + ParentId: Id_3, + Tags: { + component: MongoDb, + db.name: test-db, + env: integration_tests, + language: dotnet, + mongodb.collection: employees, + mongodb.query: { "aggregate" : "employees", "pipeline" : [{ "$match" : { } }, { "$group" : { "_id" : 1, "n" : { "$sum" : 1 } } }], "cursor" : { } }, + out.host: mongo, + out.port: 27017, + runtime-id: Guid_2, + span.kind: client, + _dd.base_service: Samples.MongoDB + }, + Metrics: { + _dd.top_level: 1.0 + } + }, + { + TraceId: Id_1, + SpanId: Id_10, + Name: mongodb.query, + Resource: find test-db, + Service: Samples.MongoDB-mongodb, + Type: mongodb, + ParentId: Id_3, + Tags: { + component: MongoDb, + db.name: test-db, + env: integration_tests, + language: dotnet, + mongodb.collection: employees, + mongodb.query: { "find" : "employees", "filter" : { } }, + out.host: mongo, + out.port: 27017, + runtime-id: Guid_2, + span.kind: client, + _dd.base_service: Samples.MongoDB + }, + Metrics: { + _dd.top_level: 1.0 + } + }, + { + TraceId: Id_1, + SpanId: Id_11, + Name: mongodb.query, + Resource: find test-db, + Service: Samples.MongoDB-mongodb, + Type: mongodb, + ParentId: Id_3, + Tags: { + component: MongoDb, + db.name: test-db, + env: integration_tests, + language: dotnet, + mongodb.collection: employees, + mongodb.query: { "find" : "employees", "filter" : { } }, + out.host: mongo, + out.port: 27017, + runtime-id: Guid_2, + span.kind: client, + _dd.base_service: Samples.MongoDB + }, + Metrics: { + _dd.top_level: 1.0 + } + }, + { + TraceId: Id_1, + SpanId: Id_12, + Name: mongodb.query, + Resource: delete test-db, + Service: Samples.MongoDB-mongodb, + Type: mongodb, + ParentId: Id_4, + Tags: { + component: MongoDb, + db.name: test-db, + env: integration_tests, + language: dotnet, + mongodb.collection: employees, + mongodb.query: { "delete" : "employees", "ordered" : true }, + out.host: mongo, + out.port: 27017, + runtime-id: Guid_2, + span.kind: client, + _dd.base_service: Samples.MongoDB + }, + Metrics: { + _dd.top_level: 1.0 + } + }, + { + TraceId: Id_1, + SpanId: Id_13, + Name: mongodb.query, + Resource: insert test-db, + Service: Samples.MongoDB-mongodb, + Type: mongodb, + ParentId: Id_4, + Tags: { + component: MongoDb, + db.name: test-db, + env: integration_tests, + language: dotnet, + mongodb.collection: employees, + mongodb.query: { "insert" : "employees", "ordered" : true }, + out.host: mongo, + out.port: 27017, + runtime-id: Guid_2, + span.kind: client, + _dd.base_service: Samples.MongoDB + }, + Metrics: { + _dd.top_level: 1.0 + } + }, + { + TraceId: Id_1, + SpanId: Id_14, + Name: mongodb.query, + Resource: aggregate test-db, + Service: Samples.MongoDB-mongodb, + Type: mongodb, + ParentId: Id_4, + Tags: { + component: MongoDb, + db.name: test-db, + env: integration_tests, + language: dotnet, + mongodb.collection: employees, + mongodb.query: { "aggregate" : "employees", "pipeline" : [{ "$match" : { } }, { "$group" : { "_id" : 1, "n" : { "$sum" : 1 } } }], "cursor" : { } }, + out.host: mongo, + out.port: 27017, + runtime-id: Guid_2, + span.kind: client, + _dd.base_service: Samples.MongoDB + }, + Metrics: { + _dd.top_level: 1.0 + } + }, + { + TraceId: Id_1, + SpanId: Id_15, + Name: mongodb.query, + Resource: find test-db, + Service: Samples.MongoDB-mongodb, + Type: mongodb, + ParentId: Id_4, + Tags: { + component: MongoDb, + db.name: test-db, + env: integration_tests, + language: dotnet, + mongodb.collection: employees, + mongodb.query: { "find" : "employees", "filter" : { } }, + out.host: mongo, + out.port: 27017, + runtime-id: Guid_2, + span.kind: client, + _dd.base_service: Samples.MongoDB + }, + Metrics: { + _dd.top_level: 1.0 + } + }, + { + TraceId: Id_1, + SpanId: Id_16, + Name: mongodb.query, + Resource: delete test-db, + Service: Samples.MongoDB-mongodb, + Type: mongodb, + ParentId: Id_5, + Tags: { + component: MongoDb, + db.name: test-db, + env: integration_tests, + language: dotnet, + mongodb.collection: employees, + mongodb.query: { "delete" : "employees", "ordered" : true }, + out.host: mongo, + out.port: 27017, + runtime-id: Guid_2, + span.kind: client, + _dd.base_service: Samples.MongoDB + }, + Metrics: { + _dd.top_level: 1.0 + } + }, + { + TraceId: Id_1, + SpanId: Id_17, + Name: mongodb.query, + Resource: insert test-db, + Service: Samples.MongoDB-mongodb, + Type: mongodb, + ParentId: Id_5, + Tags: { + component: MongoDb, + db.name: test-db, + env: integration_tests, + language: dotnet, + mongodb.collection: employees, + mongodb.query: { "insert" : "employees", "ordered" : true }, + out.host: mongo, + out.port: 27017, + runtime-id: Guid_2, + span.kind: client, + _dd.base_service: Samples.MongoDB + }, + Metrics: { + _dd.top_level: 1.0 + } + }, + { + TraceId: Id_1, + SpanId: Id_18, + Name: mongodb.query, + Resource: aggregate test-db, + Service: Samples.MongoDB-mongodb, + Type: mongodb, + ParentId: Id_5, + Tags: { + component: MongoDb, + db.name: test-db, + env: integration_tests, + language: dotnet, + mongodb.collection: employees, + mongodb.query: { "aggregate" : "employees", "pipeline" : [{ "$match" : { } }, { "$group" : { "_id" : 1, "n" : { "$sum" : 1 } } }], "cursor" : { } }, + out.host: mongo, + out.port: 27017, + runtime-id: Guid_2, + span.kind: client, + _dd.base_service: Samples.MongoDB + }, + Metrics: { + _dd.top_level: 1.0 + } + }, + { + TraceId: Id_1, + SpanId: Id_19, + Name: mongodb.query, + Resource: find test-db, + Service: Samples.MongoDB-mongodb, + Type: mongodb, + ParentId: Id_5, + Tags: { + component: MongoDb, + db.name: test-db, + env: integration_tests, + language: dotnet, + mongodb.collection: employees, + mongodb.query: { "find" : "employees", "filter" : { } }, + out.host: mongo, + out.port: 27017, + runtime-id: Guid_2, + span.kind: client, + _dd.base_service: Samples.MongoDB + }, + Metrics: { + _dd.top_level: 1.0 + } + }, + { + TraceId: Id_1, + SpanId: Id_20, + Name: mongodb.query, + Resource: find test-db, + Service: Samples.MongoDB-mongodb, + Type: mongodb, + ParentId: Id_5, + Tags: { + component: MongoDb, + db.name: test-db, + env: integration_tests, + language: dotnet, + mongodb.collection: employees, + mongodb.query: { "find" : "employees", "filter" : { } }, + out.host: mongo, + out.port: 27017, + runtime-id: Guid_2, + span.kind: client, + _dd.base_service: Samples.MongoDB + }, + Metrics: { + _dd.top_level: 1.0 + } + } +] \ No newline at end of file diff --git a/tracer/test/snapshots/MongoDbTests.SubmitsTraces_packageVersion=3_0.SchemaV1.verified.txt b/tracer/test/snapshots/MongoDbTests.SubmitsTraces_packageVersion=3_0.SchemaV1.verified.txt new file mode 100644 index 000000000000..49aa0006d68d --- /dev/null +++ b/tracer/test/snapshots/MongoDbTests.SubmitsTraces_packageVersion=3_0.SchemaV1.verified.txt @@ -0,0 +1,425 @@ +[ + { + TraceId: Id_1, + SpanId: Id_2, + Name: internal, + Resource: Main(), + Service: Samples.MongoDB, + Type: custom, + Tags: { + env: integration_tests, + language: dotnet, + otel.library.name: Samples.MongoDB, + otel.status_code: STATUS_CODE_UNSET, + otel.trace_id: Guid_1, + runtime-id: Guid_2, + span.kind: internal, + version: 1.0.0 + }, + Metrics: { + process_id: 0, + _dd.top_level: 1.0, + _dd.tracer_kr: 1.0, + _sampling_priority_v1: 1.0 + } + }, + { + TraceId: Id_1, + SpanId: Id_3, + Name: internal, + Resource: sync-calls, + Service: Samples.MongoDB, + Type: custom, + ParentId: Id_2, + Tags: { + env: integration_tests, + language: dotnet, + otel.library.name: Samples.MongoDB, + otel.status_code: STATUS_CODE_UNSET, + otel.trace_id: Guid_1, + span.kind: internal, + version: 1.0.0 + } + }, + { + TraceId: Id_1, + SpanId: Id_4, + Name: internal, + Resource: async-calls, + Service: Samples.MongoDB, + Type: custom, + ParentId: Id_2, + Tags: { + env: integration_tests, + language: dotnet, + otel.library.name: Samples.MongoDB, + otel.status_code: STATUS_CODE_UNSET, + otel.trace_id: Guid_1, + span.kind: internal, + version: 1.0.0 + } + }, + { + TraceId: Id_1, + SpanId: Id_5, + Name: internal, + Resource: sync-calls, + Service: Samples.MongoDB, + Type: custom, + ParentId: Id_2, + Tags: { + env: integration_tests, + language: dotnet, + otel.library.name: Samples.MongoDB, + otel.status_code: STATUS_CODE_UNSET, + otel.trace_id: Guid_1, + span.kind: internal, + version: 1.0.0 + } + }, + { + TraceId: Id_1, + SpanId: Id_6, + Name: mongodb.query, + Resource: find test-db, + Service: Samples.MongoDB, + Type: mongodb, + ParentId: Id_2, + Tags: { + component: MongoDb, + db.name: test-db, + env: integration_tests, + language: dotnet, + mongodb.collection: employees, + mongodb.query: { "find" : "employees", "filter" : { "_id" : { "$oid": "ABC123" }, "name" : "MongoDB", "type" : "Database", "count" : 1, "info" : { "x" : 203, "y" : 102 }, "genericBinary" : "", "uuidLegacyBinary" : { "$binary" : { "base64": "abc123ABC==", "subType" : "03" } }, "largeKey" : "Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test , + out.host: mongo, + out.port: 27017, + peer.service: test-db, + span.kind: client, + version: 1.0.0, + _dd.peer.service.source: db.name + } + }, + { + TraceId: Id_1, + SpanId: Id_7, + Name: mongodb.query, + Resource: delete test-db, + Service: Samples.MongoDB, + Type: mongodb, + ParentId: Id_3, + Tags: { + component: MongoDb, + db.name: test-db, + env: integration_tests, + language: dotnet, + mongodb.collection: employees, + mongodb.query: { "delete" : "employees", "ordered" : true }, + out.host: mongo, + out.port: 27017, + peer.service: test-db, + span.kind: client, + version: 1.0.0, + _dd.peer.service.source: db.name + } + }, + { + TraceId: Id_1, + SpanId: Id_8, + Name: mongodb.query, + Resource: insert test-db, + Service: Samples.MongoDB, + Type: mongodb, + ParentId: Id_3, + Tags: { + component: MongoDb, + db.name: test-db, + env: integration_tests, + language: dotnet, + mongodb.collection: employees, + mongodb.query: { "insert" : "employees", "ordered" : true }, + out.host: mongo, + out.port: 27017, + peer.service: test-db, + span.kind: client, + version: 1.0.0, + _dd.peer.service.source: db.name + } + }, + { + TraceId: Id_1, + SpanId: Id_9, + Name: mongodb.query, + Resource: aggregate test-db, + Service: Samples.MongoDB, + Type: mongodb, + ParentId: Id_3, + Tags: { + component: MongoDb, + db.name: test-db, + env: integration_tests, + language: dotnet, + mongodb.collection: employees, + mongodb.query: { "aggregate" : "employees", "pipeline" : [{ "$match" : { } }, { "$group" : { "_id" : 1, "n" : { "$sum" : 1 } } }], "cursor" : { } }, + out.host: mongo, + out.port: 27017, + peer.service: test-db, + span.kind: client, + version: 1.0.0, + _dd.peer.service.source: db.name + } + }, + { + TraceId: Id_1, + SpanId: Id_10, + Name: mongodb.query, + Resource: find test-db, + Service: Samples.MongoDB, + Type: mongodb, + ParentId: Id_3, + Tags: { + component: MongoDb, + db.name: test-db, + env: integration_tests, + language: dotnet, + mongodb.collection: employees, + mongodb.query: { "find" : "employees", "filter" : { } }, + out.host: mongo, + out.port: 27017, + peer.service: test-db, + span.kind: client, + version: 1.0.0, + _dd.peer.service.source: db.name + } + }, + { + TraceId: Id_1, + SpanId: Id_11, + Name: mongodb.query, + Resource: find test-db, + Service: Samples.MongoDB, + Type: mongodb, + ParentId: Id_3, + Tags: { + component: MongoDb, + db.name: test-db, + env: integration_tests, + language: dotnet, + mongodb.collection: employees, + mongodb.query: { "find" : "employees", "filter" : { } }, + out.host: mongo, + out.port: 27017, + peer.service: test-db, + span.kind: client, + version: 1.0.0, + _dd.peer.service.source: db.name + } + }, + { + TraceId: Id_1, + SpanId: Id_12, + Name: mongodb.query, + Resource: delete test-db, + Service: Samples.MongoDB, + Type: mongodb, + ParentId: Id_4, + Tags: { + component: MongoDb, + db.name: test-db, + env: integration_tests, + language: dotnet, + mongodb.collection: employees, + mongodb.query: { "delete" : "employees", "ordered" : true }, + out.host: mongo, + out.port: 27017, + peer.service: test-db, + span.kind: client, + version: 1.0.0, + _dd.peer.service.source: db.name + } + }, + { + TraceId: Id_1, + SpanId: Id_13, + Name: mongodb.query, + Resource: insert test-db, + Service: Samples.MongoDB, + Type: mongodb, + ParentId: Id_4, + Tags: { + component: MongoDb, + db.name: test-db, + env: integration_tests, + language: dotnet, + mongodb.collection: employees, + mongodb.query: { "insert" : "employees", "ordered" : true }, + out.host: mongo, + out.port: 27017, + peer.service: test-db, + span.kind: client, + version: 1.0.0, + _dd.peer.service.source: db.name + } + }, + { + TraceId: Id_1, + SpanId: Id_14, + Name: mongodb.query, + Resource: aggregate test-db, + Service: Samples.MongoDB, + Type: mongodb, + ParentId: Id_4, + Tags: { + component: MongoDb, + db.name: test-db, + env: integration_tests, + language: dotnet, + mongodb.collection: employees, + mongodb.query: { "aggregate" : "employees", "pipeline" : [{ "$match" : { } }, { "$group" : { "_id" : 1, "n" : { "$sum" : 1 } } }], "cursor" : { } }, + out.host: mongo, + out.port: 27017, + peer.service: test-db, + span.kind: client, + version: 1.0.0, + _dd.peer.service.source: db.name + } + }, + { + TraceId: Id_1, + SpanId: Id_15, + Name: mongodb.query, + Resource: find test-db, + Service: Samples.MongoDB, + Type: mongodb, + ParentId: Id_4, + Tags: { + component: MongoDb, + db.name: test-db, + env: integration_tests, + language: dotnet, + mongodb.collection: employees, + mongodb.query: { "find" : "employees", "filter" : { } }, + out.host: mongo, + out.port: 27017, + peer.service: test-db, + span.kind: client, + version: 1.0.0, + _dd.peer.service.source: db.name + } + }, + { + TraceId: Id_1, + SpanId: Id_16, + Name: mongodb.query, + Resource: delete test-db, + Service: Samples.MongoDB, + Type: mongodb, + ParentId: Id_5, + Tags: { + component: MongoDb, + db.name: test-db, + env: integration_tests, + language: dotnet, + mongodb.collection: employees, + mongodb.query: { "delete" : "employees", "ordered" : true }, + out.host: mongo, + out.port: 27017, + peer.service: test-db, + span.kind: client, + version: 1.0.0, + _dd.peer.service.source: db.name + } + }, + { + TraceId: Id_1, + SpanId: Id_17, + Name: mongodb.query, + Resource: insert test-db, + Service: Samples.MongoDB, + Type: mongodb, + ParentId: Id_5, + Tags: { + component: MongoDb, + db.name: test-db, + env: integration_tests, + language: dotnet, + mongodb.collection: employees, + mongodb.query: { "insert" : "employees", "ordered" : true }, + out.host: mongo, + out.port: 27017, + peer.service: test-db, + span.kind: client, + version: 1.0.0, + _dd.peer.service.source: db.name + } + }, + { + TraceId: Id_1, + SpanId: Id_18, + Name: mongodb.query, + Resource: aggregate test-db, + Service: Samples.MongoDB, + Type: mongodb, + ParentId: Id_5, + Tags: { + component: MongoDb, + db.name: test-db, + env: integration_tests, + language: dotnet, + mongodb.collection: employees, + mongodb.query: { "aggregate" : "employees", "pipeline" : [{ "$match" : { } }, { "$group" : { "_id" : 1, "n" : { "$sum" : 1 } } }], "cursor" : { } }, + out.host: mongo, + out.port: 27017, + peer.service: test-db, + span.kind: client, + version: 1.0.0, + _dd.peer.service.source: db.name + } + }, + { + TraceId: Id_1, + SpanId: Id_19, + Name: mongodb.query, + Resource: find test-db, + Service: Samples.MongoDB, + Type: mongodb, + ParentId: Id_5, + Tags: { + component: MongoDb, + db.name: test-db, + env: integration_tests, + language: dotnet, + mongodb.collection: employees, + mongodb.query: { "find" : "employees", "filter" : { } }, + out.host: mongo, + out.port: 27017, + peer.service: test-db, + span.kind: client, + version: 1.0.0, + _dd.peer.service.source: db.name + } + }, + { + TraceId: Id_1, + SpanId: Id_20, + Name: mongodb.query, + Resource: find test-db, + Service: Samples.MongoDB, + Type: mongodb, + ParentId: Id_5, + Tags: { + component: MongoDb, + db.name: test-db, + env: integration_tests, + language: dotnet, + mongodb.collection: employees, + mongodb.query: { "find" : "employees", "filter" : { } }, + out.host: mongo, + out.port: 27017, + peer.service: test-db, + span.kind: client, + version: 1.0.0, + _dd.peer.service.source: db.name + } + } +] \ No newline at end of file diff --git a/tracer/test/test-applications/integrations/Samples.MongoDB/Program.cs b/tracer/test/test-applications/integrations/Samples.MongoDB/Program.cs index f716583d937a..ebb2037c3010 100644 --- a/tracer/test/test-applications/integrations/Samples.MongoDB/Program.cs +++ b/tracer/test/test-applications/integrations/Samples.MongoDB/Program.cs @@ -28,8 +28,12 @@ public static void Main(string[] args) // Further details about binary types: https://studio3t.com/knowledge-base/articles/mongodb-best-practices-uuid-data/#binary-subtypes-0x03-and-0x04 var guidByteArray = Guid.Parse("6F88CE3F-BEBE-41F6-8E72-BB168A05E07A").ToByteArray(); var genericBinary = new BsonBinaryData(guidByteArray, BsonBinarySubType.Binary); - + +#if MONGODB_3 + var uuidLegacyBinary = new BsonBinaryData(guidByteArray, BsonBinarySubType.UuidLegacy); +#else var uuidLegacyBinary = new BsonBinaryData(guidByteArray, BsonBinarySubType.UuidLegacy, GuidRepresentation.CSharpLegacy); +#endif // We'd like to test with the following two, but you're only allowed one type of UUID // in a collection in some versions of mongo // var uuidStandardBinary = new BsonBinaryData(guidByteArray, BsonBinarySubType.UuidStandard); diff --git a/tracer/test/test-applications/integrations/Samples.MongoDB/Samples.MongoDB.csproj b/tracer/test/test-applications/integrations/Samples.MongoDB/Samples.MongoDB.csproj index cd44a319c858..ed443f6e93d2 100644 --- a/tracer/test/test-applications/integrations/Samples.MongoDB/Samples.MongoDB.csproj +++ b/tracer/test/test-applications/integrations/Samples.MongoDB/Samples.MongoDB.csproj @@ -1,6 +1,7 @@  2.8.0 + $(DefineConstants);MONGODB_3 $(DefineConstants);MONGODB_2_15 $(DefineConstants);MONGODB_2_7 $(DefineConstants);MONGODB_2_2