Skip to content

Commit 1a9ef3a

Browse files
committed
Applied a patch that prevent a log to bombard the log files
1 parent 4fb09d3 commit 1a9ef3a

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

tracer/src/Datadog.Trace/Debugger/Instrumentation/AsyncMethodDebuggerInvoker.SingleProbe.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,14 @@ public static void BeginMethod<TTarget>(TTarget instance, int methodMetadataInde
161161
ref var probeData = ref ProbeDataCollection.Instance.TryCreateProbeDataIfNotExists(probeMetadataIndex, probeId);
162162
if (probeData.IsEmpty())
163163
{
164+
// In .NET Framework, we have en issue with multiple AppDomains. We can't easily share probe metadata
165+
// between different AppDomain. The domain that request to put a probe might be different from the one that executes it.
166+
// It results in entering into this branch. There is ongoing effort to fix this issue entirely in .NET Framework,
167+
// for now as a quick fix to unblock a customer, this patch is being applied, to avoid logging tremendous amount of
168+
// log entries.
169+
#if !NETFRAMEWORK
164170
Log.Warning("BeginMethod: Failed to receive the ProbeData associated with the executing probe. type = {Type}, instance type name = {Name}, probeMetadataIndex = {ProbeMetadataIndex}, probeId = {ProbeId}", new object[] { typeof(TTarget), instance?.GetType().Name, probeMetadataIndex, probeId });
171+
#endif
165172
state = AsyncMethodDebuggerState.CreateInvalidatedDebuggerState();
166173
return;
167174
}

tracer/src/Datadog.Trace/Debugger/Instrumentation/MethodDebuggerInvoker.SingleProbe.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,14 @@ public static MethodDebuggerState BeginMethod_StartMarker<TTarget>(TTarget insta
8787
ref var probeData = ref ProbeDataCollection.Instance.TryCreateProbeDataIfNotExists(probeMetadataIndex, probeId);
8888
if (probeData.IsEmpty())
8989
{
90+
// In .NET Framework, we have en issue with multiple AppDomains. We can't easily share probe metadata
91+
// between different AppDomain. The domain that request to put a probe might be different from the one that executes it.
92+
// It results in entering into this branch. There is ongoing effort to fix this issue entirely in .NET Framework,
93+
// for now as a quick fix to unblock a customer, this patch is being applied, to avoid logging tremendous amount of
94+
// log entries.
95+
#if !NETFRAMEWORK
9096
Log.Warning("BeginMethod_StartMarker: Failed to receive the ProbeData associated with the executing probe. type = {Type}, instance type name = {Name}, probeMetadataIndex = {ProbeMetadataIndex}, probeId = {ProbeId}", new object[] { typeof(TTarget), instance?.GetType().Name, probeMetadataIndex, probeId });
97+
#endif
9198
return CreateInvalidatedDebuggerState();
9299
}
93100

0 commit comments

Comments
 (0)