File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import logging
22import os
33import platform
4+ import sys
45
56import sentry_sdk
7+ from sentry_sdk .integrations .atexit import AtexitIntegration
68
79from nanolayer .utils .linux_information_desk import EnvFile , ProcFile
810from nanolayer .utils .settings import NanolayerSettings
1113logger = logging .getLogger (__name__ )
1214
1315
16+ def at_exit_callback (pending : int , timeout : int ) -> None :
17+ sys .stderr .flush ()
18+
19+
1420def setup_analytics () -> None :
1521 try :
1622 dsn = (
@@ -30,6 +36,7 @@ def setup_analytics() -> None:
3036 MemoryError , # machine is running out of memory
3137 NotImplementedError , # user is using a feature that is not implemented
3238 ],
39+ integrations = [AtexitIntegration (callback = at_exit_callback )],
3340 release = resolve_own_package_version (),
3441 traces_sample_rate = 1.0 ,
3542 dsn = dsn ,
You can’t perform that action at this time.
0 commit comments