Record Class Sw8Context

java.lang.Object
java.lang.Record
codes.grow.packages.skywalking.Sw8Context
Record Components:
sample - whether the upstream sampled the trace
traceId - native trace id (opaque string, e.g. <hex>.<n>.<ms>)
parentTraceSegmentId - segment id of the parent (calling) segment
parentSpanId - span id of the exit span in the parent segment
parentService - service of the caller
parentServiceInstance - instance of the caller
parentEndpoint - endpoint (operation) of the caller's entry span
networkAddressUsedAtPeer - address the caller used to reach this service (host:port)

public record Sw8Context(boolean sample, String traceId, String parentTraceSegmentId, int parentSpanId, String parentService, String parentServiceInstance, String parentEndpoint, String networkAddressUsedAtPeer) extends Record
A decoded sw8 header (SkyWalking cross-process propagation v3): the parent of a native SkyWalking span.
  • Constructor Details

    • Sw8Context

      public Sw8Context(boolean sample, String traceId, String parentTraceSegmentId, int parentSpanId, String parentService, String parentServiceInstance, String parentEndpoint, String networkAddressUsedAtPeer)
      Normalises nulls to empty strings.
      Parameters:
      sample - sample flag
      traceId - trace id
      parentTraceSegmentId - segment id
      parentSpanId - span id
      parentService - service
      parentServiceInstance - instance
      parentEndpoint - endpoint
      networkAddressUsedAtPeer - peer address
  • Method Details

    • encode

      public String encode()
      Returns:
      the sw8 value
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • sample

      public boolean sample()
      Returns the value of the sample record component.
      Returns:
      the value of the sample record component
    • traceId

      public String traceId()
      Returns the value of the traceId record component.
      Returns:
      the value of the traceId record component
    • parentTraceSegmentId

      public String parentTraceSegmentId()
      Returns the value of the parentTraceSegmentId record component.
      Returns:
      the value of the parentTraceSegmentId record component
    • parentSpanId

      public int parentSpanId()
      Returns the value of the parentSpanId record component.
      Returns:
      the value of the parentSpanId record component
    • parentService

      public String parentService()
      Returns the value of the parentService record component.
      Returns:
      the value of the parentService record component
    • parentServiceInstance

      public String parentServiceInstance()
      Returns the value of the parentServiceInstance record component.
      Returns:
      the value of the parentServiceInstance record component
    • parentEndpoint

      public String parentEndpoint()
      Returns the value of the parentEndpoint record component.
      Returns:
      the value of the parentEndpoint record component
    • networkAddressUsedAtPeer

      public String networkAddressUsedAtPeer()
      Returns the value of the networkAddressUsedAtPeer record component.
      Returns:
      the value of the networkAddressUsedAtPeer record component