MCPcopy Create free account
hub / github.com/getsentry/XcodeBuildMCP / recordMcpLifecycleAnomalyMetric

Function recordMcpLifecycleAnomalyMetric

src/utils/sentry.ts:625–642  ·  view source on GitHub ↗
(metric: McpLifecycleAnomalyMetric)

Source from the content-addressed store, hash-verified

623}
624
625export 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}

Callers 1

startMcpServerFunction · 0.90

Calls 2

shouldEmitMetricsFunction · 0.85
sanitizeTagValueFunction · 0.85

Tested by

no test coverage detected