mirror of
https://github.com/Kaelio/ktx.git
synced 2026-06-25 08:48:08 +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
|
|
@ -52,7 +52,11 @@ type TelemetryEventFields<Name extends TelemetryEventName> = Omit<
|
|||
>;
|
||||
|
||||
const emittedProjectSnapshots = new Set<string>();
|
||||
const MCP_SAMPLE_RATE = 0.1 as const;
|
||||
// MCP tool calls are captured at full rate while ktx is early-stage: at current
|
||||
// install counts any sampling below 1.0 yields too few events to be useful, and
|
||||
// the recorded sampleRate lets us dial this down (and reweight history) once
|
||||
// per-session call volume justifies it.
|
||||
const MCP_SAMPLE_RATE = 1 as const;
|
||||
let mcpSampled: boolean | undefined;
|
||||
|
||||
function telemetryDebugEnabled(): boolean {
|
||||
|
|
@ -64,7 +68,7 @@ export function shouldEmitMcpTelemetry(): boolean {
|
|||
return mcpSampled;
|
||||
}
|
||||
|
||||
export function mcpTelemetrySampleRate(): 0.1 {
|
||||
export function mcpTelemetrySampleRate(): 1 {
|
||||
return MCP_SAMPLE_RATE;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue