Skip to content

Add support for workflow invocation in genAI utils handler#4366

Open
wrisa wants to merge 3 commits intoopen-telemetry:mainfrom
wrisa:workflow-handler-genai-utils-2
Open

Add support for workflow invocation in genAI utils handler#4366
wrisa wants to merge 3 commits intoopen-telemetry:mainfrom
wrisa:workflow-handler-genai-utils-2

Conversation

@wrisa
Copy link
Copy Markdown
Contributor

@wrisa wrisa commented Mar 26, 2026

Description

Note: Please ignore duplicate PR. Kept it open for review history, I will close it soon.

Added start, stop, fail support for workflow invocation type.

Check its example usage in langchain.

span when OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT = SPAN_ONLY

Span #1
    Trace ID       : 433d5dbee2e91ef4753fc382f4b8fbfb
    Parent ID      : 
    ID             : bd9e889d1600f77a
    Name           : invoke_workflow LangGraph
    Kind           : Internal
    Start time     : 2026-03-10 22:53:41.866887 +0000 UTC
    End time       : 2026-03-10 22:53:43.471657 +0000 UTC
    Status code    : Unset
    Status message : 
Attributes:
     -> gen_ai.operation.name: Str(invoke_workflow)
     -> gen_ai.input.messages: Str([{"role":"user","parts":[{"content":"You are a helpful assistant!","type":"text"}]},{"role":"user","parts":[{"content":"What is the capital of France?","type":"text"}]}])
     -> gen_ai.output.messages: Str([{"role":"assistant","parts":[{"content":"The capital of France is Paris.","type":"text"}],"finish_reason":"stop"}])

span when OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT = NO_CONTENT

Span #1
    Trace ID       : 433d5dbee2e91ef4753fc382f4b8fbfb
    Parent ID      : 
    ID             : bd9e889d1600f77a
    Name           : invoke_workflow LangGraph
    Kind           : Internal
    Start time     : 2026-03-10 22:53:41.866887 +0000 UTC
    End time       : 2026-03-10 22:53:43.471657 +0000 UTC
    Status code    : Unset
    Status message : 
Attributes:
     -> gen_ai.operation.name: Str(invoke_workflow)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A

Does This PR Require a Core Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

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

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

4 participants