Langsmith splits each annotated function call in same run into multiple traces

I was trying to make two function calls and log the traces of both the function calls in langsmith. But when i open the platform i can see that both the function calls are logged as different traces.

from dotenv import load_dotenv
from langsmith import traceable
load_dotenv()

@traceable
def test_langsmith_connection():
    """Test function to verify LangSmith tracing is working"""
    print("Testing LangSmith connection...")
    return "LangSmith connection test successful"

@traceable
def test_langsmith_connection_with_run_id():
    """Test function to verify LangSmith tracing with run_id"""
    return "LangSmith connection test successful"

test_langsmith_connection()
test_langsmith_connection_with_run_id()

python version: 3.12.10

I think what you want to do is this:

from dotenv import load_dotenv
from langsmith import traceable
load_dotenv()

@traceable
def test_langsmith_connection():
    """Test function to verify LangSmith tracing is working"""
    print("Testing LangSmith connection...")
    return "LangSmith connection test successful"

@traceable
def test_langsmith_connection_with_run_id():
    """Test function to verify LangSmith tracing with run_id"""
    return "LangSmith connection test successful"


# Add this:
@traceable
def test():
    test_langsmith_connection()
    test_langsmith_connection_with_run_id()   
    

# test_langsmith_connection()
# test_langsmith_connection_with_run_id()

I think now you should see one trace, that will contain 2 sub-methods