Skip to content

Conversation

@ysmoradi
Copy link
Member

@ysmoradi ysmoradi commented Nov 19, 2025

closes #11682

Summary by CodeRabbit

Release Notes

  • New Features

    • Added cross-platform Blazor Hybrid support with platform-specific device configuration.
    • Enhanced telemetry collection with OpenTelemetry and Azure Monitor integration.
    • Introduced environment variable configuration support.
  • Documentation

    • Updated logging, OpenTelemetry, and health checks guidance.
  • Chores

    • Upgraded dependencies including Sentry and OpenTelemetry packages.
    • Improved cancellation handling across the application.
    • Refined trace sampling configuration for monitoring.

✏️ Tip: You can customize this high-level summary in your review settings.

@ysmoradi ysmoradi requested a review from Copilot November 19, 2025 21:22
@coderabbitai
Copy link

coderabbitai bot commented Nov 19, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

The changes migrate client-side telemetry from Application Insights to OpenTelemetry for MAUI and Windows platforms, introduce a TryCancel extension method for safer CancellationTokenSource cancellation, add Aspire MAUI hosting support, enable platform-specific device configurations in AppHost, and update dependencies including Sentry packages.

Changes

Cohort / File(s) Summary
CancellationTokenSource Refactoring
src/Shared/Extensions/CancellationTokenSourceExtensions.cs, src/Client/Boilerplate.Client.Core/Components/AppComponentBase.cs, src/Client/Boilerplate.Client.Core/Components/Layout/MainLayout.razor.cs, src/Client/Boilerplate.Client.Core/Components/Pages/Management/RolesPage.razor.cs, src/Client/Boilerplate.Client.Core/Components/Pages/Management/UsersPage.razor.cs, src/Server/Boilerplate.Server.Api/SignalR/AppHub.Chatbot.cs
New TryCancel() extension method added for safe asynchronous cancellation; multiple components updated to use TryCancel() instead of CancelAsync() with exception handling built into the extension.
MAUI OpenTelemetry Migration
src/Client/Boilerplate.Client.Maui/Boilerplate.Client.Maui.csproj, src/Client/Boilerplate.Client.Maui/MauiProgram.Services.cs, src/Client/Boilerplate.Client.Maui/Services/MauiAppInsightsTelemetryInitializer.cs
Dependency replaced from Microsoft.Extensions.Logging.ApplicationInsights to Azure.Monitor.OpenTelemetry.Exporter; MauiProgram.Services refactored to use OpenTelemetry logging with Azure Monitor exporter; Application Insights telemetry initializer removed.
Windows OpenTelemetry Migration
src/Client/Boilerplate.Client.Windows/Boilerplate.Client.Windows.csproj, src/Client/Boilerplate.Client.Windows/Program.Services.cs, src/Client/Boilerplate.Client.Windows/Program.cs, src/Client/Boilerplate.Client.Windows/Services/WindowsAppInsightsTelemetryInitializer.cs
Dependencies updated: ApplicationInsights replaced with Azure Monitor OpenTelemetry Exporter; added Microsoft.Extensions.Configuration.EnvironmentVariables and OpenTelemetry.Exporter.OpenTelemetryProtocol; Program.Services refactored to OpenTelemetry with conditional Azure Monitor and OTLP exporters; Program.cs adds environment variable configuration; Application Insights telemetry initializer removed.
Central Package Management
src/Directory.Packages.props
Added Microsoft.Extensions.Configuration.EnvironmentVariables (10.0.0) and conditional Aspire.Hosting.Maui; replaced Microsoft.Extensions.Logging.ApplicationInsights with Azure.Monitor.OpenTelemetry.Exporter (1.5.0) under appInsights condition; updated Sentry packages to 6.0.0-rc.1-prerelease.
AppHost Platform Support
src/Server/Boilerplate.Server.AppHost/Boilerplate.Server.AppHost.csproj, src/Server/Boilerplate.Server.AppHost/Program.cs
Added Aspire.Hosting.Maui package reference; Program.cs restructured to conditionally include Windows client project and introduce MAUI project with platform-specific device configurations (Windows, MacCatalyst, iOS device/simulator, Android device/emulator) with OTLP telemetry tunnels.
Server-Side Updates
src/Server/Boilerplate.Server.Api/SignalR/AppChatbot.cs
Private field renamed from variables to variablesPrompt; field initialization updated to use formatted string; method updated to pass renamed field to AI chat client.
Documentation & Configuration
.docs/15- Logging, OpenTelemetry and Health Checks.md, src/Shared/appsettings.json
Documentation updated to reference IOpenTelemetryExtensions instead of WebApplicationBuilderExtensions, adds details about BlazorApplicationInsights SDK, and expands OpenTelemetry configuration coverage (Metrics and Tracing details); Sentry configuration extended with TracesSampleRate: 1.0.

