Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add some platform info to events #198

Merged
merged 14 commits into from
Feb 26, 2025
Merged

Conversation

pauldambra
Copy link
Member

this isn't very useful in product analytics but would be super useful in error tracking

Verified

This commit was signed with the committer’s verified signature.
henryiii Henry Schreiner
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR adds platform information to events captured by the PostHog Python client, enhancing error tracking capabilities with environmental context.

  • Added get_os_info() function in /posthog/client.py that detects and standardizes OS name and version across Windows, macOS, Linux, FreeBSD, and other platforms
  • Added system_context() function that returns Python runtime, Python version, OS name, and OS version information
  • Modified the capture method to include system context in event properties
  • Implemented platform-specific detection logic using sys.platform and platform module with fallbacks for different Python versions
  • Added special handling for Linux distributions to extract version information from either deprecated platform.linux_distribution() or the newer distro module

1 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings | Greptile

Verified

This commit was signed with the committer’s verified signature.
henryiii Henry Schreiner

Verified

This commit was signed with the committer’s verified signature. The key has expired.
mgorny Michał Górny

Verified

This commit was signed with the committer’s verified signature. The key has expired.
mgorny Michał Górny

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
omg
@pauldambra pauldambra merged commit ea4e7fa into master Feb 26, 2025
6 checks passed
@pauldambra pauldambra deleted the feat/some-platform-info branch February 26, 2025 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants