- 
                Notifications
    You must be signed in to change notification settings 
- Fork 715
Add configuration to suppress unsecured telemetry message in dashboard #11673
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
Add configuration to suppress unsecured telemetry message in dashboard #11673
Conversation
Co-authored-by: JamesNK <[email protected]>
        
          
                tests/Aspire.Dashboard.Components.Tests/Layout/MainLayoutTests.cs
              
                Outdated
          
            Show resolved
            Hide resolved
        
      …tions tests Co-authored-by: JamesNK <[email protected]>
| 🚀 Dogfood this PR with: 
 curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 11673Or 
 iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 11673" | 
There was a problem hiding this 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 adds a configuration option to suppress the unsecured telemetry message in the Aspire Dashboard when using OtlpAuthMode.Unsecured. The implementation provides administrators with the ability to hide the warning message about unsecured OTLP endpoints.
- Adds SuppressUnsecuredTelemetryMessageboolean property toOtlpOptionswith proper configuration mapping
- Updates the MainLayout logic to check both the auth mode and the new configuration option
- Enhances existing tests with a parameterized test to validate both suppressed and non-suppressed scenarios
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description | 
|---|---|
| src/Aspire.Dashboard/Configuration/DashboardOptions.cs | Adds new SuppressUnsecuredTelemetryMessageproperty toOtlpOptionsclass | 
| src/Shared/DashboardConfigNames.cs | Adds configuration name mapping for the new suppress option | 
| src/Aspire.Dashboard/Components/Layout/MainLayout.razor.cs | Updates UI logic to check configuration before showing unsecured message | 
| tests/Aspire.Dashboard.Components.Tests/Layout/MainLayoutTests.cs | Adds parameterized test and updates test helper method to support new configuration | 
        
          
                tests/Aspire.Dashboard.Components.Tests/Layout/MainLayoutTests.cs
              
                Outdated
          
            Show resolved
            Hide resolved
        
      | @ShilpiRach do you want us to backport this to 9.5.1 so it can be used by app service? | 
| /backport to release/9.5 | 
| Started backporting to release/9.5: https://github.com/dotnet/aspire/actions/runs/18415472246 | 
Plan: Add configuration to suppress unsecured message in dashboard
This PR implements a configuration option to suppress the unsecured telemetry message displayed in the Aspire Dashboard when using
OtlpAuthMode.Unsecured.Changes needed:
SuppressUnsecuredTelemetryMessageproperty toOtlpOptionsclassDashboardConfigNamesMainLayout.razor.csto check the new configuration option before showing the messageChanges implemented:
SuppressUnsecuredTelemetryMessageboolean property toOtlpOptionsclass with XML documentation explaining its purposeDashboardOtlpSuppressUnsecuredTelemetryMessageNametoDashboardConfigNameswith proper config key and environment variable mappingMainLayout.OnInitializedAsync()to check both the auth mode and the new configuration option before showing the unsecured messageOnInitialize_UnsecuredOtlp_SuppressConfigured_NoMessageBarto a parameterized test using[Theory]and[InlineData]true) and not suppressed (false) scenariosDashboardOptionsTestsas requestedConfiguration usage:
Dashboard:Otlp:SuppressUnsecuredTelemetryMessageDASHBOARD__OTLP__SUPPRESSUNSECUREDTELEMETRYMESSAGEfalse(preserves existing behavior)Test results:
The implementation is minimal and surgical, adding only the necessary functionality without breaking existing behavior. When the configuration is set to
true, the unsecured telemetry message will not be shown regardless of the user's dismiss state, while maintaining backward compatibility by defaulting tofalse.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.