Skip to content

Conversation

@pauldambra
Copy link
Member

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

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

@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.

3 participants