fix: classify mcp query failures (#302)

This commit is contained in:
Andrey Avtomonov 2026-06-15 14:48:24 +02:00 committed by GitHub
parent 8a50601582
commit 7e29543398
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 102 additions and 8 deletions

View file

@ -162,6 +162,7 @@
"outcome",
"durationMs",
"errorClass",
"errorDetail",
"sampleRate",
"mcpClientName",
"mcpClientVersion"
@ -1167,6 +1168,10 @@
"errorClass": {
"type": "string"
},
"errorDetail": {
"type": "string",
"maxLength": 1000
},
"sampleRate": {
"type": "number",
"const": 1

View file

@ -161,6 +161,7 @@ const mcpRequestCompletedSchema = telemetryCommonEnvelopeSchema
outcome: outcomeSchema,
durationMs: z.number().nonnegative(),
errorClass: z.string().optional(),
errorDetail: z.string().max(1000).optional(),
sampleRate: z.literal(1),
// Raw, client-tool-controlled identity from the MCP initialize handshake
// (clientInfo.name/version). Optional: clients may omit clientInfo. Stored
@ -349,7 +350,16 @@ export const telemetryEventCatalog = [
{
name: 'mcp_request_completed',
description: 'Emitted for sampled MCP tool requests.',
fields: ['toolName', 'outcome', 'durationMs', 'errorClass', 'sampleRate', 'mcpClientName', 'mcpClientVersion'],
fields: [
'toolName',
'outcome',
'durationMs',
'errorClass',
'errorDetail',
'sampleRate',
'mcpClientName',
'mcpClientVersion',
],
},
{
name: 'daemon_started',