(metric: McpLifecycleAnomalyMetric)
| 623 | } |
| 624 | |
| 625 | export function recordMcpLifecycleAnomalyMetric(metric: McpLifecycleAnomalyMetric): void { |
| 626 | if (!shouldEmitMetrics()) { |
| 627 | return; |
| 628 | } |
| 629 | |
| 630 | try { |
| 631 | Sentry.metrics.count('xcodebuildmcp.mcp.lifecycle.anomaly.count', 1, { |
| 632 | attributes: { |
| 633 | runtime: 'mcp', |
| 634 | kind: sanitizeTagValue(metric.kind), |
| 635 | phase: sanitizeTagValue(metric.phase), |
| 636 | ...(metric.reason ? { reason: sanitizeTagValue(metric.reason) } : {}), |
| 637 | }, |
| 638 | }); |
| 639 | } catch { |
| 640 | // Metrics are best effort and must never affect runtime behavior. |
| 641 | } |
| 642 | } |
no test coverage detected