Repository navigation
Add UsingBrowserRuntimeWorkload to Mono workload publish telemetry - #55089
Merged
Merged
Conversation
Co-authored-by: maraf <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a missing publish-telemetry signal in the Mono Toolchain “Current” workload manifest so telemetry can differentiate when browser runtime workload resolution is in effect during publish.
Changes:
- Extend
WorkloadPublishPropertiestelemetry payload to includeUsingBrowserRuntimeWorkloadduring the_WorkloadTelemetrytarget execution.
lewing
approved these changes
Jul 1, 2026
lewing
pushed a commit
to dotnet/runtime
that referenced
this pull request
Jul 2, 2026
…operties (#123534) ## Description Adds telemetry to capture effective values of key WASM/Blazor publish configuration properties (globalization mode, boot config shape, fingerprinting, preload behavior, bundler friendliness, runtime selection) to inform defaults and compatibility decisions. The workload extensibility is mirrored in dotnet/sdk#55026. Add workload detection in dotnet/sdk#55089. ## Changes - **Added `_GatherWasmPublishTelemetry` target** in `Microsoft.NET.Sdk.WebAssembly.Browser.targets` - Hooks into the workload telemetry pipeline via `WorkloadTelemetryDependsOn` extensibility point - Skips nested publish via `Condition="'$(WasmBuildingForNestedPublish)' != 'true'"` - Emits properties to the existing `WorkloadPublishProperties` telemetry event - Includes documentation comment linking to SDK telemetry docs for synchronization - **Captures 10 properties** using normalized internal values where applicable: - `InvariantTimezone` (derived from `BlazorEnableTimeZoneSupport`) - `InvariantGlobalization` (`_WasmInvariantGlobalization`) - `BlazorWebAssemblyLoadAllGlobalizationData` (`_BlazorWebAssemblyLoadAllGlobalizationData`) - `WasmEnableWebcil` (`_WasmEnableWebcil`) - `WasmInlineBootConfig` (`_WasmInlineBootConfig`) - `OverrideHtmlAssetPlaceholders` (raw value) - `WasmFingerprintBootConfig` (`_WasmFingerprintBootConfig`) - `WasmPreloadAssets` (`_WasmPreloadAssets`) - `WasmBundlerFriendlyBootConfig` (`_WasmBundlerFriendlyBootConfig`) - `UseMonoRuntime` (raw value) ## Notes Integrates with the existing `WorkloadPublishProperties` telemetry event. Properties collected here need to be synchronized with SDK telemetry documentation at https://github.com/dotnet/sdk/blob/main/documentation/project-docs/telemetry.md. No PII—only boolean configuration flags. <!-- START COPILOT CODING AGENT SUFFIX --> <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> > ### Issue: Add publish-time telemetry for key WebAssembly/Blazor config properties (dotnet/runtime Wasm SDK targets) > > **Repo/area:** `dotnet/runtime` — `src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets` > **Motivation:** We want visibility into which major WASM publish configuration knobs are actually being used in the wild (globalization mode, boot config shape, fingerprinting and preload behavior, bundler friendliness), to guide defaults, compatibility decisions, and performance work. > > #### Properties to capture (publish scenarios) > Please add publish-time telemetry that captures the effective values (after defaults/normalization where applicable) for: > > - `InvariantTimezone` > - `InvariantGlobalization` > - `BlazorWebAssemblyLoadAllGlobalizationData` > - `WasmEnableWebcil` > - `WasmInlineBootConfig` > - `OverrideHtmlAssetPlaceholders` > - `WasmFingerprintBootConfig` > - `WasmPreloadAssets` > - `WasmBundlerFriendlyBootConfig` > > Notes on where they appear / are derived in the targets: > - `InvariantTimezone` is set based on `BlazorEnableTimeZoneSupport` (when tz support is disabled, timezone becomes invariant). > - `InvariantGlobalization` + `BlazorWebAssemblyLoadAllGlobalizationData` drive ICU/globalization behavior (and warnings/validation). > - `WasmEnableWebcil` controls DLL → WebCIL conversion and affects publish asset composition. > - `WasmInlineBootConfig`, `WasmFingerprintBootConfig`, `OverrideHtmlAssetPlaceholders`, `WasmPreloadAssets`, and `WasmBundlerFriendlyBootConfig` control boot config format and static web asset fingerprinting/preload behavior. > - Several of these are normalized to internal `_Wasm*` properties in `_ResolveWasmConfiguration` (e.g., `_WasmEnableWebcil`, `_WasmInlineBootConfig`, `_WasmFingerprintBootConfig`, `_WasmPreloadAssets`, `_WasmBundlerFriendlyBootConfig`). Telemetry should prefer the normalized/effective values. > > #### When to emit > - Emit telemetry on **publish**, not build. > - Ideal hook point is after publish inputs are finalized (e.g., after `ProcessPublishFilesForWasm` / `GeneratePublishWasmBootJson`, or simply `AfterTargets="Publish"` if values are already stable). > - Ensure it does **not** run during nested publish scenarios if those are not representative (consider `Condition="'$(WasmBuildingForNestedPublish)' != 'true'"`). > > #### Event shape / requirements > - Use the SDK’s MSBuild telemetry mechanism (the CLI side typically forwards only allow-listed events), so either: > - reuse an existing allow-listed event name if appropriate, or > - coordinate adding a new allow-listed event name so it is not dropped. > - Payload should be key/value pairs for the properties above, using the **effective** values (e.g., `_WasmPreloadAssets` rather than raw `WasmPreloadAssets` when defaults apply). > > #### Acceptance criteria > - Telemetry is emitted once per publish (non-nested publish) for WASM projects using this targets file. > - Captures the nine properties listed above as strings (`true`/`false`/`null` as applicable). > - Verified via a test or local reproduction that the event is produced and includes these keys. > - No PII is collected (these are feature/config flags only). > > If you want, I can also suggest a concrete event name and the exact MSBuild target placement in this file that minimizes duplicate events (nested publish) and ensures values are fully resolved. </details> <!-- START COPILOT CODING AGENT TIPS --> --- 💡 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](https://gh.io/copilot-coding-agent-tips) in the docs. --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: maraf <[email protected]> Co-authored-by: Marek Fišera <[email protected]> Co-authored-by: Copilot <[email protected]>
eiriktsarpalis
pushed a commit
to dotnet/runtime
that referenced
this pull request
Jul 15, 2026
…operties (#123534) ## Description Adds telemetry to capture effective values of key WASM/Blazor publish configuration properties (globalization mode, boot config shape, fingerprinting, preload behavior, bundler friendliness, runtime selection) to inform defaults and compatibility decisions. The workload extensibility is mirrored in dotnet/sdk#55026. Add workload detection in dotnet/sdk#55089. ## Changes - **Added `_GatherWasmPublishTelemetry` target** in `Microsoft.NET.Sdk.WebAssembly.Browser.targets` - Hooks into the workload telemetry pipeline via `WorkloadTelemetryDependsOn` extensibility point - Skips nested publish via `Condition="'$(WasmBuildingForNestedPublish)' != 'true'"` - Emits properties to the existing `WorkloadPublishProperties` telemetry event - Includes documentation comment linking to SDK telemetry docs for synchronization - **Captures 10 properties** using normalized internal values where applicable: - `InvariantTimezone` (derived from `BlazorEnableTimeZoneSupport`) - `InvariantGlobalization` (`_WasmInvariantGlobalization`) - `BlazorWebAssemblyLoadAllGlobalizationData` (`_BlazorWebAssemblyLoadAllGlobalizationData`) - `WasmEnableWebcil` (`_WasmEnableWebcil`) - `WasmInlineBootConfig` (`_WasmInlineBootConfig`) - `OverrideHtmlAssetPlaceholders` (raw value) - `WasmFingerprintBootConfig` (`_WasmFingerprintBootConfig`) - `WasmPreloadAssets` (`_WasmPreloadAssets`) - `WasmBundlerFriendlyBootConfig` (`_WasmBundlerFriendlyBootConfig`) - `UseMonoRuntime` (raw value) ## Notes Integrates with the existing `WorkloadPublishProperties` telemetry event. Properties collected here need to be synchronized with SDK telemetry documentation at https://github.com/dotnet/sdk/blob/main/documentation/project-docs/telemetry.md. No PII—only boolean configuration flags. <!-- START COPILOT CODING AGENT SUFFIX --> <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> > ### Issue: Add publish-time telemetry for key WebAssembly/Blazor config properties (dotnet/runtime Wasm SDK targets) > > **Repo/area:** `dotnet/runtime` — `src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets` > **Motivation:** We want visibility into which major WASM publish configuration knobs are actually being used in the wild (globalization mode, boot config shape, fingerprinting and preload behavior, bundler friendliness), to guide defaults, compatibility decisions, and performance work. > > #### Properties to capture (publish scenarios) > Please add publish-time telemetry that captures the effective values (after defaults/normalization where applicable) for: > > - `InvariantTimezone` > - `InvariantGlobalization` > - `BlazorWebAssemblyLoadAllGlobalizationData` > - `WasmEnableWebcil` > - `WasmInlineBootConfig` > - `OverrideHtmlAssetPlaceholders` > - `WasmFingerprintBootConfig` > - `WasmPreloadAssets` > - `WasmBundlerFriendlyBootConfig` > > Notes on where they appear / are derived in the targets: > - `InvariantTimezone` is set based on `BlazorEnableTimeZoneSupport` (when tz support is disabled, timezone becomes invariant). > - `InvariantGlobalization` + `BlazorWebAssemblyLoadAllGlobalizationData` drive ICU/globalization behavior (and warnings/validation). > - `WasmEnableWebcil` controls DLL → WebCIL conversion and affects publish asset composition. > - `WasmInlineBootConfig`, `WasmFingerprintBootConfig`, `OverrideHtmlAssetPlaceholders`, `WasmPreloadAssets`, and `WasmBundlerFriendlyBootConfig` control boot config format and static web asset fingerprinting/preload behavior. > - Several of these are normalized to internal `_Wasm*` properties in `_ResolveWasmConfiguration` (e.g., `_WasmEnableWebcil`, `_WasmInlineBootConfig`, `_WasmFingerprintBootConfig`, `_WasmPreloadAssets`, `_WasmBundlerFriendlyBootConfig`). Telemetry should prefer the normalized/effective values. > > #### When to emit > - Emit telemetry on **publish**, not build. > - Ideal hook point is after publish inputs are finalized (e.g., after `ProcessPublishFilesForWasm` / `GeneratePublishWasmBootJson`, or simply `AfterTargets="Publish"` if values are already stable). > - Ensure it does **not** run during nested publish scenarios if those are not representative (consider `Condition="'$(WasmBuildingForNestedPublish)' != 'true'"`). > > #### Event shape / requirements > - Use the SDK’s MSBuild telemetry mechanism (the CLI side typically forwards only allow-listed events), so either: > - reuse an existing allow-listed event name if appropriate, or > - coordinate adding a new allow-listed event name so it is not dropped. > - Payload should be key/value pairs for the properties above, using the **effective** values (e.g., `_WasmPreloadAssets` rather than raw `WasmPreloadAssets` when defaults apply). > > #### Acceptance criteria > - Telemetry is emitted once per publish (non-nested publish) for WASM projects using this targets file. > - Captures the nine properties listed above as strings (`true`/`false`/`null` as applicable). > - Verified via a test or local reproduction that the event is produced and includes these keys. > - No PII is collected (these are feature/config flags only). > > If you want, I can also suggest a concrete event name and the exact MSBuild target placement in this file that minimizes duplicate events (nested publish) and ensures values are fully resolved. </details> <!-- START COPILOT CODING AGENT TIPS --> --- 💡 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](https://gh.io/copilot-coding-agent-tips) in the docs. --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: maraf <[email protected]> Co-authored-by: Marek Fišera <[email protected]> Co-authored-by: Copilot <[email protected]>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
WorkloadPublishPropertiesin the Mono Toolchain Current manifest telemetry target did not emit whether browser runtime workload resolution was active. This PR adds that missing signal so publish telemetry can distinguish browser-runtime workload paths from other workload configurations.Telemetry surface
WorkloadPublishPropertiesinsrc/Workloads/Manifests/Microsoft.NET.Workload.Mono.Toolchain.Current.Manifest/WorkloadTelemetry.targetswith a new property entry:UsingBrowserRuntimeWorkloadBehavioral impact
$(UsingBrowserRuntimeWorkload)value alongside existing workload-mode fields (Blazor/Wasm/Maui/AOT/etc.), improving analysis of browser-wasm workload selection.