Package dev.braintrust.trace
Record Class SpanComponents
java.lang.Object
java.lang.Record
dev.braintrust.trace.SpanComponents
public record SpanComponents(BraintrustUtils.Parent parent, @Nullable SpanComponents.RowIds rowIds)
extends Record
Represents span components for distributed tracing in object format.
This is used to pass parent span context when invoking remote functions, enabling the remote function's spans to appear as children of the caller's span in the Braintrust UI.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordRow IDs for linking spans within a trace. -
Constructor Summary
ConstructorsConstructorDescriptionSpanComponents(BraintrustUtils.Parent parent, SpanComponents.RowIds rowIds) Creates an instance of aSpanComponentsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.parent()Returns the value of theparentrecord component.rowIds()Returns the value of therowIdsrecord component.toMap()Convert to a Map for JSON serialization.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SpanComponents
Creates an instance of aSpanComponentsrecord class.- Parameters:
parent- the value for theparentrecord componentrowIds- the value for therowIdsrecord component
-
-
Method Details
-
toMap
Convert to a Map for JSON serialization.The resulting map matches the InvokeParent object format expected by the API.
-
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. -
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. -
equals
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. All components in this record class are compared withObjects::equals(Object,Object). -
parent
Returns the value of theparentrecord component.- Returns:
- the value of the
parentrecord component
-
rowIds
Returns the value of therowIdsrecord component.- Returns:
- the value of the
rowIdsrecord component
-