()
| 37 | // installs the real MeterProvider, so resolve instruments on first use (a |
| 38 | // no-op meter before then simply drops records — same pattern as getCopilotTracer). |
| 39 | function instruments(): CopilotMeterInstruments { |
| 40 | if (cached) return cached |
| 41 | const meter = metrics.getMeter('sim-copilot') |
| 42 | cached = { |
| 43 | toolDuration: meter.createHistogram(Metric.CopilotToolDuration, { |
| 44 | unit: 'ms', |
| 45 | advice: { explicitBucketBoundaries: LATENCY_BUCKETS_MS }, |
| 46 | }), |
| 47 | toolCalls: meter.createCounter(Metric.CopilotToolCalls), |
| 48 | vfsMaterializeDuration: meter.createHistogram(Metric.CopilotVfsMaterializeDuration, { |
| 49 | unit: 'ms', |
| 50 | advice: { explicitBucketBoundaries: LATENCY_BUCKETS_MS }, |
| 51 | }), |
| 52 | fileReadDuration: meter.createHistogram(Metric.CopilotFileReadDuration, { |
| 53 | unit: 'ms', |
| 54 | advice: { explicitBucketBoundaries: LATENCY_BUCKETS_MS }, |
| 55 | }), |
| 56 | fileReadBytes: meter.createHistogram(Metric.CopilotFileReadSize, { |
| 57 | unit: 'By', |
| 58 | advice: { explicitBucketBoundaries: BYTE_BUCKETS }, |
| 59 | }), |
| 60 | } |
| 61 | return cached |
| 62 | } |
| 63 | |
| 64 | // Caps tool.name to the shared catalog (matches Go's cappedToolName): a |
| 65 | // catalog tool keeps its name, everything else (user MCP/custom/unknown) |
no outgoing calls
no test coverage detected