Fixed W3C tracestate and baggage setting

without this change we're not setting tracestate whatsover. Baggage is also not being propagated properly (via the baggage field)
with this change when tracestate is there in the headers it will be treated as baggage. When the context is propagated then tracestate will not be put to the baggage field

fixes gh-2001
This commit is contained in:
Marcin Grzejszczak
2021-07-28 20:06:15 +02:00
parent 1b091f7772
commit 4f3558a165
5 changed files with 108 additions and 28 deletions

View File

@@ -18,6 +18,8 @@ package org.springframework.cloud.sleuth;
import java.util.Map;
import org.springframework.lang.Nullable;
/**
* Manages {@link BaggageInScope} entries. Upon retrieval / creation of a baggage entry
* puts it in scope. Scope must be closed.
@@ -38,6 +40,7 @@ public interface BaggageManager {
* @param name baggage name
* @return baggage or {@code null} if not present
*/
@Nullable
BaggageInScope getBaggage(String name);
/**
@@ -46,6 +49,7 @@ public interface BaggageManager {
* @param name baggage name
* @return baggage or {@code null} if not present
*/
@Nullable
BaggageInScope getBaggage(TraceContext traceContext, String name);
/**