Class OpenTelemetryHelper

java.lang.Object
org.zalando.fahrschein.opentelemetry.OpenTelemetryHelper

public class OpenTelemetryHelper extends Object
OpenTelemetry support class for Fahrschein Nakadi client. This class provides helper methods for setting up OpenTelemetry.
  • 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

      public static Map<String,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