Class OpenTelemetryHelper
- java.lang.Object
-
- org.zalando.fahrschein.opentelemetry.OpenTelemetryHelper
-
public class OpenTelemetryHelper extends java.lang.ObjectOpenTelemetry support class for Fahrschein Nakadi client. This class provides helper methods for setting up OpenTelemetry.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.Map<java.lang.String,java.lang.String>currentContextToMap()Converts the current context into a Nakadi context that can be added to the metadata of the Nakadi event.static io.opentelemetry.context.ContextextractFromMetadata(org.zalando.fahrschein.domain.Metadata metadata)Extracts the trace and baggage context from the given carrier map.
-
-
-
Method Detail
-
extractFromMetadata
public static io.opentelemetry.context.Context extractFromMetadata(org.zalando.fahrschein.domain.Metadata metadata)
Extracts the trace and baggage context from the given carrier map.- Parameters:
metadata- the event metadata- Returns:
- the OpenTelemetry context ready to be set as current
-
currentContextToMap
public static java.util.Map<java.lang.String,java.lang.String> currentContextToMap()
Converts the current context into a Nakadi context that can be added to the metadata of the Nakadi event.- Returns:
- the Nakadi context that can be added to the metadata of the Nakadi event
-
-