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

RUM Support for Raygun4Maui #16

Merged
merged 68 commits into from
Apr 23, 2024
Merged

RUM Support for Raygun4Maui #16

merged 68 commits into from
Apr 23, 2024

Conversation

ProRedCat
Copy link
Contributor

@ProRedCat ProRedCat commented Mar 19, 2024

Raygun4Maui v2.0.0

Adds support for Real User Monitoring (RUM) for Windows, Android, iOS, and MacCatalyst

Implemented RUM Features:

  • Page Tracking
  • Page Load Times
    • Time between PageDisappearing and PageAppearing
  • Session Tracking
  • Custom Timings
    • Supports "t" type timings
  • Native iOS Timings
    • iOS/MacCatalyst specific
  • Network Timings
    • See README.md for support information

Provider Changes

  • Raygun4MauiSettings no longer inherits from RaygunLoggerConfiguration
    • RaygunSettings and RaygunLoggerConfiguration are now child elements
    • RaygunLoggerConfiguration no longer inherits RaygunSettings
  • Changes .AddRaygun4Maui to .AddRaygun
    • Introduces appsettings.json style configuration options
    • Adds overload for appsettings.json configuration method with an Action<Raygun4MauiSettings> to change settings at runtime
    • Keeps overload for .AddRaygun(Raygun4MauiSettings) - other two are more recommended
  • Adds more configuration options for RUM features
    • IgnoredViews a list of views to ignore when tracking
    • IgnoredUrls a list of url's to ignore when tracking
    • RumApiEndpoint endpoint to where the RUM data is sent
    • EnableRealUserMonitoring to enable RUM - defaults to true
    • RumFeatureFlags a enum flag to enable specific RUM features, (e.g. RumFeatures.Page | RumFeatures.Network)
  • Adds Raygun4MauiSettings to service provider for DI dependent services to edit it
  • Includes fixes from Raygun4Maui 1.4.1 and 1.4.2
    • 1.4.1
      • Fixes Android native crash due to concurrent access to environment information
    • 1.4.2
      • Fixes issues on iOS when sending a crash report on another thread
      • Fixes Android crash when ILogger is spammed with logs/errors
  • Minor version bump for Raygun4Net.NetCore to 8.2.0
    • Raygun4Net.NetCore now handles the unhandled exceptions
    • Introduces ThrottledBackgroundMessageProcessor
  • Major version bump for Raygun4Net.NetCore to v10.0.0 see changes
    • Brings in IRaygunUserProvider which we wrap in an abstract class called RaygunMauiUserProvider
    • Obsoletes User and UserInfo in the Raygun client
      • User and UserInfo are no longer supported in Raygun4Maui
    • Fixes uninstantiated fields in Raygun message causing null pointers
    • Fixes situations where Raygun client settings did not reflect the RaygunSettings object
  • Minor version bump for Raygun4Net.NetCore v10.1.0
    • Allows environment variables to be included in the crash report see changes

ProRedCat and others added 30 commits January 18, 2024 16:41
Implemented:
Page tracking/load times
Sessions
User tracking
Custom timings
Network tracking - Attempted

Packages added:
Newtonsoft (for serialization)

Todo:
Review architecture
Clean-up implementation
Added Android app lifecycle events and fixed the RaygunAppEventPublisher where multiple listeners were added to pages because of duplicate AppStarted events.
Disabled networking as it does not work on iOS and Android
The library was previously compiled for iPhoneOS arm64, and iPhoneSimulator x64 as it was compiled before Apple Silicon. This would prevent the project form being compiled as it would try linking the arm64 iPhoneSimulator to the x64 library.

The library has now been compiled for iPhoneOS arm64, and iPhoneSimulator arm64/x64.
Copy link

@Deacon-McIntyre Deacon-McIntyre left a comment

Choose a reason for hiding this comment

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

Checkpoint, submitting my comments so far while I review the remaining files

