Re-enable performance tracing capability for local runs#13214
Merged
Re-enable performance tracing capability for local runs#13214
Conversation
(it got out of sync with the implementation) Fixes #12670
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 13214Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 13214" |
Contributor
There was a problem hiding this comment.
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
IKubernetesStaticMetadatainterface with static abstractObjectKindproperty - 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
ProjectLaunchConfigurationclass to a more logical location inExecutableLaunchConfiguration.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.
danegsta
approved these changes
Nov 27, 2025
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.
Fixes #12670