Sequence Diagram

sequenceDiagram
    participant App as MAUI/Windows App
    participant OTel as OpenTelemetry
    participant AzMon as Azure Monitor Exporter
    participant OTLP as OTLP Exporter
    
    rect rgb(200, 220, 240)
    Note over App,OTLP: Old Flow (Application Insights)
    App->>App: ITelemetryInitializer.Initialize()
    App->>App: Populate telemetry context
    App->>App: Send to Application Insights
    end
    
    rect rgb(220, 240, 220)
    Note over App,OTLP: New Flow (OpenTelemetry)
    App->>OTel: AddOpenTelemetry.AddLogging()
    OTel->>OTel: IncludeFormattedMessage & IncludeScopes
    
    alt Azure Monitor Exporter
        OTel->>AzMon: Azure Monitor exporter<br/>(if connection string)
        AzMon->>App: Telemetry exported
    end
    
    alt OTLP Exporter
        OTel->>OTLP: OTLP exporter<br/>(if OTEL_EXPORTER_OTLP_ENDPOINT)
        OTLP->>App: Telemetry exported
    end
    end
Loading
sequenceDiagram
    participant DevHost as AppHost
    participant Windows as Windows Client
    participant Maui as MAUI Client
    participant Devices as Platform Devices
    
    rect rgb(240, 220, 220)
    Note over DevHost,Devices: AppHost Multi-Platform Setup
    
    DevHost->>DevHost: Check OS.IsWindows()
    
    alt Windows
        DevHost->>Windows: Add Windows project
        Windows->>Devices: Configure Windows app
    end
    
    DevHost->>Maui: Add MAUI project
    
    alt Platform Conditionals
        Maui->>Devices: Windows device
        Maui->>Devices: macOS (MacCatalyst)
        Maui->>Devices: iOS device + simulator
        Maui->>Devices: Android device + emulator
    end
    
    Devices->>Devices: Enable OTLP tunnels<br/>(iOS devices)
    Devices->>DevHost: Connect to AppHost tunnels
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Areas requiring extra attention:

  • AppHost Program.cs — Complex platform-specific device configuration logic with nested conditionals and tunnel setup; verify correct OS checks and device initialization order.
  • OpenTelemetry migration (MAUI & Windows) — Ensure conditional connection string handling for Azure Monitor exporter is correct and all legacy Application Insights references are removed; verify OTLP endpoint configuration.
  • CancellationTokenSource.TryCancel extension — Review exception handling logic for ObjectDisposedException and validate all callsites properly await the returned Task<bool> if return value semantics matter.
  • Package dependency changes — Verify Sentry update to rc.1-prerelease does not introduce breaking changes and Aspire.Hosting.Maui integration is compatible with existing projects.

Poem

🐰 Cancellation tokens now safely hop,
From Insights old to OpenTelemetry's top,
MAUI and Windows dance in platform light,
With Azure and OTLP shining bright,
AppHost orchestrates devices with glee—telemetry flows wild and free! 📡✨

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning Most changes are scoped to OpenTelemetry implementation; however, unrelated changes like CancellationTokenSource.TryCancel() extension, Sentry configuration updates, and AppHub/AppChatbot modifications appear outside the core objective. Remove unrelated changes such as CancellationTokenSource.TryCancel() extension method, Sentry trace sampling configuration, and chatbot/hub modifications that don't directly support OpenTelemetry enablement.
Docstring Coverage ⚠️ Warning Docstring coverage is 35.71% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and clearly summarizes the main change: enabling OpenTelemetry in the bit Boilerplate template's Windows and MAUI clients.
Linked Issues check ✅ Passed Changes implement OpenTelemetry support across MAUI and Windows clients through dependency updates, configuration changes, telemetry initializer removals, and extension methods.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot finished reviewing on behalf of ysmoradi November 19, 2025 21:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enables OpenTelemetry support for Windows and MAUI clients in the bit Boilerplate template, migrating from direct Application Insights integration to a unified OpenTelemetry-based approach with support for both OTLP and Azure Monitor exporters.

Key Changes:

  • Replaces Application Insights telemetry initializers with OpenTelemetry processors for client applications
  • Adds Aspire MAUI hosting support with platform-specific device configurations
  • Updates Sentry packages to rc.1 and replaces Application Insights logging with Azure Monitor OpenTelemetry exporter

Reviewed Changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
Boilerplate.Server.AppHost/Program.cs Adds MAUI project configuration with OS-specific device runners (Windows, Mac Catalyst, iOS, Android) and OTLP dev tunnel support; moves Windows client to OS-conditional block
Boilerplate.Server.AppHost.csproj Adds Aspire.Hosting.Maui package reference for MAUI project hosting support
Boilerplate.Server.Api/SignalR/AppChatbot.cs Renames variables to variablesPrompt for improved clarity
Directory.Packages.props Updates Sentry packages to 6.0.0-rc.1, adds Aspire.Hosting.Maui and Microsoft.Extensions.Configuration.EnvironmentVariables, replaces Application Insights logging with Azure.Monitor.OpenTelemetry.Exporter
Boilerplate.Client.Windows/Services/WindowsTelemetryEnrichmentProcessor.cs New OpenTelemetry processor that enriches telemetry with Windows-specific context and filters Blazor SignalR/event activities
Boilerplate.Client.Windows/Services/WindowsAppInsightsTelemetryInitializer.cs Removed - replaced by OpenTelemetry-based enrichment
Boilerplate.Client.Windows/Program.cs Adds environment variables configuration support for OpenTelemetry endpoint injection
Boilerplate.Client.Windows/Program.Services.cs Replaces Application Insights logging with OpenTelemetry configuration
Boilerplate.Client.Windows/Boilerplate.Client.Windows.csproj Updates package references for OpenTelemetry support, links shared extension file
Boilerplate.Client.Maui/Services/MauiTelemetryEnrichmentProcessor.cs New OpenTelemetry processor with MAUI-specific device enrichment and activity filtering
Boilerplate.Client.Maui/Services/MauiAppInsightsTelemetryInitializer.cs Removed - replaced by OpenTelemetry-based enrichment
Boilerplate.Client.Maui/MauiProgram.Services.cs Replaces Application Insights logging with OpenTelemetry configuration
Boilerplate.Client.Maui/Extensions/IOpenTelemetryExtensions.cs New extension method for configuring OpenTelemetry with OTLP and Azure Monitor exporters
Boilerplate.Client.Maui/Boilerplate.Client.Maui.csproj Adds OpenTelemetry and Azure Monitor package references
Comments suppressed due to low confidence (1)

src/Templates/Boilerplate/Bit.Boilerplate/src/Directory.Packages.props:62

  • Inconsistent Aspire package versions detected. Aspire.Hosting.Maui and Aspire.Hosting.DevTunnels use preview version 13.0.0-preview.1.25560.3, while Aspire.Hosting.Testing and Aspire.Hosting.AppHost use stable version 13.0.0.

