mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-15 14:36:54 +00:00
[Core] respect tracing project name cvar (#28792)
This commit is contained in:
@@ -2379,6 +2379,7 @@ def _configure(
|
||||
if run_tree is not None
|
||||
else tracing_context["client"]
|
||||
),
|
||||
tags=tracing_tags,
|
||||
)
|
||||
callback_manager.add_handler(handler, True)
|
||||
except Exception as e:
|
||||
|
@@ -13,8 +13,8 @@ from typing import (
|
||||
)
|
||||
from uuid import UUID
|
||||
|
||||
from langsmith import run_helpers as ls_rh
|
||||
from langsmith import utils as ls_utils
|
||||
from langsmith.run_helpers import get_run_tree_context
|
||||
|
||||
from langchain_core.tracers.langchain import LangChainTracer
|
||||
from langchain_core.tracers.run_collector import RunCollectorCallbackHandler
|
||||
@@ -149,7 +149,10 @@ def _tracing_v2_is_enabled() -> Union[bool, Literal["local"]]:
|
||||
|
||||
|
||||
def _get_tracer_project() -> str:
|
||||
run_tree = get_run_tree_context()
|
||||
tracing_context = ls_rh.get_tracing_context()
|
||||
run_tree = tracing_context["parent"]
|
||||
if run_tree is None and tracing_context["project_name"] is not None:
|
||||
return tracing_context["project_name"]
|
||||
return getattr(
|
||||
run_tree,
|
||||
"session_name",
|
||||
|
Reference in New Issue
Block a user