Skip to content

POC: Conversation id and association properties using context scoped attributes#4468

Draft
wrisa wants to merge 4 commits intoopen-telemetry:mainfrom
wrisa:conversation-id-association-properties-prototype
Draft

POC: Conversation id and association properties using context scoped attributes#4468
wrisa wants to merge 4 commits intoopen-telemetry:mainfrom
wrisa:conversation-id-association-properties-prototype

Conversation

@wrisa
Copy link
Copy Markdown
Contributor

@wrisa wrisa commented Apr 20, 2026

Description

Using idea of context scoped attributes in OTEP-open-telemetry/opentelemetry-specification#4931
Currently there is no implementation changes for APIs and SDK for above OTEP.
In this example, Instrumentation is setting the attributes passed to langchain invoke.
Created a key on Context for storing context-scoped attributes.
Conversation id/thread_id and metadata is set from langchain.
A key on Context is created to store conversation id and association properties when workflow invocation. Adding these attributes to both spans, see handler.py
span_utils

Screenshot 2026-04-20 at 1 51 19 PM

Fixes # (issue)

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

None yet

Development

Successfully merging this pull request may close these issues.

4 participants