Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 96 additions & 0 deletions tracer/build/supported_calltargets.g.json
Original file line number Diff line number Diff line change
Expand Up @@ -12582,6 +12582,102 @@
"IsAdoNetIntegration": false,
"InstrumentationCategory": 1
},
{
"IntegrationName": "Protobuf",
"AssemblyName": "Google.Protobuf",
"TargetTypeName": "Google.Protobuf.IBufferMessage",
"TargetMethodName": "InternalMergeFrom",
"TargetReturnType": "System.Void",
"TargetParameterTypes": [
"Google.Protobuf.ParseContext&"
],
"MinimumVersion": {
"Item1": 3,
"Item2": 15,
"Item3": 0
},
"MaximumVersion": {
"Item1": 3,
"Item2": 65535,
"Item3": 65535
},
"InstrumentationTypeName": "Datadog.Trace.ClrProfiler.AutoInstrumentation.Protobuf.BufferMessageInternalMergeFromIntegration",
"IntegrationKind": 2,
"IsAdoNetIntegration": false,
"InstrumentationCategory": 1
},
{
"IntegrationName": "Protobuf",
"AssemblyName": "Google.Protobuf",
"TargetTypeName": "Google.Protobuf.IBufferMessage",
"TargetMethodName": "InternalWriteTo",
"TargetReturnType": "System.Void",
"TargetParameterTypes": [
"Google.Protobuf.WriteContext&"
],
"MinimumVersion": {
"Item1": 3,
"Item2": 15,
"Item3": 0
},
"MaximumVersion": {
"Item1": 3,
"Item2": 65535,
"Item3": 65535
},
"InstrumentationTypeName": "Datadog.Trace.ClrProfiler.AutoInstrumentation.Protobuf.BufferMessageInternalWriteToIntegration",
"IntegrationKind": 2,
"IsAdoNetIntegration": false,
"InstrumentationCategory": 1
},
{
"IntegrationName": "Protobuf",
"AssemblyName": "Google.Protobuf",
"TargetTypeName": "Google.Protobuf.IMessage",
"TargetMethodName": "MergeFrom",
"TargetReturnType": "System.Void",
"TargetParameterTypes": [
"Google.Protobuf.CodedInputStream"
],
"MinimumVersion": {
"Item1": 3,
"Item2": 0,
"Item3": 0
},
"MaximumVersion": {
"Item1": 3,
"Item2": 65535,
"Item3": 65535
},
"InstrumentationTypeName": "Datadog.Trace.ClrProfiler.AutoInstrumentation.Protobuf.MessageMergeFromIntegration",
"IntegrationKind": 2,
"IsAdoNetIntegration": false,
"InstrumentationCategory": 1
},
{
"IntegrationName": "Protobuf",
"AssemblyName": "Google.Protobuf",
"TargetTypeName": "Google.Protobuf.IMessage",
"TargetMethodName": "WriteTo",
"TargetReturnType": "System.Void",
"TargetParameterTypes": [
"Google.Protobuf.CodedOutputStream"
],
"MinimumVersion": {
"Item1": 3,
"Item2": 0,
"Item3": 0
},
"MaximumVersion": {
"Item1": 3,
"Item2": 65535,
"Item3": 65535
},
"InstrumentationTypeName": "Datadog.Trace.ClrProfiler.AutoInstrumentation.Protobuf.MessageWriteToIntegration",
"IntegrationKind": 2,
"IsAdoNetIntegration": false,
"InstrumentationCategory": 1
},
{
"IntegrationName": "RabbitMQ",
"AssemblyName": "RabbitMQ.Client",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,16 @@ namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.Protobuf;
/// <summary>
/// System.Void Google.Protobuf.IBufferMessage::InternalMergeFrom(Google.Protobuf.ParseContext) calltarget instrumentation
/// </summary>
// FIXME: Commenting out due to throwing errors.
// [InstrumentMethod(
// AssemblyName = "Google.Protobuf",
// TypeName = "Google.Protobuf.IBufferMessage",
// MethodName = "InternalMergeFrom",
// ParameterTypeNames = ["Google.Protobuf.ParseContext&"],
// ReturnTypeName = ClrNames.Void,
// MinimumVersion = "3.15.0",
// MaximumVersion = "3.*.*",
// IntegrationName = nameof(Configuration.IntegrationId.Protobuf),
// CallTargetIntegrationKind = CallTargetKind.Interface)]
[InstrumentMethod(
AssemblyName = "Google.Protobuf",
TypeName = "Google.Protobuf.IBufferMessage",
MethodName = "InternalMergeFrom",
ParameterTypeNames = ["Google.Protobuf.ParseContext&"],
ReturnTypeName = ClrNames.Void,
MinimumVersion = "3.15.0",
MaximumVersion = "3.*.*",
IntegrationName = nameof(Configuration.IntegrationId.Protobuf),
CallTargetIntegrationKind = CallTargetKind.Interface)]
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public class BufferMessageInternalMergeFromIntegration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,16 @@ namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.Protobuf;
/// <summary>
/// System.Void Google.Protobuf.IBufferMessage::InternalWriteTo(Google.Protobuf.WriteContext) calltarget instrumentation
/// </summary>
// FIXME: Commenting out due to throwing errors.
// [InstrumentMethod(
// AssemblyName = "Google.Protobuf",
// TypeName = "Google.Protobuf.IBufferMessage",
// MethodName = "InternalWriteTo",
// ReturnTypeName = ClrNames.Void,
// ParameterTypeNames = ["Google.Protobuf.WriteContext&"],
// MinimumVersion = "3.15.0",
// MaximumVersion = "3.*.*",
// IntegrationName = nameof(Configuration.IntegrationId.Protobuf),
// CallTargetIntegrationKind = CallTargetKind.Interface)]
[InstrumentMethod(
AssemblyName = "Google.Protobuf",
TypeName = "Google.Protobuf.IBufferMessage",
MethodName = "InternalWriteTo",
ReturnTypeName = ClrNames.Void,
ParameterTypeNames = ["Google.Protobuf.WriteContext&"],
MinimumVersion = "3.15.0",
MaximumVersion = "3.*.*",
IntegrationName = nameof(Configuration.IntegrationId.Protobuf),
CallTargetIntegrationKind = CallTargetKind.Interface)]
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public class BufferMessageInternalWriteToIntegration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,20 @@ namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.Protobuf;

internal static class Helper
{
/// <summary>
/// Disable the instrumentation when we detect a protobuf message that is 100% not defined by the customer
/// (currently we disable it only for Google protobuf itself and Microsoft types)
/// </summary>
/// <typeparam name="TMessage">needs to be the raw type (not a DuckType)</typeparam>
public static void DisableInstrumentationIfInternalProtobufType<TMessage>()
{
var typeName = typeof(TMessage).FullName;
if (typeName != null && typeName.StartsWith("Google.Protobuf.", StringComparison.OrdinalIgnoreCase))
{
if (typeName != null &&
// Google uses protobuf internally in the protobuf library, we don't want to capture those.
(typeName.StartsWith("Google.Protobuf.", StringComparison.OrdinalIgnoreCase)
// Microsoft has some protobuf definitions in https://github.com/microsoft/durabletask-protobuf for instance
|| typeName.StartsWith("Microsoft.", StringComparison.OrdinalIgnoreCase)))
{
// We disable the integrations once and for all here.
IntegrationOptions<MessageWriteToIntegration, TMessage>.DisableIntegration();
IntegrationOptions<MessageMergeFromIntegration, TMessage>.DisableIntegration();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,16 @@ namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.Protobuf;
/// <summary>
/// System.Void Google.Protobuf.IMessage::MergeFrom(Google.Protobuf.CodedInputStream) calltarget instrumentation
/// </summary>
// FIXME: Commenting out due to throwing errors.
// [InstrumentMethod(
// AssemblyName = "Google.Protobuf",
// TypeName = "Google.Protobuf.IMessage",
// MethodName = "MergeFrom",
// ReturnTypeName = ClrNames.Void,
// ParameterTypeNames = ["Google.Protobuf.CodedInputStream"],
// MinimumVersion = "3.0.0",
// MaximumVersion = "3.*.*",
// IntegrationName = nameof(Configuration.IntegrationId.Protobuf),
// CallTargetIntegrationKind = CallTargetKind.Interface)]
[InstrumentMethod(
AssemblyName = "Google.Protobuf",
TypeName = "Google.Protobuf.IMessage",
MethodName = "MergeFrom",
ReturnTypeName = ClrNames.Void,
ParameterTypeNames = ["Google.Protobuf.CodedInputStream"],
MinimumVersion = "3.0.0",
MaximumVersion = "3.*.*",
IntegrationName = nameof(Configuration.IntegrationId.Protobuf),
CallTargetIntegrationKind = CallTargetKind.Interface)]
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public class MessageMergeFromIntegration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,16 @@ namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.Protobuf;
/// <summary>
/// System.Void Google.Protobuf.IMessage::WriteTo(Google.Protobuf.CodedOutputStream) calltarget instrumentation
/// </summary>
// FIXME: Commenting out due to throwing errors.
// [InstrumentMethod(
// AssemblyName = "Google.Protobuf",
// TypeName = "Google.Protobuf.IMessage",
// MethodName = "WriteTo",
// ReturnTypeName = ClrNames.Void,
// ParameterTypeNames = ["Google.Protobuf.CodedOutputStream"],
// MinimumVersion = "3.0.0",
// MaximumVersion = "3.*.*",
// IntegrationName = nameof(Configuration.IntegrationId.Protobuf),
// CallTargetIntegrationKind = CallTargetKind.Interface)]
[InstrumentMethod(
AssemblyName = "Google.Protobuf",
TypeName = "Google.Protobuf.IMessage",
MethodName = "WriteTo",
ReturnTypeName = ClrNames.Void,
ParameterTypeNames = ["Google.Protobuf.CodedOutputStream"],
MinimumVersion = "3.0.0",
MaximumVersion = "3.*.*",
IntegrationName = nameof(Configuration.IntegrationId.Protobuf),
CallTargetIntegrationKind = CallTargetKind.Interface)]
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public class MessageWriteToIntegration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,11 @@ internal static bool IsInstrumentedAssembly(string assemblyName)
"Datadog.Trace.ClrProfiler.AutoInstrumentation.Process.ProcessStartIntegration"
or "Datadog.Trace.ClrProfiler.AutoInstrumentation.Process.ProcessStartIntegration"
=> Datadog.Trace.Configuration.IntegrationId.Process,
"Datadog.Trace.ClrProfiler.AutoInstrumentation.Protobuf.BufferMessageInternalMergeFromIntegration"
or "Datadog.Trace.ClrProfiler.AutoInstrumentation.Protobuf.BufferMessageInternalWriteToIntegration"
or "Datadog.Trace.ClrProfiler.AutoInstrumentation.Protobuf.MessageMergeFromIntegration"
or "Datadog.Trace.ClrProfiler.AutoInstrumentation.Protobuf.MessageWriteToIntegration"
=> Datadog.Trace.Configuration.IntegrationId.Protobuf,
"Datadog.Trace.ClrProfiler.AutoInstrumentation.RabbitMQ.BasicDeliverAsyncIntegration"
or "Datadog.Trace.ClrProfiler.AutoInstrumentation.RabbitMQ.BasicDeliverAsyncAsyncIntegration"
or "Datadog.Trace.ClrProfiler.AutoInstrumentation.RabbitMQ.BasicDeliverIntegration"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,11 @@ internal static bool IsInstrumentedAssembly(string assemblyName)
"Datadog.Trace.ClrProfiler.AutoInstrumentation.Process.ProcessStartIntegration"
or "Datadog.Trace.ClrProfiler.AutoInstrumentation.Process.ProcessStartIntegration"
=> Datadog.Trace.Configuration.IntegrationId.Process,
"Datadog.Trace.ClrProfiler.AutoInstrumentation.Protobuf.BufferMessageInternalMergeFromIntegration"
or "Datadog.Trace.ClrProfiler.AutoInstrumentation.Protobuf.BufferMessageInternalWriteToIntegration"
or "Datadog.Trace.ClrProfiler.AutoInstrumentation.Protobuf.MessageMergeFromIntegration"
or "Datadog.Trace.ClrProfiler.AutoInstrumentation.Protobuf.MessageWriteToIntegration"
=> Datadog.Trace.Configuration.IntegrationId.Protobuf,
"Datadog.Trace.ClrProfiler.AutoInstrumentation.RabbitMQ.BasicDeliverAsyncIntegration"
or "Datadog.Trace.ClrProfiler.AutoInstrumentation.RabbitMQ.BasicDeliverAsyncAsyncIntegration"
or "Datadog.Trace.ClrProfiler.AutoInstrumentation.RabbitMQ.BasicDeliverIntegration"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,11 @@ internal static bool IsInstrumentedAssembly(string assemblyName)
"Datadog.Trace.ClrProfiler.AutoInstrumentation.Process.ProcessStartIntegration"
or "Datadog.Trace.ClrProfiler.AutoInstrumentation.Process.ProcessStartIntegration"
=> Datadog.Trace.Configuration.IntegrationId.Process,
"Datadog.Trace.ClrProfiler.AutoInstrumentation.Protobuf.BufferMessageInternalMergeFromIntegration"
or "Datadog.Trace.ClrProfiler.AutoInstrumentation.Protobuf.BufferMessageInternalWriteToIntegration"
or "Datadog.Trace.ClrProfiler.AutoInstrumentation.Protobuf.MessageMergeFromIntegration"
or "Datadog.Trace.ClrProfiler.AutoInstrumentation.Protobuf.MessageWriteToIntegration"
=> Datadog.Trace.Configuration.IntegrationId.Protobuf,
"Datadog.Trace.ClrProfiler.AutoInstrumentation.RabbitMQ.BasicDeliverAsyncIntegration"
or "Datadog.Trace.ClrProfiler.AutoInstrumentation.RabbitMQ.BasicDeliverAsyncAsyncIntegration"
or "Datadog.Trace.ClrProfiler.AutoInstrumentation.RabbitMQ.BasicDeliverIntegration"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,11 @@ internal static bool IsInstrumentedAssembly(string assemblyName)
"Datadog.Trace.ClrProfiler.AutoInstrumentation.Process.ProcessStartIntegration"
or "Datadog.Trace.ClrProfiler.AutoInstrumentation.Process.ProcessStartIntegration"
=> Datadog.Trace.Configuration.IntegrationId.Process,
"Datadog.Trace.ClrProfiler.AutoInstrumentation.Protobuf.BufferMessageInternalMergeFromIntegration"
or "Datadog.Trace.ClrProfiler.AutoInstrumentation.Protobuf.BufferMessageInternalWriteToIntegration"
or "Datadog.Trace.ClrProfiler.AutoInstrumentation.Protobuf.MessageMergeFromIntegration"
or "Datadog.Trace.ClrProfiler.AutoInstrumentation.Protobuf.MessageWriteToIntegration"
=> Datadog.Trace.Configuration.IntegrationId.Protobuf,
"Datadog.Trace.ClrProfiler.AutoInstrumentation.RabbitMQ.BasicDeliverAsyncIntegration"
or "Datadog.Trace.ClrProfiler.AutoInstrumentation.RabbitMQ.BasicDeliverAsyncAsyncIntegration"
or "Datadog.Trace.ClrProfiler.AutoInstrumentation.RabbitMQ.BasicDeliverIntegration"
Expand Down
Loading
Loading