Skip to content

Add QUERY to known HTTP methods in HostingMetrics#63276

Open
doominator42 wants to merge 1 commit intodotnet:mainfrom
doominator42:main
Open

Add QUERY to known HTTP methods in HostingMetrics#63276
doominator42 wants to merge 1 commit intodotnet:mainfrom
doominator42:main

Conversation

@doominator42
Copy link
Copy Markdown

@doominator42 doominator42 commented Aug 15, 2025

As discussed in #61089 (comment), this PR is for adding QUERY to the known HTTP methods for hosting metrics.

  • You've read the Contributor Guide and Code of Conduct.
  • You've included unit or integration tests for your change, where applicable.
  • You've included inline docs for your change, where applicable.
  • There's an open issue for the PR that you are making. If you'd like to propose a new feature or change, please open an issue to discuss the change or find an existing issue.

@doominator42 doominator42 requested a review from halter73 as a code owner August 15, 2025 14:09
@github-actions github-actions Bot added the area-hosting Includes Hosting label Aug 15, 2025
@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Aug 15, 2025
KeyValuePair.Create(HttpMethods.Patch, HttpMethods.Patch),
KeyValuePair.Create(HttpMethods.Post, HttpMethods.Post),
KeyValuePair.Create(HttpMethods.Put, HttpMethods.Put),
KeyValuePair.Create(HttpMethods.Query, HttpMethods.Query),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@captainsafia
Copy link
Copy Markdown
Contributor

It looks like based on the linked discussion we need to put this in a holding pattern until the discussion in #62090 (review) is resolved.

@dotnet-policy-service dotnet-policy-service Bot added the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Aug 27, 2025
@dotnet-policy-service dotnet-policy-service Bot added this to the 11.0-preview1 milestone Aug 27, 2025
@doominator42
Copy link
Copy Markdown
Author

#62090 is now merged, I rebased my branch on top of it.

For the OTEL semantics, according to open-telemetry/semantic-conventions#2642 (comment), adding methods known to the instrumentation is ok and since QUERY is now supported it would still follow conventions.

Also, I did not find any tests specific to the known HTTP methods, should I just add new ones or this is good to go?

@doominator42 doominator42 reopened this Aug 27, 2025
@martincostello
Copy link
Copy Markdown
Member

/cc @JamesNK might be in your wheelhouse. Was added to SemConv by open-telemetry/semantic-conventions#2643 for v1.38.0.

@martincostello
Copy link
Copy Markdown
Member

@halter73 Could we get your review on this? Would be good to get it merged sooner rather than later so we can do validation downstream in open-telemetry/opentelemetry-dotnet-contrib with preview builds.

@martincostello
Copy link
Copy Markdown
Member

@doominator42 Would be good to add QUERY to this test:

[Theory]
[InlineData("GET", null, "GET")]
[InlineData("get", null, "GET")]
[InlineData("POST", null, "POST")]
[InlineData("PUT", null, "PUT")]
[InlineData("DELETE", null, "DELETE")]
[InlineData("PATCH", null, "PATCH")]
[InlineData("HEAD", null, "HEAD")]
[InlineData("OPTIONS", null, "OPTIONS")]
[InlineData("TRACE", null, "TRACE")]
[InlineData("CONNECT", null, "CONNECT")]
[InlineData("CUSTOM", null, "HTTP")]
[InlineData("weird", null, "HTTP")]
[InlineData("GET", "hello/{name}", "GET hello/{name}")]
[InlineData("POST", "hello/{name}", "POST hello/{name}")]
[InlineData("CUSTOM", "hello/{name}", "HTTP hello/{name}")]
public void ActivityListeners_DisplayName(string method, string route, string expectedDisplayName)

@doominator42
Copy link
Copy Markdown
Author

Added tests and rebased on main

@doominator42 doominator42 reopened this Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-hosting Includes Hosting community-contribution Indicates that the PR has been added by a community member pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants