Skip to content

feat(telemetry): integrate Sentry crash forensics and PostHog analytics pipeline - #408

Open
undead2146 wants to merge 12 commits into
developmentfrom
feat/telemetry-sentry-posthog
Open

feat(telemetry): integrate Sentry crash forensics and PostHog analytics pipeline#408
undead2146 wants to merge 12 commits into
developmentfrom
feat/telemetry-sentry-posthog

Conversation

@undead2146

Copy link
Copy Markdown
Member

Summary

Integrates Sentry crash reporting / error forensics and PostHog anonymous product analytics into GenHub's cross-platform telemetry pipeline with strict client-side data sanitization and user privacy preference controls.

Motivation

GenHub requires proactive crash reporting (via Sentry) to catch unhandled exceptions, and anonymous lifecycle/performance metrics (via PostHog) to understand game session stability, download throughput, and update adoption across Windows, Linux, and macOS platforms.

Changes

  • Core / Telemetry Constants: Centralized default Sentry DSN and PostHog capture endpoints & project tokens in TelemetryConstants.
  • Sentry Sink (SentryTelemetrySink): Implemented Sentry DSN parsing, authorization signature headers (X-Sentry-Auth), and structured crash report payloads with exception stack frames, breadcrumbs, and tags.
  • Analytics Sink (AnalyticsTelemetrySink): Implemented PostHog Capture API payload formatting, anonymous installation ID mapping, and offline queue buffer draining.
  • Dependency Injection (TelemetryModule): Registered HttpClient factory support and composed telemetry sanitizers and sinks into AppServices.
  • Lifecycle & Process Tracking: Added telemetry event dispatching across application crashes, download completions (DownloadService), update checks/applies (VelopackUpdateManager), and game session lifecycle/heartbeats (GameProcessManager).
  • Tests & Docs: Added comprehensive unit test suites covering SentryTelemetrySinkTests, AnalyticsTelemetrySinkTests, and TelemetryConstantsTests, and updated docs/dev/constants.md.

Verification

  • Targeted test suites covering Sentry DSN parsing, auth signatures, PostHog payload formatting, and buffering/flushing
  • Client-side data scrubbing and PII stripping verified via TelemetrySanitizer
  • Solution builds cleanly with no compilation errors

Created with Gemini 3.7 Flash (High) via Antigravity CLI

…cs pipeline

Implement cross-platform telemetry, crash reporting, and anonymous usage analytics for GenHub. Sentry captures unhandled application exceptions and crash forensics with automated stack trace sanitization, while PostHog ingests structured lifecycle and game session events under strict user privacy preferences.

Implemented with Gemini 3.7 Flash (High) via Antigravity CLI.
Comment thread GenHub/GenHub.Tests/GenHub.Tests.Core/Telemetry/AnalyticsTelemetrySinkTests.cs Outdated
Comment thread GenHub/GenHub.Tests/GenHub.Tests.Core/Telemetry/AnalyticsTelemetrySinkTests.cs Outdated
Comment thread GenHub/GenHub.Tests/GenHub.Tests.Core/Telemetry/AnalyticsTelemetrySinkTests.cs Outdated
Comment thread GenHub/GenHub.Tests/GenHub.Tests.Core/Telemetry/AnalyticsTelemetrySinkTests.cs Outdated
Comment thread GenHub/GenHub.Tests/GenHub.Tests.Core/Telemetry/LoggingTelemetrySinkTests.cs Outdated
Comment thread GenHub/GenHub.Tests/GenHub.Tests.Core/Telemetry/TelemetryServiceTests.cs Outdated
Comment thread GenHub/GenHub/App.axaml.cs Outdated
Comment thread GenHub/GenHub/Features/GameProfiles/Infrastructure/GameProcessManager.cs Outdated
Comment thread GenHub/GenHub/Features/Telemetry/Services/TelemetryService.cs Outdated
Comment thread GenHub/GenHub/Features/Telemetry/Sinks/SentryTelemetrySink.cs
@coderabbitai coderabbitai Bot added Enhancement New feature or request Testing Topic related to (unit) tests labels Aug 20, 2026
- Fix variable naming conflict (CS0136) in DownloadService
- Extract BuildSentryPayload helper and resolve nullability warnings in SentryTelemetrySink
- Reorder static methods before instance methods in GameProcessManager (SA1204) and simplify runner detection
- Simplify lambda expressions and null checks in App.axaml and TelemetryService
- Fix trailing blank line warnings (SA1518) across telemetry sinks and module
coderabbitai[bot]

