deepctl-telemetry 0.0.4__tar.gz → 0.0.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deepctl-telemetry
3
- Version: 0.0.4
3
+ Version: 0.0.5
4
4
  Summary: Opt-out phone-home telemetry for deepctl
5
5
  Author-email: Deepgram <devrel@deepgram.com>
6
6
  Maintainer-email: Deepgram <devrel@deepgram.com>
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "deepctl-telemetry"
7
- version = "0.0.4" # x-release-please-version
7
+ version = "0.0.5" # x-release-please-version
8
8
  description = "Opt-out phone-home telemetry for deepctl"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -10,4 +10,4 @@ __all__ = [
10
10
  "render_notice",
11
11
  ]
12
12
 
13
- __version__ = "0.0.4" # x-release-please-version
13
+ __version__ = "0.0.5" # x-release-please-version
@@ -103,13 +103,46 @@ def _read_cli_version() -> str:
103
103
  return importlib.metadata.version("deepctl")
104
104
 
105
105
 
106
+ _MCP_NOISE_LOGGERS = frozenset(
107
+ {
108
+ "mcp.client.streamable_http",
109
+ "mcp.server.lowlevel.server",
110
+ }
111
+ )
112
+
113
+
114
+ def _is_mcp_transient_noise(event: Event) -> bool:
115
+ """Identify log events from the MCP SDK that are not actionable bugs.
116
+
117
+ `dg mcp` embeds the upstream `mcp` Python SDK, which logs to Sentry via
118
+ the logging integration whenever the upstream MCP server returns 5xx
119
+ (handled by the client) or the stdio peer closes mid-message (handled by
120
+ the server). Both are recovered internally. Surfacing them as Sentry
121
+ issues just creates triage cost for the DX team and hides real CLI bugs.
122
+
123
+ Any unhandled exception is kept regardless of logger.
124
+ """
125
+ if (event.get("logger") or "") not in _MCP_NOISE_LOGGERS:
126
+ return False
127
+ for exc in (event.get("exception") or {}).get("values") or []:
128
+ mechanism = exc.get("mechanism") or {}
129
+ if mechanism.get("handled") is False:
130
+ return False
131
+ return True
132
+
133
+
106
134
  def _scrub_event(event: Event, _hint: Hint) -> Event | None:
107
135
  """Drop request bodies, headers, and any user-identifying data.
108
136
 
109
137
  Sentry SDK already filters most PII via send_default_pii=False, but
110
138
  Auth tokens, project IDs, and file paths can still leak through
111
139
  breadcrumbs and exception messages. This is a defense-in-depth scrub.
140
+
141
+ Also drops known-noise events (see ``_is_mcp_transient_noise``).
112
142
  """
143
+ if _is_mcp_transient_noise(event):
144
+ return None
145
+
113
146
  request: dict[str, Any] = event.get("request") or {}
114
147
  if "headers" in request:
115
148
  request["headers"] = {}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deepctl-telemetry
3
- Version: 0.0.4
3
+ Version: 0.0.5
4
4
  Summary: Opt-out phone-home telemetry for deepctl
5
5
  Author-email: Deepgram <devrel@deepgram.com>
6
6
  Maintainer-email: Deepgram <devrel@deepgram.com>