Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions posthog/scopes.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@ def new_context(fresh=False, capture_exceptions=True, client: Optional[Client] =
If False, exceptions will propagate without being tagged or captured.
client: Optional client instance to use for capturing exceptions (default: None).
If provided, the client will be used to capture exceptions within the context.
If not provided, the default (global) client will be used.
If not provided, the default (global) client will be used. Note that the passed
client is only used to capture exceptions within the context - other events captured
within the context via `Client.capture` or `posthog.capture` will still carry the context
state (tags, identity, session id), but will be captured by the client directly used (or
the global one, in the case of `posthog.capture`)

Examples:
# Inherit parent context tags
Expand Down Expand Up @@ -121,7 +125,8 @@ def new_context(fresh=False, capture_exceptions=True, client: Optional[Client] =

def tag(key: str, value: Any) -> None:
"""
Add a tag to the current context.
Add a tag to the current context. All tags are added as properties to any event, including exceptions, captured
within the context.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌


Args:
key: The tag key
Expand Down
Loading