For consistency and compatibility, all Aspire.Hosting packages should use the same version. Consider either:

  1. Using stable 13.0.0 for all packages if the preview features aren't required
  2. Using the same preview version for all packages if preview features are needed
        <PackageVersion Condition=" '$(aspire)' == 'true' OR '$(aspire)' == '' " Include="Aspire.Hosting.Maui" Version="13.0.0-preview.1.25560.3" />
        <PackageVersion Condition=" '$(aspire)' == 'true' OR '$(aspire)' == '' " Include="Aspire.Hosting.Testing" Version="13.0.0" />
        <PackageVersion Condition=" '$(aspire)' == 'true' OR '$(aspire)' == '' " Include="CommunityToolkit.Aspire.Hosting.MailPit" Version="9.9.0" />
        <PackageVersion Condition=" '$(aspire)' == 'true' OR '$(aspire)' == '' " Include="Aspire.Hosting.DevTunnels" Version="13.0.0-preview.1.25560.3" />
        <PackageVersion Condition=" '$(aspire)' == 'true' OR '$(aspire)' == '' " Include="Aspire.Hosting.AppHost" Version="13.0.0" />

ysmoradi and others added 5 commits November 20, 2025 11:20
…te.Client.Maui/Extensions/IOpenTelemetryExtensions.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Yaser Moradi <ysmoradi@outlook.com>
@ysmoradi ysmoradi marked this pull request as ready for review November 20, 2025 13:31
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

♻️ Duplicate comments (1)
src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.AppHost/Program.cs (1)

124-129: Windows Blazor Hybrid client not wired to server or OTLP dev tunnel

clientwindows is only marked with .WithExplicitStart() and has neither a reference to serverWebProject nor .WithOtlpDevTunnel(). That means:

  • No explicit dependency/link to the server (unlike the MAUI devices).
  • No OpenTelemetry dev tunnel wiring, which undermines the PR goal for the Windows client.

Align it with the MAUI/mobile pattern and the earlier suggestion:

-    if (OperatingSystem.IsWindows())
-    {
-        // Blazor Hybrid Windows project.
-        builder.AddProject("clientwindows", "../../Client/Boilerplate.Client.Windows/Boilerplate.Client.Windows.csproj")
-            .WithExplicitStart();
-    }
+    if (OperatingSystem.IsWindows())
+    {
+        // Blazor Hybrid Windows project.
+        builder.AddProject("clientwindows", "../../Client/Boilerplate.Client.Windows/Boilerplate.Client.Windows.csproj")
+            .WithExplicitStart()
+            .WithOtlpDevTunnel()
+            .WithReference(serverWebProject, tunnel);
+    }
🧹 Nitpick comments (5)
src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/SignalR/AppChatbot.cs (1)

69-75: Consider adding defensive null check for variablesPrompt.

The initialization logic is correct. However, at line 97-98, only supportSystemPrompt is checked to verify that StartChat was called. Since variablesPrompt is also initialized in StartChat and used at line 110, consider adding it to the guard condition for consistency:

-        if (string.IsNullOrEmpty(supportSystemPrompt))
+        if (string.IsNullOrEmpty(supportSystemPrompt) || string.IsNullOrEmpty(variablesPrompt))
             throw new InvalidOperationException("Chat session must be started before processing messages. Call Start method first.");
src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/appsettings.json (1)

39-39: Consider environment-specific trace sampling rates.

A TracesSampleRate of 1.0 (100%) may generate excessive telemetry data in high-traffic production environments, potentially increasing costs. Consider using environment-specific configuration to apply lower sampling rates in production while maintaining full sampling in development.

src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Extensions/CancellationTokenSourceExtensions.cs (1)

8-19: Implementation is correct, but return value is unused.

The TryCancel() implementation correctly handles ObjectDisposedException during cancellation. However, all call sites in the codebase ignore the boolean return value, suggesting it may not be necessary.

This is acceptable as-is for defensive coding, but consider whether returning Task instead of Task<bool> would better reflect actual usage patterns.

src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.AppHost/Program.cs (2)

132-171: MAUI device OTLP wiring is asymmetric; confirm Windows/MacCatalyst behavior

The MAUI iOS and Android devices/emulators are correctly wired with .WithOtlpDevTunnel().WithReference(serverWebProject, tunnel), but:

  • mauiapp.AddWindowsDevice() only has .WithExplicitStart().WithReference(serverWebProject).
  • mauiapp.AddMacCatalystDevice() only has .WithExplicitStart().WithReference(serverWebProject).

