88 "strings"
99
1010 "cdr.dev/slog"
11- "github.com/coder/aibridge/aibtrace "
11+ "github.com/coder/aibridge/tracing "
1212 "github.com/mark3labs/mcp-go/client"
1313 "github.com/mark3labs/mcp-go/client/transport"
1414 "github.com/mark3labs/mcp-go/mcp"
@@ -60,7 +60,7 @@ func (p *StreamableHTTPServerProxy) Name() string {
6060
6161func (p * StreamableHTTPServerProxy ) Init (ctx context.Context ) (outErr error ) {
6262 ctx , span := p .tracer .Start (ctx , "StreamableHTTPServerProxy.Init" , trace .WithAttributes (p .traceAttributes ()... ))
63- defer aibtrace .EndSpanErr (span , & outErr )
63+ defer tracing .EndSpanErr (span , & outErr )
6464
6565 if err := p .client .Start (ctx ); err != nil {
6666 return fmt .Errorf ("start client: %w" , err )
@@ -134,7 +134,7 @@ func (p *StreamableHTTPServerProxy) CallTool(ctx context.Context, name string, i
134134
135135func (p * StreamableHTTPServerProxy ) fetchTools (ctx context.Context ) (_ map [string ]* Tool , outErr error ) {
136136 ctx , span := p .tracer .Start (ctx , "StreamableHTTPServerProxy.Init.fetchTools" , trace .WithAttributes (p .traceAttributes ()... ))
137- defer aibtrace .EndSpanErr (span , & outErr )
137+ defer tracing .EndSpanErr (span , & outErr )
138138
139139 tools , err := p .client .ListTools (ctx , mcp.ListToolsRequest {})
140140 if err != nil {
@@ -156,7 +156,7 @@ func (p *StreamableHTTPServerProxy) fetchTools(ctx context.Context) (_ map[strin
156156 Logger : p .logger ,
157157 }
158158 }
159- span .SetAttributes (append (p .traceAttributes (), attribute .Int (aibtrace .MCPToolCount , len (out )))... )
159+ span .SetAttributes (append (p .traceAttributes (), attribute .Int (tracing .MCPToolCount , len (out )))... )
160160 return out , nil
161161}
162162
@@ -172,8 +172,8 @@ func (p *StreamableHTTPServerProxy) Shutdown(ctx context.Context) error {
172172
173173func (p * StreamableHTTPServerProxy ) traceAttributes () []attribute.KeyValue {
174174 return []attribute.KeyValue {
175- attribute .String (aibtrace .MCPProxyName , p .Name ()),
176- attribute .String (aibtrace .MCPServerName , p .serverName ),
177- attribute .String (aibtrace .MCPServerURL , p .serverURL ),
175+ attribute .String (tracing .MCPProxyName , p .Name ()),
176+ attribute .String (tracing .MCPServerName , p .serverName ),
177+ attribute .String (tracing .MCPServerURL , p .serverURL ),
178178 }
179179}
0 commit comments