Skip to content

feat(langchain): update integration to from ai.* to gen_ai.* span attributes #4678

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

Draft
wants to merge 34 commits into
base: master
Choose a base branch
from

Conversation

shellmayr
Copy link
Member

@shellmayr shellmayr commented Aug 6, 2025

  • Update span attributes to new OTEL compatible schema

Closes TET-992

Copy link

linear bot commented Aug 6, 2025

Copy link

codecov bot commented Aug 6, 2025

❌ 15 Tests Failed:

Tests completed Failed Passed Skipped
23942 15 23927 2287
View the top 3 failed test(s) by shortest run time
tests.integrations.langchain.test_langchain::test_langchain_agent[True-False-False]
Stack Traces | 0.158s run time
.../integrations/langchain/test_langchain.py:195: in test_langchain_agent
    assert "gen_ai.usage.input_tokens" in chat_spans[0]["data"]
E   assert 'gen_ai.usage.input_tokens' in {'thread.id': '139802115025792', 'thread.name': 'MainThread', 'gen_ai.operation.name': 'chat', 'gen_ai.request.model': 'gpt-3.5-turbo', 'gen_ai.system': 'openai', 'gen_ai.request.temperature': 0.0, 'gen_ai.request.available_tools': "[{'type': 'function', 'function': {'name': 'get_word_length', 'description': 'get_word_length(word: str) -> int - Returns the length of a word.', 'parameters': {'type': 'object', 'properties': {'word': {'type': 'string'}}, 'required': ['word']}}}]", 'gen_ai.response.finish_reasons': 'function_call', 'gen_ai.response.tool_calls': "[{'name': 'get_word_length', 'args': {'word': 'eudca'}, 'id': 'call_BbeyNhCKa6kYLYzrD40NGm3b'}]"}
tests.integrations.langchain.test_langchain::test_langchain_agent[False-True-False]
Stack Traces | 0.16s run time
.../integrations/langchain/test_langchain.py:195: in test_langchain_agent
    assert "gen_ai.usage.input_tokens" in chat_spans[0]["data"]
E   assert 'gen_ai.usage.input_tokens' in {'thread.id': '139802115025792', 'thread.name': 'MainThread', 'gen_ai.operation.name': 'chat', 'gen_ai.request.model': 'gpt-3.5-turbo', 'gen_ai.system': 'openai', 'gen_ai.request.temperature': 0.0, 'gen_ai.request.available_tools': "[{'type': 'function', 'function': {'name': 'get_word_length', 'description': 'get_word_length(word: str) -> int - Returns the length of a word.', 'parameters': {'type': 'object', 'properties': {'word': {'type': 'string'}}, 'required': ['word']}}}]", 'gen_ai.response.finish_reasons': 'function_call', 'gen_ai.response.tool_calls': "[{'name': 'get_word_length', 'args': {'word': 'eudca'}, 'id': 'call_BbeyNhCKa6kYLYzrD40NGm3b'}]"}
tests.integrations.langchain.test_langchain::test_langchain_agent[False-False-True]
Stack Traces | 0.161s run time
.../integrations/langchain/test_langchain.py:195: in test_langchain_agent
    assert "gen_ai.usage.input_tokens" in chat_spans[0]["data"]
E   assert 'gen_ai.usage.input_tokens' in {'thread.id': '139802115025792', 'thread.name': 'MainThread', 'gen_ai.operation.name': 'chat', 'gen_ai.request.model': 'gpt-3.5-turbo', 'gen_ai.request.temperature': 0.0, 'gen_ai.request.available_tools': "[{'type': 'function', 'function': {'name': 'get_word_length', 'description': 'get_word_length(word: str) -> int - Returns the length of a word.', 'parameters': {'type': 'object', 'properties': {'word': {'type': 'string'}}, 'required': ['word']}}}]", 'gen_ai.response.finish_reasons': 'function_call', 'gen_ai.response.tool_calls': "[{'name': 'get_word_length', 'args': {'word': 'eudca'}, 'id': 'call_BbeyNhCKa6kYLYzrD40NGm3b'}]"}

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

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.

2 participants