Skip to content

change(loongsuite-instrumentation-langchain): improve token usage extraction & context propagation#148

Merged
Cirilla-zmh merged 2 commits intoalibaba:mainfrom
Cirilla-zmh:fix/capture_tokens
Mar 13, 2026
Merged

change(loongsuite-instrumentation-langchain): improve token usage extraction & context propagation#148
Cirilla-zmh merged 2 commits intoalibaba:mainfrom
Cirilla-zmh:fix/capture_tokens

Conversation

@Cirilla-zmh
Copy link
Collaborator

Description

  • Set run_inline = True on the tracer so LangChain callbacks run inline for correct OpenTelemetry context propagation.
  • Improved token usage extraction to support multiple LangChain/LLM provider formats.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

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

  • Modify unit tests.

Does This PR Require a Core Repo Change?

  • 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

…vider formats

Change-Id: I90abbe3d2e1ae02851a25b20435f68f33e466251
Co-developed-by: Cursor <noreply@cursor.com>
…ne for correct OpenTelemetry context propagation

Change-Id: Ia4037a2ab512f991916824e62a799dec5baabdfe
Co-developed-by: Cursor <noreply@cursor.com>
@Cirilla-zmh Cirilla-zmh added bug Something isn't working enhancement New feature or request instrumentaion The instrumentation label represents issues related to instrumentation. genai The genai label represents issues related to generative AI. labels Mar 13, 2026
@Cirilla-zmh Cirilla-zmh merged commit cee652e into alibaba:main Mar 13, 2026
101 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request genai The genai label represents issues related to generative AI. instrumentaion The instrumentation label represents issues related to instrumentation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants