Hi all, I want to send data only to an OpenTelemetry collector.
I can see the data hitting the collector, so that works, but how do I prevent the 401 code as it’s also trying to export to https://api.smith.langchain.com/runs/multipart
set OPENAI_API_BASE=https://my.endpoint.com/api/.../v1
set OPENAI_API_KEY=REDACTED
set LANGSMITH_TRACING=true
set LANGSMITH_OTEL_ENABLED=true
set OTEL_SERVICE_NAME=langchain
set OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
python app.py
Where app.py is just something basic:
from langchain.agents import create_agent
def get_weather(city: str) -> str:
"""Get weather for a given city."""
return f"It's always sunny in {city}!"
agent = create_agent(
model="gpt-4o",
tools=[get_weather],
system_prompt="You are a helpful assistant",
)
# Run the agent
output = agent.invoke(
{"messages": [{"role": "user", "content": "what is the weather in sf"}]}
)
print(output)