You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Include exception details in dashboard product telemetry - #22705
The Dashboard's direct Azure Monitor exporter (#20730) reports the exception type but not what went wrong or where. This PR adds the standard OpenTelemetry attributes exception.message and exception.stacktrace to aspire/dashboard/error, so reviewers can distinguish failures with the same exception type.
The Dashboard and CLI share error-tag creation. The CLI's existing exception reporting is unchanged.
Dashboard string attributes are capped at 2,048 UTF-16 code units, below Azure Monitor's 8,192-character custom-property ceiling. This keeps payloads small; truncated messages and stack traces end with an ellipsis without splitting surrogate pairs.
The Dashboard previously included process.runtime.version on errors. This PR stops sending it and leaves the shared default tag commented out. In Native AOT builds it identifies the bundled runtime, not the user's installed .NET or the runtime running their AppHost. Aspire version and build ID are already reported.
No new dependencies or UI changes.
Where the fields appear
In Application Insights, filter AppTraces to Message == "aspire/dashboard/error" and inspect Properties["exception.type"], Properties["exception.message"], and Properties["exception.stacktrace"]. The stack trace is empty if unavailable. The event remains a structured log, and ASPIRE_DASHBOARD_TELEMETRY_OPTOUT=true still disables Dashboard product export.
Security considerations
The Dashboard sent messages and stacks to the legacy IDE bridge, but the Aspire VS Code extension stripped both fields before forwarding. Sending them directly to Azure Monitor therefore expands collection. Messages and stacks can include secrets, resource names, or workspace paths. Truncation limits payload size; it does not redact sensitive values. Privacy/security review is still needed before shipping. Live Azure ingestion was not tested.
Validation
Current PR head: 16 focused Dashboard tests and 8 CLI export tests passed. These cover exception attributes, truncation, and the absence of the runtime tag.
The two CLI failures reproduced in a focused rerun. Both concern NuGet source selection: AllWritersMaterializeTheComposedSourceRestriction and PrepareAsync_WithProjectReferencesAndExplicitChannel_UsesDiscoveredConfigAndPersistentPolicyOverlay. They were not verified on a clean baseline.
Fixes # (issue)
Checklist
Is this feature complete?
Yes. Ready to ship.
No. Follow-up changes expected.
Are you including unit tests for the changes and scenario tests if relevant?
Yes
No
Did you add public API?
Yes
If yes, did you have an API Review for it?
Yes
No
Did you add <remarks /> and <code /> elements on your triple slash comments?
Yes
No
No
Does the change make any security assumptions or guarantees?
Yes
If yes, have you done a threat model and had a security review?
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Exporting raw Dashboard exception messages and stacks through default-enabled product telemetry requires the pending human privacy/security review of consent and sensitive-data handling.
No open issues 🎉
What changed in this PR
This follow-up to #20730 adds exception messages and stack traces to Dashboard product telemetry, helping distinguish failures with the same exception type. It retains the existing opt-out and structured-log format.
Changes:
Share exception-tag creation and add runtime-version metadata across Dashboard and CLI product telemetry.
Bound Dashboard strings to 2,048 UTF-16 code units using surrogate-safe truncation.
Update tests and documentation for the expanded payload and its privacy implications.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The updated test expects process.runtime.version, but its fixture’s default-tag producer omits that tag, causing the assertion to fail with nine actual keys instead of ten expected keys.
Please add the completed deployment E2E run and its result for a deployed Dashboard error being exported with exception.message and exception.stacktrace. The validation listed in the PR description contains unit/component results but no completed deployment E2E result.
Updated dashboard/microsoft-collected-dashboard-telemetry.mdx to document exception.message/exception.stacktrace on aspire/dashboard/error (2,048-char truncation) and removal of process.runtime.version. Signals: defaults_or_constants_file_changed (TelemetryConstants.cs), pr_body_has_cli_flag_mention (PR body).
Note
This draft PR needs human review before merging.
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
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.
Description
The Dashboard's direct Azure Monitor exporter (#20730) reports the exception type but not what went wrong or where. This PR adds the standard OpenTelemetry attributes
exception.messageandexception.stacktracetoaspire/dashboard/error, so reviewers can distinguish failures with the same exception type.process.runtime.versionon errors. This PR stops sending it and leaves the shared default tag commented out. In Native AOT builds it identifies the bundled runtime, not the user's installed .NET or the runtime running their AppHost. Aspire version and build ID are already reported.No new dependencies or UI changes.
Where the fields appear
In Application Insights, filter
AppTracestoMessage == "aspire/dashboard/error"and inspectProperties["exception.type"],Properties["exception.message"], andProperties["exception.stacktrace"]. The stack trace is empty if unavailable. The event remains a structured log, andASPIRE_DASHBOARD_TELEMETRY_OPTOUT=truestill disables Dashboard product export.Security considerations
The Dashboard sent messages and stacks to the legacy IDE bridge, but the Aspire VS Code extension stripped both fields before forwarding. Sending them directly to Azure Monitor therefore expands collection. Messages and stacks can include secrets, resource names, or workspace paths. Truncation limits payload size; it does not redact sensitive values. Privacy/security review is still needed before shipping. Live Azure ingestion was not tested.
Validation
Current PR head: 16 focused Dashboard tests and 8 CLI export tests passed. These cover exception attributes, truncation, and the absence of the runtime tag.
Exact commands and earlier suite results
Focused tests after disabling the runtime tag:
.\.dotnet\dotnet.exe test --project .\tests\Aspire.Dashboard.Tests\Aspire.Dashboard.Tests.csproj --no-restore --no-launch-profile -- --filter-class '*.DashboardTelemetryMetadataTests' --filter-class '*.TelemetryErrorRecorderTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'.\.dotnet\dotnet.exe test --project .\tests\Aspire.Cli.Tests\Aspire.Cli.Tests.csproj --no-restore --no-launch-profile -- --filter-class '*.ReportedLogExportTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'Broader runs before disabling the runtime tag:
.\.dotnet\dotnet.exe test --project .\tests\Aspire.Dashboard.Tests\Aspire.Dashboard.Tests.csproj --no-restore --no-launch-profile -- --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'.\.dotnet\dotnet.exe test --project .\tests\Aspire.Dashboard.Components.Tests\Aspire.Dashboard.Components.Tests.csproj --no-restore --no-launch-profile -- --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'.\.dotnet\dotnet.exe test --project .\tests\Aspire.Cli.Tests\Aspire.Cli.Tests.csproj --no-restore --no-launch-profile -- --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'The two CLI failures reproduced in a focused rerun. Both concern NuGet source selection:
AllWritersMaterializeTheComposedSourceRestrictionandPrepareAsync_WithProjectReferencesAndExplicitChannel_UsesDiscoveredConfigAndPersistentPolicyOverlay. They were not verified on a clean baseline.Fixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?