CHANGE-LOG.md Outdated Show resolved Hide resolved
CHANGE-LOG.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
CHANGE-LOG.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Raygun4Maui/MauiRUM/EventTrackers/RaygunSessionTracker.cs Outdated Show resolved Hide resolved
Raygun4Maui/MauiRUM/EventTrackers/RaygunSessionTracker.cs Outdated Show resolved Hide resolved
Raygun4Maui/MauiRUM/EventTrackers/RaygunSessionTracker.cs Outdated Show resolved Hide resolved
Fixes spelling issues and removes dead code
Copy link

@Deacon-McIntyre Deacon-McIntyre left a comment

Choose a reason for hiding this comment

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

Looks pretty good, thanks for changing the default EnableRealUserMonitoring value!

Just a list of minor stuff pretty much 🙂

Raygun4Maui/MauiRUM/EventTypes/RaygunRumEventTimingType.cs Outdated Show resolved Hide resolved
Raygun4Maui/MauiRUM/RaygunRum.cs Outdated Show resolved Hide resolved
Raygun4Maui/MauiRUM/RaygunRum.cs Show resolved Hide resolved
Raygun4Maui/MauiRUM/RaygunWebRequestHandler.cs Outdated Show resolved Hide resolved
Raygun4Maui/NativeDeviceInfo.cs Outdated Show resolved Hide resolved
Raygun4Maui/Raygun4MauiExtensions.cs Outdated Show resolved Hide resolved
}

public RaygunMauiClient(string apiKey) : base(apiKey)
// TODO: Will this actually be used, and how does it work with IRaygunUserProvider

Choose a reason for hiding this comment

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

Have these questions been answered?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not yet, @phillip-haydon any thoughts on if we should be using an IOptions instantiation of the Raygun4MauiClient? Currently, through our extension methods, we do not hit this code path so it likely does not need to be supported.

@xenolightning xenolightning removed their request for review March 20, 2024 02:33
Copy link
Contributor

@phillip-haydon phillip-haydon left a comment

Choose a reason for hiding this comment

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

Looking good, got a couple of questions and some OCD kicking off.

CHANGE-LOG.md Outdated
- Native iOS Timings
- iOS/MacCatalyst specific
- Network Timings
- See README.md for support information
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be a link to the readme.

Raygun4Maui/MauiRUM/EventTrackers/RaygunViewTracker.cs Outdated Show resolved Hide resolved
Raygun4Maui/MauiRUM/EventTrackers/RaygunViewTracker.cs Outdated Show resolved Hide resolved
Raygun4Maui/MauiRUM/RaygunRumTimingData.cs Outdated Show resolved Hide resolved
Raygun4Maui/MauiRUM/RaygunRumTimingInfo.cs Outdated Show resolved Hide resolved
Raygun4Maui/MauiRUM/RaygunSerializer.cs Outdated Show resolved Hide resolved
Raygun4Maui/MauiRUM/RaygunSerializer.cs Outdated Show resolved Hide resolved
Raygun4Maui/Raygun4MauiExtensions.cs Outdated Show resolved Hide resolved
Comment on lines +21 to +23
mauiAppBuilder.Services.AddSingleton<IRaygunMauiUserProvider, RaygunMauiUserProvider>();

mauiAppBuilder.Services.AddSingleton<IRaygunUserProvider>(sp => sp.GetRequiredService<IRaygunMauiUserProvider>());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is done so when we inject the IRaygunUserProvider or IRaygunMauiUserProvider and receive the same instance.

This allows the RaygunClient to get an instance of IRaygunUserProvider that will have the same user as available to RUM. Aliasing like this also allows for injection of the IRaygunMauiUserProvider so we do not have to cast to IRaygunMauiUserProvider to call SetUser.

Comment on lines +64 to +68
public static MauiAppBuilder AddRaygunUserProvider<T>(this MauiAppBuilder mauiAppBuilder) where T : class, IRaygunMauiUserProvider
{
mauiAppBuilder.Services.AddSingleton<IRaygunMauiUserProvider, T>();
return mauiAppBuilder;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We should only need to add an implementation for the IRaygunMauiUserProvider when setting a custom user provider due to the way it was implemented as mentioned above

@ProRedCat ProRedCat merged commit 637912c into master Apr 23, 2024
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.

4 participants