From 97aa5192757a4c9035f2af77b92ea84355b0b5c9 Mon Sep 17 00:00:00 2001 From: Russ Cam Date: Fri, 26 Mar 2021 09:21:39 +1000 Subject: [PATCH] fix merge commit --- src/Elastic.Apm/Model/Transaction.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Elastic.Apm/Model/Transaction.cs b/src/Elastic.Apm/Model/Transaction.cs index 40cee8232..c05b8923f 100644 --- a/src/Elastic.Apm/Model/Transaction.cs +++ b/src/Elastic.Apm/Model/Transaction.cs @@ -1,4 +1,4 @@ -// Licensed to Elasticsearch B.V under one or more agreements. +// Licensed to Elasticsearch B.V under one or more agreements. // Elasticsearch B.V licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information @@ -116,7 +116,6 @@ internal Transaction( // If an activity was created, reuse its id Id = _activity.SpanId.ToHexString(); TraceId = _activity.TraceId.ToHexString(); - _traceState = _activity.TraceStateString; var idBytesFromActivity = new Span(new byte[16]); _activity.TraceId.CopyTo(idBytesFromActivity); @@ -190,7 +189,9 @@ internal Transaction( ActivityTraceId.CreateFromString(distributedTracingData.TraceId.AsSpan()), ActivitySpanId.CreateFromString(distributedTracingData.ParentId.AsSpan()), distributedTracingData.FlagRecorded ? ActivityTraceFlags.Recorded : ActivityTraceFlags.None); - _activity.TraceStateString = distributedTracingData.TraceState; + + if (distributedTracingData.HasTraceState) + _activity.TraceStateString = distributedTracingData.TraceState.ToTextHeader(); } catch (Exception e) {