Skip to content

Re-enable performance tracing capability for local runs#13214

Merged
karolz-ms merged 4 commits intomainfrom
dev/karolz/aspire-eventsource
Nov 27, 2025
Merged

Re-enable performance tracing capability for local runs#13214
karolz-ms merged 4 commits intomainfrom
dev/karolz/aspire-eventsource

Conversation

@karolz-ms
Copy link
Copy Markdown
Contributor

Fixes #12670

@karolz-ms karolz-ms requested a review from danegsta November 26, 2025 19:59
Copilot AI review requested due to automatic review settings November 26, 2025 19:59
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 26, 2025

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 13214

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 13214"

Copy link
Copy Markdown
Contributor

Copilot AI left a 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 re-enables performance tracing capability for local runs by introducing a new IKubernetesStaticMetadata interface with a static abstract ObjectKind property. This allows the code to access resource kind information at the type level without needing runtime instances, enabling better event source instrumentation throughout the DCP execution pipeline.

Key changes:

  • Introduced IKubernetesStaticMetadata interface with static abstract ObjectKind property
  • Added constraint to all Kubernetes service methods and related code to require IKubernetesStaticMetadata
  • Refactored event source to emit more granular performance events with resource kind and name information
  • Moved ProjectLaunchConfiguration class to a more logical location in ExecutableLaunchConfiguration.cs

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/Aspire.Hosting/Dcp/Model/ModelCommon.cs Introduces the IKubernetesStaticMetadata interface with static abstract ObjectKind property
src/Aspire.Hosting/Dcp/Model/*.cs Implements IKubernetesStaticMetadata in all DCP model classes (Executable, Container, Service, etc.)
src/Aspire.Hosting/Dcp/KubernetesService.cs Adds IKubernetesStaticMetadata constraint to all generic methods and uses T.ObjectKind for event tracing
src/Aspire.Hosting/Dcp/DcpExecutor.cs Adds comprehensive performance tracing events throughout resource creation, address allocation, and lifecycle operations
src/Aspire.Hosting/AspireEventSource.cs Refactors event definitions to accept resource kind and name parameters for granular tracing
src/Aspire.Hosting/Dcp/Model/ExecutableLaunchConfiguration.cs Moved ProjectLaunchConfiguration from Executable.cs to this file
tests/Aspire.Hosting.Tests/Dcp/TestKubernetesService.cs Updates test service to match new interface constraints
tests/Aspire.Hosting.Tests/Helpers/KubernetesHelper.cs Updates helper methods with new constraints
docs/getting-perf-traces.md Updates documentation with better examples and references

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

@karolz-ms karolz-ms merged commit c25d8fe into main Nov 27, 2025
580 of 583 checks passed
@karolz-ms karolz-ms deleted the dev/karolz/aspire-eventsource branch November 27, 2025 01:19
@dotnet-policy-service dotnet-policy-service bot added this to the 13.1 milestone Nov 27, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Dec 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Restore ability to performance-profile Aspire application startup

3 participants