Skip to content

Commit 875ba43

Browse files
agent: distinguish between client and gateway spans (#92)
Signed-off-by: Adrian Cole <adrian@tetrate.io>
1 parent 05f689b commit 875ba43

4 files changed

Lines changed: 9 additions & 5 deletions

File tree

inference-platforms/agent.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ async def run_agent(tools: list[Tool]):
4949

5050

5151
async def main():
52-
mcp_url = os.getenv("MCP_URL", "https://mcp.kiwi.com")
5352
async with MCPServerStreamableHttp(
5453
{
55-
"url": mcp_url,
54+
"url": os.getenv("MCP_URL", "https://mcp.kiwi.com"),
55+
"headers": dict(h.split("=", 1) for h in os.getenv("MCP_HEADERS", "").split(",") if h),
5656
"timeout": 30.0,
5757
},
5858
client_session_timeout_seconds=60.0,

inference-platforms/aigw/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ Start Ollama and your OpenTelemetry Collector via this repository's [README](../
3131
## Run Envoy AI Gateway
3232

3333
```bash
34-
docker compose pull
35-
docker compose up --force-recreate --remove-orphans
34+
docker compose up --force-recreate --pull always --remove-orphans --wait -d
3635
```
3736

3837
Clean up when finished, like this:

inference-platforms/aigw/docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ services:
3434
env_file:
3535
- env.local
3636
environment:
37+
- OTEL_SERVICE_NAME=aigw
3738
- OPENAI_BASE_URL=http://host.docker.internal:11434/v1
3839
- OTEL_EXPORTER_OTLP_ENDPOINT=http://host.docker.internal:4318
3940
ports:

inference-platforms/aigw/env.local

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@ OPENAI_API_KEY=unused
44
CHAT_MODEL=qwen3:0.6b
55
AGENT_MODEL=qwen3:1.7b
66

7+
# Override as necessary for MCP proxying
8+
MCP_URL=https://mcp.kiwi.com
9+
MCP_HEADERS=
10+
711
# OpenTelemetry configuration
8-
OTEL_SERVICE_NAME=aigw
12+
OTEL_SERVICE_NAME=openai-agent
913
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
1014
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
1115
OTEL_TRACES_EXPORTER=otlp

0 commit comments

Comments
 (0)