Add configuration to suppress unsecured telemetry message in dashboard#11673
Merged
Add configuration to suppress unsecured telemetry message in dashboard#11673
Conversation
Co-authored-by: JamesNK <303201+JamesNK@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add configuration to suppress unsecured message in dashboard
Add configuration to suppress unsecured telemetry message in dashboard
Sep 26, 2025
JamesNK
reviewed
Sep 26, 2025
tests/Aspire.Dashboard.Components.Tests/Layout/MainLayoutTests.cs
Outdated
Show resolved
Hide resolved
…tions tests Co-authored-by: JamesNK <303201+JamesNK@users.noreply.github.com>
16 tasks
Contributor
|
🚀 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" |
Contributor
There was a problem hiding this comment.
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 SuppressUnsecuredTelemetryMessage property to OtlpOptions class |
| 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 |
JamesNK
reviewed
Sep 26, 2025
tests/Aspire.Dashboard.Components.Tests/Layout/MainLayoutTests.cs
Outdated
Show resolved
Hide resolved
davidfowl
approved these changes
Sep 27, 2025
Member
|
@ShilpiRach do you want us to backport this to 9.5.1 so it can be used by app service? |
Member
|
/backport to release/9.5 |
Contributor
|
Started backporting to release/9.5: https://github.com/dotnet/aspire/actions/runs/18415472246 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.