If the intent is that all MAUI targets participate in OpenTelemetry via the same OTLP dev tunnel, consider aligning these with the mobile pattern:

-    if (OperatingSystem.IsWindows())
-    {
-        mauiapp.AddWindowsDevice()
-            .WithExplicitStart()
-            .WithReference(serverWebProject);
-    }
+    if (OperatingSystem.IsWindows())
+    {
+        mauiapp.AddWindowsDevice()
+            .WithExplicitStart()
+            .WithOtlpDevTunnel()
+            .WithReference(serverWebProject, tunnel);
+    }

-    if (OperatingSystem.IsMacOS())
-    {
-        mauiapp.AddMacCatalystDevice()
-            .WithExplicitStart()
-            .WithReference(serverWebProject);
-    }
+    if (OperatingSystem.IsMacOS())
+    {
+        mauiapp.AddMacCatalystDevice()
+            .WithExplicitStart()
+            .WithOtlpDevTunnel()
+            .WithReference(serverWebProject, tunnel);
+    }

If Windows/MacCatalyst are meant to talk to a local/hosted collector without the tunnel, a brief code comment explaining the difference would help future readers.


141-161: Consider consolidating duplicate OperatingSystem.IsMacOS() checks

You use OperatingSystem.IsMacOS() twice: once for AddMacCatalystDevice and again for iOS device/simulator. Functionally fine, but you could slightly simplify:

if (OperatingSystem.IsMacOS())
{
    mauiapp.AddMacCatalystDevice()
        .WithExplicitStart()
        .WithReference(serverWebProject);

    // Windows supports iOS... (existing comment)
    mauiapp.AddiOSDevice()
        .WithExplicitStart()
        .WithOtlpDevTunnel()
        .WithReference(serverWebProject, tunnel);

    mauiapp.AddiOSSimulator()
        .WithExplicitStart()
        .WithOtlpDevTunnel()
        .WithReference(serverWebProject, tunnel);
}

Not required, but it reduces repetition and keeps the Mac-specific config in one place.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between 546a68a and 11a06a2.

