Skip to content

Commit 1c7172d

Browse files
committed
s/WithTracing/WithMCPServerTracing
1 parent 1408989 commit 1c7172d

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

contrib/mark3labs/mcp-go/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ func main() {
1919

2020
// Do not use with `server.WithHooks(...)`, as this overwrites the tracing hooks.
2121
// To add custom hooks alongside tracing, pass them via TracingConfig.Hooks, e.g.:
22-
// mcpgotrace.WithTracing(&mcpgotrace.TracingConfig{Hooks: customHooks})
22+
// mcpgotrace.WithMCPServerTracing(&mcpgotrace.TracingConfig{Hooks: customHooks})
2323
srv := server.NewMCPServer("my-server", "1.0.0",
24-
mcpgotrace.WithTracing(nil))
24+
mcpgotrace.WithMCPServerTracing(nil))
2525
}
2626
```
2727

contrib/mark3labs/mcp-go/example_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func Example() {
1919
defer tracer.Stop()
2020

2121
srv := server.NewMCPServer("my-server", "1.0.0",
22-
mcpgotrace.WithTracing(nil))
22+
mcpgotrace.WithMCPServerTracing(nil))
2323
_ = srv
2424
}
2525

@@ -33,6 +33,6 @@ func Example_withCustomHooks() {
3333
})
3434

3535
srv := server.NewMCPServer("my-server", "1.0.0",
36-
mcpgotrace.WithTracing(&mcpgotrace.TracingConfig{Hooks: customHooks}))
36+
mcpgotrace.WithMCPServerTracing(&mcpgotrace.TracingConfig{Hooks: customHooks}))
3737
_ = srv
3838
}

contrib/mark3labs/mcp-go/option.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ type TracingConfig struct {
1919
Hooks *server.Hooks
2020
}
2121

22-
// WithTracing adds Datadog tracing to an MCP server.
22+
// WithMCPServerTracing adds Datadog tracing to an MCP server.
2323
// Pass this option to server.NewMCPServer to enable tracing.
2424
//
2525
// Do not use with `server.WithHooks(...)`, as this overwrites the hooks.
@@ -29,16 +29,16 @@ type TracingConfig struct {
2929
//
3030
// // Simple usage with only tracing hooks
3131
// srv := server.NewMCPServer("my-server", "1.0.0",
32-
// WithTracing(nil))
32+
// WithMCPServerTracing(nil))
3333
//
3434
// // With custom hooks
3535
// customHooks := &server.Hooks{}
3636
// customHooks.AddBeforeInitialize(func(ctx context.Context, id any, request *mcp.InitializeRequest) {
3737
// // Your custom logic here
3838
// })
3939
// srv := server.NewMCPServer("my-server", "1.0.0",
40-
// WithTracing(&TracingConfig{Hooks: customHooks}))
41-
func WithTracing(options *TracingConfig) server.ServerOption {
40+
// WithMCPServerTracing(&TracingConfig{Hooks: customHooks}))
41+
func WithMCPServerTracing(options *TracingConfig) server.ServerOption {
4242
return func(s *server.MCPServer) {
4343
if options == nil {
4444
options = new(TracingConfig)

contrib/mark3labs/mcp-go/tracing_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func TestIntegrationSessionInitialize(t *testing.T) {
4646
defer tt.Stop()
4747

4848
srv := server.NewMCPServer("test-server", "1.0.0",
49-
WithTracing(nil))
49+
WithMCPServerTracing(nil))
5050

5151
ctx := context.Background()
5252
sessionID := "test-session-init"
@@ -109,7 +109,7 @@ func TestIntegrationToolCallSuccess(t *testing.T) {
109109
appendTracingHooks(hooks)
110110

111111
srv := server.NewMCPServer("test-server", "1.0.0",
112-
WithTracing(nil))
112+
WithMCPServerTracing(nil))
113113

114114
calcTool := mcp.NewTool("calculator",
115115
mcp.WithDescription("A simple calculator"))
@@ -207,7 +207,7 @@ func TestIntegrationToolCallError(t *testing.T) {
207207
defer tt.Stop()
208208

209209
srv := server.NewMCPServer("test-server", "1.0.0",
210-
WithTracing(&TracingConfig{}))
210+
WithMCPServerTracing(&TracingConfig{}))
211211

212212
errorTool := mcp.NewTool("error_tool",
213213
mcp.WithDescription("A tool that always errors"))
@@ -254,7 +254,7 @@ func TestIntegrationToolCallError(t *testing.T) {
254254
assert.Contains(t, toolSpan.Meta, "input")
255255
}
256256

257-
func TestWithTracingWithCustomHooks(t *testing.T) {
257+
func TestWithMCPServerTracingWithCustomHooks(t *testing.T) {
258258
tt := testTracer(t)
259259
defer tt.Stop()
260260

@@ -265,7 +265,7 @@ func TestWithTracingWithCustomHooks(t *testing.T) {
265265
})
266266

267267
srv := server.NewMCPServer("test-server", "1.0.0",
268-
WithTracing(&TracingConfig{Hooks: customHooks}))
268+
WithMCPServerTracing(&TracingConfig{Hooks: customHooks}))
269269

270270
ctx := context.Background()
271271
initRequest := `{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test-client","version":"1.0.0"}}}`

0 commit comments

Comments
 (0)