Add OTEL telemetry analysis commands#17362
Draft
davidfowl wants to merge 1 commit into
Draft
Conversation
Add Aspire CLI OTEL analysis commands for summarizing trace latency, listing top traces, aggregating span duration statistics, and analyzing wall-clock span coverage from either a live dashboard or an exported telemetry archive. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 17362Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 17362" |
Contributor
|
❓ CLI E2E Tests unknown — 95 passed, 0 failed, 5 unknown (commit View all recordings
📹 Recordings uploaded automatically from CI run #26244449803 |
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.
Description
Aspire already exposes raw OpenTelemetry logs, spans, and traces through the CLI, but quick performance investigations still require users to manually inspect telemetry or export data into another tool. This adds first-pass
aspire otelanalysis commands that answer common latency questions directly from either a live dashboard or a saved Aspire export/profile archive.The new commands are:
aspire otel summary [resource] [--file telemetry.zip] [--format json] aspire otel top-traces [resource] [--file telemetry.zip] [--top 20] [--format json] aspire otel wall-time [resource] [--file telemetry.zip] [--top 20] [--format json] aspire otel span-stats [resource] [--file telemetry.zip] [--group-by name|resource] [--top 20] [--format json]They default to analyzing the live dashboard telemetry API and use
--fileto analyze exported telemetry offline. Archive analysis merges alltraces/*.jsonentries before grouping by trace ID so traces that cross resources are analyzed as complete traces.wall-timereports trace wall-clock duration plus span interval coverage, gaps, overlap, and span-sum ratio without implying CPU utilization.Command help:
Sample output from an archive:
Validation:
dotnet build src/Aspire.Cli/Aspire.Cli.csproj /p:SkipNativeBuild=true --no-restoredotnet test --project tests/Aspire.Cli.Tests/Aspire.Cli.Tests.csproj --no-launch-profile -- --filter-class "*.TelemetryCommandTests" --filter-class "*.TelemetryAnalysisCommandTests" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"otel --helpoutput for the new command names.Fixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?