📒 Files selected for processing (19)
  • src/Templates/Boilerplate/Bit.Boilerplate/.docs/15- Logging, OpenTelemetry and Health Checks.md (1 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/AppComponentBase.cs (2 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Layout/MainLayout.razor.cs (2 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Management/RolesPage.razor.cs (2 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Management/UsersPage.razor.cs (1 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Boilerplate.Client.Maui.csproj (2 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/MauiProgram.Services.cs (2 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Services/MauiAppInsightsTelemetryInitializer.cs (0 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Boilerplate.Client.Windows.csproj (1 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Program.Services.cs (2 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Program.cs (1 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Services/WindowsAppInsightsTelemetryInitializer.cs (0 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Directory.Packages.props (4 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/SignalR/AppChatbot.cs (3 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/SignalR/AppHub.Chatbot.cs (1 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.AppHost/Boilerplate.Server.AppHost.csproj (1 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.AppHost/Program.cs (1 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/Extensions/CancellationTokenSourceExtensions.cs (1 hunks)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Shared/appsettings.json (1 hunks)
💤 Files with no reviewable changes (2)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Services/WindowsAppInsightsTelemetryInitializer.cs
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Services/MauiAppInsightsTelemetryInitializer.cs
🧰 Additional context used
🪛 LanguageTool
src/Templates/Boilerplate/Bit.Boilerplate/.docs/15- Logging, OpenTelemetry and Health Checks.md

[grammar] ~258-~258: Ensure spelling is correct
Context: ...t.Core project would collect JavaScript erros and more from Browser and Blazor Hybrid...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build and test
🔇 Additional comments (15)
src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/SignalR/AppChatbot.cs (2)

30-30: LGTM: Improved field naming.

The rename from variables to variablesPrompt better conveys that this field holds a formatted prompt string containing variable substitutions rather than a collection of variables.


110-110: LGTM: Consistent usage.

The field is correctly used as a system message in the chat completion request, consistent with the rename.

src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/SignalR/AppHub.Chatbot.cs (1)

46-46: LGTM!

The migration to TryCancel() provides safer cancellation handling by gracefully handling potential ObjectDisposedException race conditions when canceling ongoing message processing.

src/Templates/Boilerplate/Bit.Boilerplate/.docs/15- Logging, OpenTelemetry and Health Checks.md (1)

254-256: LGTM!

Documentation correctly reflects the migration of OpenTelemetry configuration to IOpenTelemetryExtensions.cs.

src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/AppComponentBase.cs (1)

258-258: LGTM!

The migration to TryCancel() in both Abort() and DisposeAsync() properly handles potential race conditions during component lifecycle management.

Also applies to: 267-267

src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Management/UsersPage.razor.cs (1)

113-113: LGTM!

Using TryCancel() when switching between users prevents potential race conditions and gracefully handles cancellation of in-flight data loading operations.

src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Pages/Management/RolesPage.razor.cs (1)

100-100: LGTM!

The migration to TryCancel() in both role selection and disposal aligns with the broader cancellation pattern, providing safer handling of concurrent cancellation scenarios.

Also applies to: 401-401

src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Components/Layout/MainLayout.razor.cs (1)

146-146: LGTM!

The use of TryCancel() properly handles cancellation during authentication state changes and component disposal, preventing potential exceptions in concurrent scenarios.

Also applies to: 199-199

src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.AppHost/Boilerplate.Server.AppHost.csproj (1)

15-15: Adding Aspire.Hosting.Maui to AppHost is consistent with the Aspire/Maui hosting setup.

The new package reference aligns AppHost with the MAUI hosting support configured elsewhere and with the central version in Directory.Packages.props; no issues from this change.

src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Program.cs (1)

28-31: Environment variable configuration provider is wired in correctly.

Chaining AddEnvironmentVariables() after AddClientConfigurations(...) makes environment values act as overrides for client config, which is a good default for the template.

src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Maui/Boilerplate.Client.Maui.csproj (2)

1-1: Encoding/BOM cleanup on the <Project> element is fine.

No behavioral impact; just makes diffs cleaner.


172-175: MAUI telemetry package switch to Azure Monitor OpenTelemetry exporter looks correct.

The conditional references for Newtonsoft.Json, Sentry.Maui, and Azure.Monitor.OpenTelemetry.Exporter under the existing appInsights/sentry flags are consistent with the new OpenTelemetry-based wiring in the services code and with the central package versions.

src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Program.Services.cs (1)

2-7: Windows OpenTelemetry logging configuration is coherent and matches the new dependencies.

AddOpenTelemetry with formatted messages/scopes, conditional Azure Monitor export (when a connection string exists), and OTLP export behind OTEL_EXPORTER_OTLP_ENDPOINT is a solid setup, and ordering with ConfigureLoggers and AddEventLog looks fine.

Also applies to: 61-83

src/Templates/Boilerplate/Bit.Boilerplate/src/Directory.Packages.props (1)

29-96: Central package additions/updates (env vars, Aspire.Hosting.Maui, Sentry, Azure Monitor exporter) are aligned with the code changes.

The new central versions back the configuration/env-var provider, Aspire hosting for MAUI, Sentry RC bump, and Azure Monitor OpenTelemetry exporter used in the client projects. Please just ensure you run at least one template build with sentry and appInsights variants enabled to confirm there are no unexpected version interactions.

src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Boilerplate.Client.Windows.csproj (1)

40-50: Windows client package references now correctly match the new logging and configuration pipeline.

The added env-var configuration provider and OTLP exporter packages, plus the switch to Azure.Monitor.OpenTelemetry.Exporter under the existing appInsights condition, line up with the updated Program and logging code.

@ysmoradi ysmoradi merged commit e67e75d into bitfoundation:develop Nov 20, 2025
2 of 3 checks passed
@ysmoradi ysmoradi deleted the insights branch November 20, 2025 13:42
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.

bit Boilerplate project template's clients (maui & windows) don't support open telemetry

1 participant