From 2ea9817f5b1ded97bbfd5036e4b5ca070226d6a8 Mon Sep 17 00:00:00 2001 From: Ogi <86684834+obostjancic@users.noreply.github.com> Date: Thu, 10 Jul 2025 15:24:50 +0200 Subject: [PATCH] feat(mcp-insights): set flag for mcp spans --- src/sentry/constants.py | 2 ++ src/sentry/event_manager.py | 1 + 2 files changed, 3 insertions(+) diff --git a/src/sentry/constants.py b/src/sentry/constants.py index fe376a2fe6cff5..3bb52efbff8776 100644 --- a/src/sentry/constants.py +++ b/src/sentry/constants.py @@ -640,6 +640,7 @@ class InsightModules(Enum): QUEUE = "queue" LLM_MONITORING = "llm_monitoring" AGENTS = "agents" + MCP = "mcp" INSIGHT_MODULE_FILTERS = { @@ -676,6 +677,7 @@ class InsightModules(Enum): InsightModules.AGENTS: lambda spans: any( span.get("op").startswith("gen_ai.") for span in spans ), + InsightModules.MCP: lambda spans: any(span.get("op").startswith("mcp.") for span in spans), } StatsPeriod = namedtuple("StatsPeriod", ("segments", "interval")) diff --git a/src/sentry/event_manager.py b/src/sentry/event_manager.py index 76549e28876c35..23a4ce67622a03 100644 --- a/src/sentry/event_manager.py +++ b/src/sentry/event_manager.py @@ -2539,6 +2539,7 @@ def _detect_performance_problems(jobs: Sequence[Job], projects: ProjectsMapping) InsightModules.QUEUE: "has_insights_queues", InsightModules.LLM_MONITORING: "has_insights_llm_monitoring", InsightModules.AGENTS: "has_insights_agent_monitoring", + InsightModules.MCP: "has_insights_mcp", }