Class HttpHeaderHelixCorrelationId

java.lang.Object
com.helixframework.tracing.http.HttpHeaderHelixCorrelationId
All Implemented Interfaces:
com.helixframework.tracing.HelixCorrelationId

public class HttpHeaderHelixCorrelationId extends Object implements com.helixframework.tracing.HelixCorrelationId
Implementation of HelixCorrelationId that retrieves correlation identifiers (trace id and span id) from HTTP headers in a provided HttpServletRequest instance. This class requires the names of the HTTP headers that contain the trace id and span id, as well as the HttpServletRequest instance to extract these values. It provides methods to access the trace id and span id header values using the traceId() and spanId() methods, respectively.
  • Constructor Details

    • HttpHeaderHelixCorrelationId

      public HttpHeaderHelixCorrelationId(String traceIdHeaderName, String spanIdHeaderName, jakarta.servlet.http.HttpServletRequest httpRequest)
      Constructs an instance of HttpHeaderHelixCorrelationId that retrieves trace id and span id from specified HTTP headers in the provided HttpServletRequest.
      Parameters:
      traceIdHeaderName - The name of the HTTP header containing the trace id.
      spanIdHeaderName - The name of the HTTP header containing the span id.
      httpRequest - The HttpServletRequest from which the headers will be read.
  • Method Details

    • traceId

      public String traceId()
      Specified by:
      traceId in interface com.helixframework.tracing.HelixCorrelationId
    • spanId

      public String spanId()
      Specified by:
      spanId in interface com.helixframework.tracing.HelixCorrelationId