Skip to content

feat(llama_index): Instrument Sparse Embedding & Workflow Events#2928

Open
ialisaleh wants to merge 8 commits intoArize-ai:mainfrom
ialisaleh:alisaleh/ticket-2918
Open

feat(llama_index): Instrument Sparse Embedding & Workflow Events#2928
ialisaleh wants to merge 8 commits intoArize-ai:mainfrom
ialisaleh:alisaleh/ticket-2918

Conversation

@ialisaleh
Copy link
Copy Markdown
Collaborator

Closes #2918

@ialisaleh ialisaleh marked this pull request as ready for review April 1, 2026 18:36
@ialisaleh ialisaleh requested a review from a team as a code owner April 1, 2026 18:36
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Apr 1, 2026
@caroger caroger self-requested a review April 2, 2026 16:54
@_Span._process_event.register(WorkflowStepOutputEvent) # type: ignore[attr-defined,misc]
def _workflow_step_output_event(self: _Span, event: WorkflowStepOutputEvent) -> None: # type: ignore[misc]
# Pre-summarised step output produced by workflows.runtime
self[OUTPUT_VALUE] = event.output
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new workflow output handlers now populate output.value before process_output() runs, so real Workflow.run() spans regress from structured JSON plus output.mime_type=application/json to the summarize_event(...) string with no MIME type. I reproduced that locally on this branch with a minimal workflow, while the merge base still emits JSON. Since these events are summary payloads, could we avoid writing them into OUTPUT_VALUE and let process_output() serialize the real returned event instead?


@dispatcher.span # type: ignore[misc,unused-ignore]
def step_span() -> None:
dispatcher.event(WorkflowStepOutputEvent(output="StopEvent(result='hello')"))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests synthesize WorkflowStepOutputEvent and WorkflowRunOutputEvent directly, then assert the summary string, so they lock in the behavioral regression above instead of exercising the real workflow runtime. A minimal Workflow integration test catches the difference immediately and also lets us assert output.mime_type and JSON output with pop-style checks. Could we drive this through Workflow.run() and use handler.cancel_run() for the cancellation case instead of dispatching the events by hand?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

[bug] openinference-instrumentation-llama-index: Unhandled event of type WorkflowStepOutputEvent

2 participants