Skip to content

Commit 88f6069

Browse files
fix: code variables without client (#368)
* fix: pass variables from init to client * chore: version+changelog
1 parent a155e1d commit 88f6069

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 6.9.1 - 2025-11-07
2+
3+
- fix(error-tracking): pass code variables config from init to client
4+
15
# 6.9.0 - 2025-11-06
26

37
- feat(error-tracking): add local variables capture

posthog/__init__.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
set_code_variables_mask_patterns_context as inner_set_code_variables_mask_patterns_context,
1515
set_code_variables_ignore_patterns_context as inner_set_code_variables_ignore_patterns_context,
1616
)
17+
from posthog.exception_utils import (
18+
DEFAULT_CODE_VARIABLES_IGNORE_PATTERNS,
19+
DEFAULT_CODE_VARIABLES_MASK_PATTERNS,
20+
)
1721
from posthog.feature_flags import InconclusiveMatchError, RequiresServerEvaluation
1822
from posthog.types import FeatureFlag, FlagsAndPayloads, FeatureFlagResult
1923
from posthog.version import VERSION
@@ -177,6 +181,10 @@ def tag(name: str, value: Any):
177181

178182
default_client = None # type: Optional[Client]
179183

184+
capture_exception_code_variables = False
185+
code_variables_mask_patterns = DEFAULT_CODE_VARIABLES_MASK_PATTERNS
186+
code_variables_ignore_patterns = DEFAULT_CODE_VARIABLES_IGNORE_PATTERNS
187+
180188

181189
# NOTE - this and following functions take unpacked kwargs because we needed to make
182190
# it impossible to write `posthog.capture(distinct-id, event-name)` - basically, to enforce
@@ -771,6 +779,9 @@ def setup() -> Client:
771779
enable_exception_autocapture=enable_exception_autocapture,
772780
log_captured_exceptions=log_captured_exceptions,
773781
enable_local_evaluation=enable_local_evaluation,
782+
capture_exception_code_variables=capture_exception_code_variables,
783+
code_variables_mask_patterns=code_variables_mask_patterns,
784+
code_variables_ignore_patterns=code_variables_ignore_patterns,
774785
)
775786

776787
# always set incase user changes it

posthog/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION = "6.9.0"
1+
VERSION = "6.9.1"
22

33
if __name__ == "__main__":
44
print(VERSION, end="") # noqa: T201

0 commit comments

Comments
 (0)