@sedata-ai/mcp is a single instrumented process. It begins
when instrumentServer is called and ends when telemetry.shutdown() runs.
Session id
TelemetryManager mints one UUID per process and adds it to every span and
every metric as mcp.session.id.
- every span produced by tool calls
- every metric data point
- every custom span you record via
telemetry.startActiveSpan
Session start
Implicit. Created when you construct theTelemetryManager:
Session duration
When you calltelemetry.shutdown(), the package records a histogram:
Wire it up to your process exit:
What “session” doesn’t mean
- It’s not a per-client session. If two MCP clients connect to the same
server process, they share one
mcp.session.id. Usemcp.request.idfor per-call correlation, andclient.addressto differentiate. - It’s not a transport-level connection. A stdio server has one logical client; an HTTP server may have many.
Per-call ids
For correlating logs to a single tool call:
Combine
(mcp.session.id, mcp.request.id) for unique-per-call identity.