From 2ee9471f768c28290572d5b2cd419f295d24c311 Mon Sep 17 00:00:00 2001 From: Steve Gordon Date: Fri, 29 Nov 2024 13:59:42 +0000 Subject: [PATCH] Fix tracer --- src/Elastic.Apm/Api/Tracer.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Elastic.Apm/Api/Tracer.cs b/src/Elastic.Apm/Api/Tracer.cs index cb0110d5c..dce255cc9 100644 --- a/src/Elastic.Apm/Api/Tracer.cs +++ b/src/Elastic.Apm/Api/Tracer.cs @@ -78,13 +78,12 @@ private Transaction StartTransactionInternal(string name, string type, Distribut ) { var currentConfig = _configurationProvider.CurrentSnapshot; - var retVal = new Transaction(_logger, name, type, new Sampler(currentConfig.TransactionSampleRate), distributedTracingData - , _sender, currentConfig, CurrentExecutionSegmentsContainer, _apmServerInfo, _breakdownMetricsProvider, ignoreActivity, timestamp, id, + var transaction = new Transaction(_logger, name, type, new Sampler(currentConfig.TransactionSampleRate), distributedTracingData, + _sender, currentConfig, CurrentExecutionSegmentsContainer, _apmServerInfo, _breakdownMetricsProvider, ignoreActivity, timestamp, id, traceId: traceId, links: links, current: current); - retVal.Context.Service = _service; - _logger?.Debug()?.Log("Starting {TransactionValue}", retVal); - return retVal; + _logger?.Debug()?.Log("Starting {TransactionValue}", transaction); + return transaction; } public void CaptureTransaction(string name, string type, Action action, DistributedTracingData distributedTracingData = null, IEnumerable links = null)