question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Do not log certain 404s as "Unknown route"

See original GitHub issue

When an endpoint returns 404, the transaction name in APM is logged as “<METHOD> Unknown route”. In some cases this is desired behavior, however it doesn’t really play well with REST. If, for example, the endpoint /api/customers/{id} returns 404 because the route exists but the customer with that id doesn’t, then we’d like to see this logged under endpoint name in APM instead of “Unknown route”.

Is your feature request related to a problem? Please describe. I guess this is related to: https://github.com/elastic/apm-agent-dotnet/pull/953/files

Describe the solution you’d like We’d like to be able to mark some endpoints in any way, so that their 404 response logs with correct transaction name

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:5
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
gregkalaposcommented, Oct 27, 2021

I think we can adjust this. This part of the spec says how it should work:

This would normally also apply to requests to unknown endpoints, e.g. the transaction for the request GET /this/path/does/not/exist would be named GET unknown route, whereas the transaction for the request GET /users/123 would still be named GET /users/{id} even if the id 123 did not match any known user and the request resulted in a 404.

So based on this, the agent isn’t aligned with the spec. By looking a bit into this, I think this check here needs to be refined. If it matches a route, we should still take it as a transaction name, even if it returns 404.

@skuc-fp just in case you don’t know - you’ll still have the full url, it’s just not in the transaction name, so you can figure out which ids returned 404, but indeed you need to dig into every single transaction (see screenshot:)

image

We’ll discuss this, but to me it seems in the specific case with existing routes we should adapt the agent and always report those with the route as the transaction name.

0reactions
gregkalaposcommented, May 24, 2022

I opened https://github.com/elastic/apm-agent-dotnet/pull/1715 which addresses this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I get Express.js to 404 only on missing routes?
404 error in a service is typically used to denote that the requested resource is not available. In this article we will see...
Read more >
404 has the message "Internal Error" · Issue #6793
Describe the bug When you hit a route that doesn't exist, the error message is "Internal Error" instead of something like "Page not...
Read more >
404s not tracked in redirect 404. [#3071041]
Problem/Motivation Whenever unknown path is checked, and this happens through the decoupled router module, 404 tracking is not performed.
Read more >
Thousands of 404 errors in Google Webmaster Tools
Webmaster Tools is notoriously slow at updating the links/errors page. In particular, even when a page is no longer linked to, ...
Read more >
URL woes. Small subset of URLs returning 404s
In my root urls.py I have the following (this is a very small preview of the entire file). CAS URLs issue urlpatterns =...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found