Skip to content

Add unhandled request log and metric to hosting #48669

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 10, 2023

Conversation

JamesNK
Copy link
Member

@JamesNK JamesNK commented Jun 8, 2023

Fixes #46404

This PR:

  • Adds an "unhandled-requests" counter to hosting
  • Adds an unhandled request log message to hosting
  • Removes the unhandled request log message from app builder (moved to hosting, see above)

Ready for review. Blocked on API review of counter name.

@JamesNK JamesNK added area-hosting Includes Hosting blocked The work on this issue is blocked due to some dependency and removed area-runtime labels Jun 8, 2023
@JamesNK JamesNK removed the blocked The work on this issue is blocked due to some dependency label Jun 9, 2023
@JamesNK JamesNK merged commit 188d4b0 into main Jun 10, 2023
@JamesNK JamesNK deleted the jamesnk/unhandledrequest-log-metric branch June 10, 2023 02:51
@ghost ghost added this to the 8.0-preview6 milestone Jun 10, 2023
@JamesNK JamesNK added the blog-candidate Consider mentioning this in the release blog post label Jun 30, 2023
@ghost
Copy link

ghost commented Jun 30, 2023

@JamesNK, this change will be considered for inclusion in the blog post for the release it'll ship in. Nice work!

Please ensure that the original comment in this thread contains a clear explanation of what the change does, why it's important (what problem does it solve?), and, if relevant, include things like code samples and/or performance numbers.

This content may not be exactly what goes into the blog post, but it will help the team putting together the announcement.

Thanks!


internal sealed class HostingRequestUnhandledLog : IReadOnlyList<KeyValuePair<string, object?>>
{
private const string OriginalFormat = "Request reached the end of the middleware pipeline without being handled by application code. Request path: {Method} {Scheme}://{Host}{PathBase}{Path}, Response status code: {StatusCode}";
Copy link
Member

Choose a reason for hiding this comment

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

This should be a {url} field.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-hosting Includes Hosting blog-candidate Consider mentioning this in the release blog post
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Counters & Logs for 404s and MapFallback
4 participants