Add os.name, os.type, and os.version attributes to CLI telemetry#14922
Merged
JamesNK merged 1 commit intorelease/13.2from Mar 4, 2026
Merged
Add os.name, os.type, and os.version attributes to CLI telemetry#14922JamesNK merged 1 commit intorelease/13.2from
JamesNK merged 1 commit intorelease/13.2from
Conversation
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 14922Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 14922" |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds additional OS-related attributes to Aspire CLI telemetry to improve visibility into the operating systems that CLI users are running, aligning with OpenTelemetry-style OS resource attributes.
Changes:
- Added
os.name,os.type, andos.versiontag constants to CLI telemetry constants. - Populated these OS tags during
AspireCliTelemetry.InitializeAsync(). - Added a unit test asserting the OS tags exist after initialization.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| tests/Aspire.Cli.Tests/Telemetry/AspireCliTelemetryTests.cs | Adds a test to verify OS tags are present after telemetry initialization. |
| src/Aspire.Cli/Telemetry/TelemetryConstants.cs | Introduces new tag constants for OS name/type/version. |
| src/Aspire.Cli/Telemetry/AspireCliTelemetry.cs | Populates new OS tags and adds a helper to map OS platform to os.type. |
1fa3922 to
8e6d8e0
Compare
DamianEdwards
approved these changes
Mar 4, 2026
Contributor
🎬 CLI E2E Test RecordingsThe following terminal recordings are available for commit
📹 Recordings uploaded automatically from CI run #22650209756 |
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
Add
os.name,os.type, andos.versionattributes to telemetry captured in the Aspire CLI. These follow the OpenTelemetry semantic conventions for OS and provide visibility into which operating systems CLI users are running on.Changes:
os.name,os.type, andos.versiontag constants toTelemetryConstants.TagsAspireCliTelemetry.InitializeAsync()usingRuntimeInformation.OSDescription, aGetOsType()helper (returnswindows/linux/darwin), andEnvironment.OSVersion.VersionBackground for this change: Telemetry from Azure Monitor Exporter wasn't correctly identifying macOS. The fix is to add our own attributes for identifing OS.
Checklist