Skip to content

Fix HTTP display summary with newer HTTP client telemetry#11737

Merged
davidfowl merged 1 commit intomainfrom
jamesnk/span-display-summary-httpclient
Sep 30, 2025
Merged

Fix HTTP display summary with newer HTTP client telemetry#11737
davidfowl merged 1 commit intomainfrom
jamesnk/span-display-summary-httpclient

Conversation

@JamesNK
Copy link
Copy Markdown
Member

@JamesNK JamesNK commented Sep 30, 2025

Description

Fixes #11684

After:
image

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?

@JamesNK JamesNK requested review from Copilot and removed request for Copilot September 30, 2025 08:43
@github-actions
Copy link
Copy Markdown
Contributor

🚀 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 -- 11737

Or

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

var statusCode = span.Attributes.GetValueWithFallback("http.response.status_code", "http.status_code");

return $"HTTP {httpMethod?.ToUpperInvariant()} {statusCode}";
var summary = $"HTTP {httpMethod?.ToUpperInvariant()}";
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.

This isn't new logic but can httpMethod be null?

Copy link
Copy Markdown
Member Author

@JamesNK JamesNK Sep 30, 2025

Choose a reason for hiding this comment

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

It should never be. It's a required attribute. But this is defensive just in case whatever app sends telemetry doesn't follow the spec correctly.

@davidfowl davidfowl merged commit ccda79d into main Sep 30, 2025
312 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the 9.6 milestone Sep 30, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Oct 31, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Recognize "http.request.method" and "http.response.status_code" span attributes in dashboard

2 participants