fetchnode 0.4.1__tar.gz → 0.4.2__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.
- {fetchnode-0.4.1 → fetchnode-0.4.2}/PKG-INFO +1 -1
- {fetchnode-0.4.1 → fetchnode-0.4.2}/pyproject.toml +1 -1
- {fetchnode-0.4.1 → fetchnode-0.4.2}/src/fetchnode/apps.py +4 -2
- {fetchnode-0.4.1 → fetchnode-0.4.2}/src/fetchnode/conf.py +4 -1
- {fetchnode-0.4.1 → fetchnode-0.4.2}/src/fetchnode/middleware.py +6 -2
- {fetchnode-0.4.1 → fetchnode-0.4.2}/src/fetchnode/version.py +1 -1
- {fetchnode-0.4.1 → fetchnode-0.4.2}/.gitignore +0 -0
- {fetchnode-0.4.1 → fetchnode-0.4.2}/LICENSE +0 -0
- {fetchnode-0.4.1 → fetchnode-0.4.2}/README.md +0 -0
- {fetchnode-0.4.1 → fetchnode-0.4.2}/src/fetchnode/__init__.py +0 -0
- {fetchnode-0.4.1 → fetchnode-0.4.2}/src/fetchnode/api.py +0 -0
- {fetchnode-0.4.1 → fetchnode-0.4.2}/src/fetchnode/capture.py +0 -0
- {fetchnode-0.4.1 → fetchnode-0.4.2}/src/fetchnode/celery.py +0 -0
- {fetchnode-0.4.1 → fetchnode-0.4.2}/src/fetchnode/demo.py +0 -0
- {fetchnode-0.4.1 → fetchnode-0.4.2}/src/fetchnode/excepthook.py +0 -0
- {fetchnode-0.4.1 → fetchnode-0.4.2}/src/fetchnode/handlers.py +0 -0
- {fetchnode-0.4.1 → fetchnode-0.4.2}/src/fetchnode/py.typed +0 -0
- {fetchnode-0.4.1 → fetchnode-0.4.2}/src/fetchnode/query.py +0 -0
- {fetchnode-0.4.1 → fetchnode-0.4.2}/src/fetchnode/scope.py +0 -0
- {fetchnode-0.4.1 → fetchnode-0.4.2}/src/fetchnode/scrub.py +0 -0
- {fetchnode-0.4.1 → fetchnode-0.4.2}/src/fetchnode/sender.py +0 -0
- {fetchnode-0.4.1 → fetchnode-0.4.2}/src/fetchnode/utils.py +0 -0
- {fetchnode-0.4.1 → fetchnode-0.4.2}/src/fetchnode_client/__init__.py +0 -0
- {fetchnode-0.4.1 → fetchnode-0.4.2}/src/fetchnode_client/api.py +0 -0
- {fetchnode-0.4.1 → fetchnode-0.4.2}/src/fetchnode_client/apps.py +0 -0
- {fetchnode-0.4.1 → fetchnode-0.4.2}/src/fetchnode_client/capture.py +0 -0
- {fetchnode-0.4.1 → fetchnode-0.4.2}/src/fetchnode_client/celery.py +0 -0
- {fetchnode-0.4.1 → fetchnode-0.4.2}/src/fetchnode_client/conf.py +0 -0
- {fetchnode-0.4.1 → fetchnode-0.4.2}/src/fetchnode_client/demo.py +0 -0
- {fetchnode-0.4.1 → fetchnode-0.4.2}/src/fetchnode_client/excepthook.py +0 -0
- {fetchnode-0.4.1 → fetchnode-0.4.2}/src/fetchnode_client/handlers.py +0 -0
- {fetchnode-0.4.1 → fetchnode-0.4.2}/src/fetchnode_client/middleware.py +0 -0
- {fetchnode-0.4.1 → fetchnode-0.4.2}/src/fetchnode_client/py.typed +0 -0
- {fetchnode-0.4.1 → fetchnode-0.4.2}/src/fetchnode_client/query.py +0 -0
- {fetchnode-0.4.1 → fetchnode-0.4.2}/src/fetchnode_client/scope.py +0 -0
- {fetchnode-0.4.1 → fetchnode-0.4.2}/src/fetchnode_client/scrub.py +0 -0
- {fetchnode-0.4.1 → fetchnode-0.4.2}/src/fetchnode_client/sender.py +0 -0
- {fetchnode-0.4.1 → fetchnode-0.4.2}/src/fetchnode_client/utils.py +0 -0
- {fetchnode-0.4.1 → fetchnode-0.4.2}/src/fetchnode_client/version.py +0 -0
|
@@ -13,8 +13,10 @@ class FetchNodeConfig(AppConfig):
|
|
|
13
13
|
# Ensure settings.fetchnode_track is available if needed by legacy code
|
|
14
14
|
try:
|
|
15
15
|
from django.conf import settings
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
if not hasattr(settings, "fetchnode_track"):
|
|
17
|
+
setattr(settings, "fetchnode_track", track_event)
|
|
18
|
+
if not hasattr(settings, "FETCHNODE_TRACK"):
|
|
19
|
+
setattr(settings, "FETCHNODE_TRACK", track_event)
|
|
18
20
|
except Exception:
|
|
19
21
|
pass
|
|
20
22
|
|
|
@@ -22,6 +22,7 @@ DEFAULTS = {
|
|
|
22
22
|
"KEEP_TRANSACTION_OUTLIER_MS": 1000,
|
|
23
23
|
"CAPTURE_TRANSACTIONS": True,
|
|
24
24
|
"CAPTURE_JOBS": True,
|
|
25
|
+
"CAPTURE_404": True,
|
|
25
26
|
"INSTRUMENT_CELERY": True,
|
|
26
27
|
"INSTRUMENT_LOGGING": True,
|
|
27
28
|
"INSTRUMENT_EXCEPTHOOK": True,
|
|
@@ -118,7 +119,9 @@ def get_client_settings() -> dict:
|
|
|
118
119
|
elif "FETCHNODE_ENABLED" in os.environ:
|
|
119
120
|
merged["ENABLED"] = os.environ["FETCHNODE_ENABLED"].lower() in {"1", "true", "yes"}
|
|
120
121
|
else:
|
|
121
|
-
|
|
122
|
+
import sys
|
|
123
|
+
is_testing = any(arg == "test" or "pytest" in arg for arg in sys.argv)
|
|
124
|
+
merged["ENABLED"] = bool(merged["API_KEY"]) and not is_testing
|
|
122
125
|
|
|
123
126
|
# Security filters are additive: a project can protect extra business
|
|
124
127
|
# fields without accidentally unprotecting cookies or authorization data.
|
|
@@ -41,8 +41,10 @@ class ErrorCaptureMiddleware:
|
|
|
41
41
|
try:
|
|
42
42
|
from django.conf import settings
|
|
43
43
|
from fetchnode.api import track_event
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
if not hasattr(settings, "fetchnode_track"):
|
|
45
|
+
setattr(settings, "fetchnode_track", track_event)
|
|
46
|
+
if not hasattr(settings, "FETCHNODE_TRACK"):
|
|
47
|
+
setattr(settings, "FETCHNODE_TRACK", track_event)
|
|
46
48
|
except Exception:
|
|
47
49
|
pass
|
|
48
50
|
|
|
@@ -120,6 +122,8 @@ class ErrorCaptureMiddleware:
|
|
|
120
122
|
request.path.startswith(prefix) for prefix in config["IGNORE_PATH_PREFIXES"]
|
|
121
123
|
):
|
|
122
124
|
return
|
|
125
|
+
if not config.get("CAPTURE_404", True) and status_code == 404:
|
|
126
|
+
return
|
|
123
127
|
resolver_match = getattr(request, "resolver_match", None)
|
|
124
128
|
auth_user = getattr(request, "user", None)
|
|
125
129
|
user_identifier = ""
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|