This comment was marked as resolved.

Comment thread GenHub/GenHub.Core/Models/Common/UserSettings.cs
Comment thread GenHub/GenHub/App.axaml.cs
Comment thread GenHub/GenHub/Features/Telemetry/Services/TelemetryService.cs
Comment thread GenHub/GenHub/Features/GameProfiles/Infrastructure/GameProcessManager.cs Outdated
Comment thread GenHub/GenHub/Features/Telemetry/Services/TelemetryService.cs
Comment thread GenHub/GenHub/Features/Telemetry/Services/TelemetryService.cs
Comment thread GenHub/GenHub/Features/GameProfiles/Infrastructure/GameProcessManager.cs Outdated
Comment thread GenHub/GenHub/Features/GameProfiles/Infrastructure/GameProcessManager.cs Outdated
Comment thread GenHub/GenHub/Features/Telemetry/Sinks/AnalyticsTelemetrySink.cs
Comment thread GenHub/GenHub/Features/Telemetry/Sinks/SentryTelemetrySink.cs
…rom launch configuration

- Add XML returns documentation on Task-returning test methods (SA1615) and remove trailing blank lines (SA1518)
- Support inspecting launch configuration environment variables in DetectRunnerEnvironment
- Register session tracking in DiscoverAndTrackProcessAsync and HandleImmediateProcessExit
Comment thread GenHub/GenHub/Features/GameProfiles/Infrastructure/GameProcessManager.cs Outdated
Comment thread GenHub/GenHub/Features/GameProfiles/Infrastructure/GameProcessManager.cs Outdated
Comment thread GenHub/GenHub.Core/Constants/TelemetryConstants.cs
Comment thread GenHub/GenHub.Core/Constants/TelemetryConstants.cs
Comment thread GenHub/GenHub/App.axaml.cs Outdated
Comment thread GenHub/GenHub/Features/Telemetry/Services/TelemetryService.cs
Comment thread GenHub/GenHub/Features/GameProfiles/Infrastructure/GameProcessManager.cs Outdated
Comment thread GenHub/GenHub/Features/Telemetry/Services/TelemetryService.cs
Comment thread GenHub/GenHub.Core/Utilities/TelemetrySanitizer.cs
Comment thread GenHub/GenHub/Features/Telemetry/Sinks/AnalyticsTelemetrySink.cs Outdated
Comment thread GenHub/GenHub/Features/Telemetry/Sinks/AnalyticsTelemetrySink.cs Outdated
Comment thread GenHub/GenHub/Features/Telemetry/Sinks/SentryTelemetrySink.cs Outdated
@community-outpost community-outpost deleted a comment from kilo-code-bot Bot Aug 20, 2026
@coderabbitai coderabbitai Bot removed Enhancement New feature or request Testing Topic related to (unit) tests labels Aug 20, 2026
coderabbitai[bot]

This comment was marked as resolved.

@community-outpost community-outpost deleted a comment from qodo-code-review Bot Aug 20, 2026
…s UI controls

Add ContentName, ContentId, PublisherId, ContentType, and Strategy metadata to telemetry events, pass environment variables during child adoption, and expose the Diagnostics & Privacy settings card in SettingsView.
@community-outpost community-outpost deleted a comment from coderabbitai Bot Aug 20, 2026
@community-outpost community-outpost deleted a comment from deepsource-io Bot Aug 20, 2026
@community-outpost community-outpost deleted a comment from qodo-code-review Bot Aug 20, 2026
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.

1 participant