deepctl-telemetry 0.0.2__tar.gz → 0.0.3__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.2
3
+ Version: 0.0.3
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.2" # x-release-please-version
7
+ version = "0.0.3" # 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.2" # x-release-please-version
13
+ __version__ = "0.0.3" # x-release-please-version
@@ -2,6 +2,7 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
+ import atexit
5
6
  import os
6
7
  import platform
7
8
  import sys
@@ -62,6 +63,7 @@ def init_telemetry(config: Config) -> bool:
62
63
  release=f"deepctl@{cli_version}",
63
64
  environment="production",
64
65
  send_default_pii=False,
66
+ auto_session_tracking=True,
65
67
  traces_sample_rate=0.0,
66
68
  profiles_sample_rate=0.0,
67
69
  max_breadcrumbs=20,
@@ -76,10 +78,22 @@ def init_telemetry(config: Config) -> bool:
76
78
  )
77
79
  sentry_sdk.set_tag("cli.version", cli_version)
78
80
 
81
+ atexit.register(_flush_on_exit)
82
+
79
83
  _initialized = True
80
84
  return True
81
85
 
82
86
 
87
+ def _flush_on_exit() -> None:
88
+ """Flush queued envelopes before process exit (best-effort, 2s budget)."""
89
+ try:
90
+ import sentry_sdk
91
+
92
+ sentry_sdk.flush(timeout=2.0)
93
+ except Exception:
94
+ pass
95
+
96
+
83
97
  def _read_cli_version() -> str:
84
98
  import importlib.metadata
85
99
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deepctl-telemetry
3
- Version: 0.0.2
3
+ Version: 0.0.3
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>