From 74801490aa2549514bd9d937c8b1edc705cd6c72 Mon Sep 17 00:00:00 2001 From: Amanda Tarafa Mas Date: Mon, 14 Sep 2020 10:19:37 +0100 Subject: [PATCH] Sets LogEntry.TraceSampled to true the entry is traced. Fixes #5307 --- .../Google.Cloud.Diagnostics.AspNetCore/Logging/GoogleLogger.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/apis/Google.Cloud.Diagnostics.AspNetCore/Google.Cloud.Diagnostics.AspNetCore/Logging/GoogleLogger.cs b/apis/Google.Cloud.Diagnostics.AspNetCore/Google.Cloud.Diagnostics.AspNetCore/Logging/GoogleLogger.cs index 2b03bf45c64d..6631fb8886e4 100644 --- a/apis/Google.Cloud.Diagnostics.AspNetCore/Google.Cloud.Diagnostics.AspNetCore/Logging/GoogleLogger.cs +++ b/apis/Google.Cloud.Diagnostics.AspNetCore/Google.Cloud.Diagnostics.AspNetCore/Logging/GoogleLogger.cs @@ -276,6 +276,7 @@ private void SetTraceAndSpanIfAny(LogEntry entry) if ((TraceContextForLogEntry.FromGoogleTrace() ?? TraceContextForLogEntry.FromExternalTrace(_serviceProvider)) is TraceContextForLogEntry trace) { entry.Trace = _traceTarget.GetFullTraceName(trace.TraceId); + entry.TraceSampled = true; entry.SpanId = trace.SpanId; } }