mirror of
https://github.com/Kaelio/ktx.git
synced 2026-07-01 08:59:39 +02:00
feat: report MCP client telemetry (#242)
This commit is contained in:
parent
25f639fba2
commit
2e5f7f25aa
12 changed files with 216 additions and 29 deletions
|
|
@ -156,7 +156,12 @@ const mcpRequestCompletedSchema = telemetryCommonEnvelopeSchema
|
|||
outcome: outcomeSchema,
|
||||
durationMs: z.number().nonnegative(),
|
||||
errorClass: z.string().optional(),
|
||||
sampleRate: z.literal(0.1),
|
||||
sampleRate: z.literal(1),
|
||||
// Raw, client-tool-controlled identity from the MCP initialize handshake
|
||||
// (clientInfo.name/version). Optional: clients may omit clientInfo. Stored
|
||||
// verbatim — normalize the free-form names at query time, not at write time.
|
||||
mcpClientName: z.string().optional(),
|
||||
mcpClientVersion: z.string().optional(),
|
||||
})
|
||||
.strict();
|
||||
|
||||
|
|
@ -325,7 +330,7 @@ export const telemetryEventCatalog = [
|
|||
{
|
||||
name: 'mcp_request_completed',
|
||||
description: 'Emitted for sampled MCP tool requests.',
|
||||
fields: ['toolName', 'outcome', 'durationMs', 'errorClass', 'sampleRate'],
|
||||
fields: ['toolName', 'outcome', 'durationMs', 'errorClass', 'sampleRate', 'mcpClientName', 'mcpClientVersion'],
|
||||
},
|
||||
{
|
||||
name: 'daemon_started',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue