Class OpenTelemetryHelper


  • public class OpenTelemetryHelper
    extends java.lang.Object
    OpenTelemetry 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.Context extractFromMetadata​(org.zalando.fahrschein.domain.Metadata metadata)
      Extracts the trace and baggage context from the given carrier map.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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