Package kalix.javasdk

Interface TraceContext


public interface TraceContext
Utility interface for trace context helper methods.
  • Method Summary

    Modifier and Type
    Method
    Description
    io.opentelemetry.context.Context
    Allows retrieving the trace context as an OpenTelemetry context for easier construction of child spans.
    Allows retrieving the trace id of the trace parent if any.
    Allows retrieving the trace parent for easier injection in external calls (e.g.
    Allows retrieving the trace state for easier injection in external calls (e.g.
  • Method Details

    • asOpenTelemetryContext

      io.opentelemetry.context.Context asOpenTelemetryContext()
      Allows retrieving the trace context as an OpenTelemetry context for easier construction of child spans. If the trace context is not available, a new empty context will be returned.
      Returns:
      the trace context as an OpenTelemetry context.
    • traceParent

      Optional<String> traceParent()
      Allows retrieving the trace parent for easier injection in external calls (e.g. HTTP request headers).
      Returns:
      the trace parent using W3C Trace Context format.
      See Also:
    • traceState

      Optional<String> traceState()
      Allows retrieving the trace state for easier injection in external calls (e.g. HTTP request headers).
      Returns:
      the trace state using W3C Trace Context format.
      See Also:
    • traceId

      Optional<String> traceId()
      Allows retrieving the trace id of the trace parent if any.
      Returns:
      the traceId of the traceParent if any