Skip to content
This repository has been archived by the owner on Jan 12, 2025. It is now read-only.

Commit

Permalink
more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
danielbraun89 authored Apr 10, 2023
1 parent cfc3b82 commit 27401d4
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions nanolayer/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@
logger = logging.getLogger(__name__)

try:
dsn = NanolayerSettings().analytics_id if not NanolayerSettings().no_analytics else ""
sentry_sdk.init(
release=resolve_own_package_version(),
traces_sample_rate=1.0,
dsn=NanolayerSettings().analytics_id
if not NanolayerSettings().no_analytics
else "",
# explicitly turn off any feature which have an
# impact on personally identifiable information
dsn=dsn,
# explicitly turn off personally identifiable information
send_default_pii=False,
# explicitly turn off client reports
send_client_reports=False,
# explicitly turn off client reports
request_bodies="never",
)
# explicitly strip any identifiable user information
sentry_sdk.set_user(None)

# ------ add generic non-identifiable hardware metrics -------
# ------ add only non-personally-identifiable hardware metrics -------
sentry_sdk.set_context(
"nanolayer.python",
{
Expand All @@ -52,5 +52,6 @@
)
# true if nanolayer is being used as a binary, false otherwise
sentry_sdk.set_tag("nanolayer.binary_mode", "__file__" not in globals())

except Exception as e: # no qa
logger.warning("usage metrics are disabled")

0 comments on commit 27401d4

Please sign in to comment.