Skip to content

Add UsingBrowserRuntimeWorkload to Mono workload publish telemetry - #55089

Merged
maraf merged 2 commits into
mainfrom
copilot/add-usingbrowserruntimeworkload-property
Jul 1, 2026
Merged

maraf merged 2 commits into
mainfrom
copilot/add-usingbrowserruntimeworkload-property

Conversation

Copilot AI commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

WorkloadPublishProperties in 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

    • Extend WorkloadPublishProperties in src/Workloads/Manifests/Microsoft.NET.Workload.Mono.Toolchain.Current.Manifest/WorkloadTelemetry.targets with a new property entry:
      • UsingBrowserRuntimeWorkload
  • Behavioral impact

    • Publish telemetry now carries the evaluated $(UsingBrowserRuntimeWorkload) value alongside existing workload-mode fields (Blazor/Wasm/Maui/AOT/etc.), improving analysis of browser-wasm workload selection.
<ItemGroup>
  <WorkloadPublishProperties Include="WasmSDK" Value="$(_WorkloadUsesWasmSDK)" />
  <WorkloadPublishProperties Include="UsingBrowserRuntimeWorkload" Value="$(UsingBrowserRuntimeWorkload)" />
  <WorkloadPublishProperties Include="UsesMaui" Value="$(UseMaui)" />
</ItemGroup>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 WorkloadPublishProperties telemetry payload to include UsingBrowserRuntimeWorkload during the _WorkloadTelemetry target execution.

@maraf
maraf merged commit 2432aa6 into main Jul 1, 2026
25 checks passed
@maraf
maraf deleted the copilot/add-usingbrowserruntimeworkload-property branch July 1, 2026 20:33
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]>
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-preview7 milestone Jul 6, 2026
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants