deepctl-telemetry 0.0.2__tar.gz → 0.0.4__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.4
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.4" # 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.4" # 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,9 +63,12 @@ def init_telemetry(config: Config) -> bool:
62
63
  release=f"deepctl@{cli_version}",
63
64
  environment="production",
64
65
  send_default_pii=False,
65
- traces_sample_rate=0.0,
66
- profiles_sample_rate=0.0,
67
- max_breadcrumbs=20,
66
+ auto_session_tracking=True,
67
+ traces_sample_rate=1.0,
68
+ profiles_sample_rate=1.0,
69
+ enable_logs=True,
70
+ attach_stacktrace=True,
71
+ max_breadcrumbs=100,
68
72
  before_send=_scrub_event,
69
73
  )
70
74
 
@@ -76,10 +80,23 @@ def init_telemetry(config: Config) -> bool:
76
80
  )
77
81
  sentry_sdk.set_tag("cli.version", cli_version)
78
82
 
83
+ sentry_sdk.start_session()
84
+ atexit.register(_flush_on_exit)
85
+
79
86
  _initialized = True
80
87
  return True
81
88
 
82
89
 
90
+ def _flush_on_exit() -> None:
91
+ """Flush queued envelopes before process exit (best-effort, 2s budget)."""
92
+ try:
93
+ import sentry_sdk
94
+
95
+ sentry_sdk.flush(timeout=2.0)
96
+ except Exception:
97
+ pass
98
+
99
+
83
100
  def _read_cli_version() -> str:
84
101
  import importlib.metadata
85
102
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deepctl-telemetry
3
- Version: 0.0.2
3
+ Version: 0.0.4
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>