Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions js/src/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1778,12 +1778,16 @@ function updateSpanImpl({
parentObjectType,
parentObjectId,
id,
root_span_id,
span_id,
event,
}: {
state: BraintrustState;
parentObjectType: SpanObjectTypeV3;
parentObjectId: LazyValue<string>;
id: string;
root_span_id?: string;
span_id?: string;
event: Omit<Partial<ExperimentEvent>, "id">;
}): void {
const updateEvent = deepCopyEvent(
Expand All @@ -1801,6 +1805,8 @@ function updateSpanImpl({

const record = new LazyValue(async () => ({
id,
root_span_id,
span_id,
...updateEvent,
...(await parentIds()),
[IS_MERGE_FIELD]: true,
Expand Down Expand Up @@ -1837,6 +1843,8 @@ export function updateSpan({
spanComponentsToObjectIdLambda(resolvedState, components),
),
id: components.data.row_id,
root_span_id: components.data.root_span_id,
span_id: components.data.span_id,
event,
});
}
Expand Down
6 changes: 6 additions & 0 deletions py/src/braintrust/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -3269,6 +3269,8 @@ def _update_span_impl(
parent_object_type: SpanObjectTypeV3,
parent_object_id: LazyValue[str],
id: str,
root_span_id: str | None = None,
span_id: str | None = None,
**event: Any,
):
update_event = _validate_and_sanitize_experiment_log_partial_args(
Expand All @@ -3287,6 +3289,8 @@ def parent_ids():
def compute_record():
return dict(
id=id,
root_span_id=root_span_id,
span_id=span_id,
**update_event,
**parent_ids(),
**{
Expand Down Expand Up @@ -3318,6 +3322,8 @@ def update_span(exported: str, **event: Any) -> None:
parent_object_type=components.object_type,
parent_object_id=LazyValue(_span_components_to_object_id_lambda(components), use_mutex=False),
id=components.row_id,
root_span_id=components.root_span_id,
span_id=components.span_id,
**event,
)

Expand Down
Loading