platformplatform / PlatformPlatform

Alpha state. A platform designed for building enterprise-grade, multi-tenant products using Azure, .NET, React, TypeScript, Infrastructure as Code, etc.
https://platformplatform.github.io
MIT License
253 stars 26 forks source link

Enhance Application Insights tracking with user-specific properties and simplified event naming #618

Closed tjementum closed 2 weeks ago

tjementum commented 2 weeks ago

Summary & Motivation

Update Application Insights tracking for custom events by adding user-specific properties such as UserId, TenantId, Local, UserRole, and IsAuthenticated. These properties are prefixed with user_ (e.g., user_Local, user_IsAuthenticated) by convention, ensuring consistency and enhancing the clarity of user-related data in telemetry.

The creation of telemetry events has also been simplified to reduce errors. Event names are now derived using GetType().Name instead of nameof(EventName), avoiding issues from copy-pasting, such as when UserUpdated events were incorrectly named as UserCreated.

Additionally, telemetry tracking is now updated to collect UserId and TenantId specifically in unauthenticated login flows and admin role changes, ensuring precise event data collection for critical user actions.

Checklist

linear[bot] commented 2 weeks ago

PP-236 Track additional custom properties for Telemetry Events

sonarcloud[bot] commented 2 weeks ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
77.6% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud