Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Instrumentation reads session id from metadata #446

Merged

Conversation

fjcasti1
Copy link
Contributor

@fjcasti1 fjcasti1 commented May 9, 2024

This PR makes it so we capture the OpenInference span attribute session.id from the lanchain metadata if session_id, conversation_id, or thread_id is present in it. If multiple are present, the order of preference is

session_id > conversation_id > thread_id

In addition, we correct the order of preference of context attributes. This is, if we use our context managers to pass metadata, but a different metadata object is passed directly in the call, the latter will be selected over the former.

fix: Overwrite context attributes if passed directly to langchain calls

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label May 9, 2024
@fjcasti1 fjcasti1 requested a review from RogerHYang May 9, 2024 21:17
…ion-langchain

* main:
  fix: update pdfjs-dist in llama-index-express example (#445)
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label May 10, 2024
fjcasti1 and others added 4 commits May 10, 2024 11:13
…/src/openinference/instrumentation/langchain/_tracer.py

Co-authored-by: Xander Song <axiomofjoy@gmail.com>
…ion-langchain

* main:
  chore(main): release python-openinference-instrumentation-bedrock 0.1.4 (#293)
  chore(main): release python-openinference-instrumentation-openai 0.1.5 (#294)
  chore(main): release python-openinference-instrumentation-mistralai 0.0.6 (#335)
  chore(main): release python-openinference-instrumentation-dspy 0.1.8 (#430)
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels May 10, 2024
@fjcasti1 fjcasti1 merged commit 5490f68 into main May 10, 2024
2 of 3 checks passed
@fjcasti1 fjcasti1 deleted the kiko/prompt-template-attributes-instrumentation-langchain branch May 10, 2024 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer size:XL This PR changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants