Class OpenTelemetryHelper
java.lang.Object
org.zalando.fahrschein.opentelemetry.OpenTelemetryHelper
OpenTelemetry support class for Fahrschein Nakadi client. This class provides
helper methods for setting up OpenTelemetry.
-
Method Summary
Modifier and TypeMethodDescriptionConverts 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 Details
-
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
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
-