Class OpenTelemetryUtil

java.lang.Object
io.quarkus.opentelemetry.runtime.OpenTelemetryUtil

public final class OpenTelemetryUtil extends Object
  • Field Details

  • Method Details

    • convertKeyValueListToMap

      public static Map<String,String> convertKeyValueListToMap(List<String> headers)
      Converts a list of "key=value" pairs into a map. Empty entries will be removed. In case of duplicate keys, the latest takes precedence.
      Parameters:
      headers - nullable list of "key=value" pairs
      Returns:
      non-null map of key-value pairs
    • setMDCData

      public static void setMDCData(io.opentelemetry.context.Context otelContext, io.vertx.core.Context vertxContext)
      Sets MDC data by using the current span from the otelContext.

      This method is in the hot path and was optimized to not use getSpanData()

      Parameters:
      otelContext - opentelemetry otelContext
      vertxContext - vertx otelContext
    • getSpanData

      public static Map<String,String> getSpanData(io.opentelemetry.context.Context context)
      Gets current span data from the MDC context.
      Parameters:
      context - opentelemetry context
    • clearMDCData

      public static void clearMDCData(io.vertx.core.Context vertxContext)
      Clears MDC data related to OpenTelemetry
      Parameters:
      vertxContext - vertx context