Skip to content

Conversation

@jboolean
Copy link

@jboolean jboolean commented Nov 5, 2025

NB: This is part of a stack

What does this PR do?

In addition to tool calls, record task spans for session initialization.

image.png

Motivation

We want to record data like clientInfo during session Initialization and this seems like the best way to do it.

I considered a metric, but in the future we will also want to tag the session ID, and metrics do not do well with unique tags. Also, this allows viewing everything together in the LLMObs UI.

A writeup with more context on this design

Relates to MLOB-4373

Future

In future PRs I will add tags for client info and session ID.

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!

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

jboolean commented Nov 5, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@jboolean jboolean changed the title Trace initializations with spans feat(contrib/mcp-go): Trace MCP session initializations with MLObs spans Nov 5, 2025
@jboolean jboolean requested review from a team, Kyle-Verhoog, rarguelloF and tomshen November 5, 2025 21:27
@pr-commenter
Copy link

pr-commenter bot commented Nov 5, 2025

Benchmarks

Benchmark execution time: 2025-11-05 21:38:58

Comparing candidate commit 498ae3a in PR branch jb/contrib-mcp-go-init-span with baseline commit b00ba8a in branch jb/contrib-mcp-go-base.

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

@jboolean jboolean marked this pull request as ready for review November 5, 2025 21:39
@tomshen tomshen removed their request for review November 6, 2025 15:36
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants