Compare commits

...
2 Commits
Author SHA1 Message Date
David NewellandGitHub 4426dd9d27 remove 'import posthog' (#255) 2025-06-10 11:05:22 +01:00
David NewellandGitHub bf0d7efbfe fix: makefile import (#254) 2025-06-09 19:20:31 +01:00
5 changed files with 14 additions and 7 deletions
+8
View File
@@ -1,3 +1,11 @@
## 4.6.2 - 2025-06-09
- fix: replace `import posthog` with direct method imports
## 4.6.1 - 2025-06-09
- fix: replace `import posthog` in `posthoganalytics` package
## 4.6.0 - 2025-06-09
- feat: add additional user and request context to captured exceptions via the Django integration
+2 -2
View File
@@ -39,7 +39,7 @@ def new_context(fresh=False):
raise ValueError("Something went wrong")
"""
import posthog
from posthog import capture_exception
current_tags = _get_current_context().copy()
current_stack = _context_stack.get()
@@ -49,7 +49,7 @@ def new_context(fresh=False):
try:
yield
except Exception as e:
posthog.capture_exception(e)
capture_exception(e)
raise
finally:
_context_stack.reset(token)
+3 -3
View File
@@ -4,7 +4,7 @@ from sentry_sdk.integrations import Integration
from sentry_sdk.scope import add_global_event_processor
from sentry_sdk.utils import Dsn
import posthog
from posthog import capture, host
from posthog.request import DEFAULT_HOST
from posthog.sentry import POSTHOG_ID_TAG
@@ -34,7 +34,7 @@ class PostHogIntegration(Integration):
if event.get("tags", {}).get(POSTHOG_ID_TAG):
posthog_distinct_id = event["tags"][POSTHOG_ID_TAG]
event["tags"]["PostHog URL"] = (
f"{posthog.host or DEFAULT_HOST}/person/{posthog_distinct_id}"
f"{host or DEFAULT_HOST}/person/{posthog_distinct_id}"
)
properties = {
@@ -52,6 +52,6 @@ class PostHogIntegration(Integration):
f"{PostHogIntegration.prefix}{PostHogIntegration.organization}/issues/?project={project_id}&query={event['event_id']}"
)
posthog.capture(posthog_distinct_id, "$exception", properties)
capture(posthog_distinct_id, "$exception", properties)
return event
-1
View File
@@ -1,4 +1,3 @@
import hashlib
import time
import unittest
from datetime import datetime
+1 -1
View File
@@ -1,4 +1,4 @@
VERSION = "4.6.0"
VERSION = "4.6.2"
if __name__ == "__main__":
print(VERSION, end="") # noqa: T201