Skip to content

Conversation

@jboolean
Copy link
Contributor

@jboolean jboolean commented Nov 13, 2025

What does this PR do?

Provides a simpler, more extensible, and less leaky way to add tracing to mcp-go.

Motivation

Previously I proposed a version which used reflection, but changed approaches: #4115

Reviewer's Checklist

  • Changed code has unit tests for its functionality at or near 100% coverage.
  • System-Tests covering this feature have been added and enabled with the va.b.c-dev version tag.
  • There is a benchmark for any new code, or changes to existing code.
  • If this interacts with the agent in a new way, a system test has been added.
  • New code is free of linting errors. You can check this by running ./scripts/lint.sh locally.
  • Add an appropriate team label so this PR gets put in the right place for the release notes.
  • Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild.

Unsure? Have a question? Request a review!

Copy link
Contributor Author

jboolean commented Nov 13, 2025

@jboolean jboolean marked this pull request as ready for review November 13, 2025 16:51
@jboolean jboolean requested review from a team as code owners November 13, 2025 16:51
@jboolean jboolean changed the title Simplified way to add tracing feat(contrib/mcp-go): Simplified way to add tracing Nov 13, 2025
// The file contains methods for easily adding tracing to a MCP server.

type TracingConfig struct {
Hooks *server.Hooks
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the future (next PR in stack) a boolean option to enable intent capture will be added to this config.

@pr-commenter
Copy link

pr-commenter bot commented Nov 13, 2025

Benchmarks

Benchmark execution time: 2025-11-20 20:04:12

Comparing candidate commit 1c7172d in PR branch jb/simplified-way-to-add-tracing with baseline commit 3c75965 in branch main.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 15 metrics, 0 unstable metrics.

@github-actions github-actions bot added the apm:ecosystem contrib/* related feature requests or bugs label Nov 13, 2025
@datadog-official
Copy link
Contributor

datadog-official bot commented Nov 13, 2025

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 1c7172d | Docs | Datadog PR Page | Was this helpful? Give us feedback!

@jboolean jboolean requested a review from genesor November 13, 2025 17:22
@jboolean jboolean force-pushed the jb/simplified-way-to-add-tracing branch from 9f5e898 to 9ae69b2 Compare November 13, 2025 18:32
@jboolean jboolean force-pushed the jb/contrib-mcp-go-init-span branch from 335ba2a to 0237e37 Compare November 13, 2025 18:32
@jboolean jboolean force-pushed the jb/simplified-way-to-add-tracing branch from 9ae69b2 to b214025 Compare November 13, 2025 19:41
@jboolean jboolean force-pushed the jb/contrib-mcp-go-init-span branch from 0237e37 to 6bacb1a Compare November 13, 2025 19:41
@jboolean jboolean force-pushed the jb/simplified-way-to-add-tracing branch from b214025 to 58df1a2 Compare November 14, 2025 14:58
Base automatically changed from jb/contrib-mcp-go-init-span to main November 18, 2025 15:31
@jboolean jboolean force-pushed the jb/simplified-way-to-add-tracing branch from 58df1a2 to bb9ade0 Compare November 18, 2025 15:59
Copy link
Member

@genesor genesor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to add an example and in documentation of how customer should use it with pre-existing hooks. Otherwise LGTM

@jboolean jboolean force-pushed the jb/simplified-way-to-add-tracing branch from e8cc9ba to 625180d Compare November 18, 2025 21:50
@jboolean jboolean requested a review from hannahkm November 18, 2025 21:51
@dd-devflow-routing-codex
Copy link

dd-devflow-routing-codex bot commented Nov 19, 2025

View all feedbacks in Devflow UI.

2025-11-19 16:07:16 UTC ℹ️ Start processing command /merge -c

@jboolean jboolean force-pushed the jb/simplified-way-to-add-tracing branch from ae93ce3 to 1c7172d Compare November 20, 2025 19:42
@dd-devflow-routing-codex
Copy link

dd-devflow-routing-codex bot commented Nov 20, 2025

View all feedbacks in Devflow UI.

2025-11-20 19:44:44 UTC ℹ️ Start processing command devflow:merge


2025-11-20 19:44:54 UTC ℹ️ MergeQueue: waiting for PR to be ready

This pull request is not mergeable according to GitHub. Common reasons include pending required checks, missing approvals, or merge conflicts — but it could also be blocked by other repository rules or settings.
It will be added to the queue as soon as checks pass and/or get approvals.
Note: if you pushed new commits since the last approval, you may need additional approval.
You can remove it from the waiting list with /remove command.


2025-11-20 20:07:32 UTC ℹ️ MergeQueue: merge request added to the queue

The expected merge time in main is approximately 45m (p90).


2025-11-20 20:20:25 UTC ℹ️ MergeQueue: This merge request was merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

apm:ecosystem contrib/* related feature requests or bugs devflow:merge mergequeue-status: done

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants