{"action":"closed","issue":{"url":"https://api.github.com/repos/spring-projects/spring-boot/issues/12577","repository_url":"https://api.github.com/repos/spring-projects/spring-boot","labels_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/12577/labels{/name}","comments_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/12577/comments","events_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/12577/events","html_url":"https://github.com/spring-projects/spring-boot/issues/12577","id":307249965,"number":12577,"title":"WebMvgTags.uri uses NOT_FOUND for a matched request mapping that produces a 404 response","user":{"login":"jceloi","id":5495928,"avatar_url":"https://avatars1.githubusercontent.com/u/5495928?v=4","gravatar_id":"","url":"https://api.github.com/users/jceloi","html_url":"https://github.com/jceloi","followers_url":"https://api.github.com/users/jceloi/followers","following_url":"https://api.github.com/users/jceloi/following{/other_user}","gists_url":"https://api.github.com/users/jceloi/gists{/gist_id}","starred_url":"https://api.github.com/users/jceloi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jceloi/subscriptions","organizations_url":"https://api.github.com/users/jceloi/orgs","repos_url":"https://api.github.com/users/jceloi/repos","events_url":"https://api.github.com/users/jceloi/events{/privacy}","received_events_url":"https://api.github.com/users/jceloi/received_events","type":"User","site_admin":false},"labels":[{"id":16916891,"url":"https://api.github.com/repos/spring-projects/spring-boot/labels/type:%20bug","name":"type: bug","color":"d4c5f9","default":false}],"state":"closed","locked":false,"assignee":{"login":"bclozel","id":103264,"avatar_url":"https://avatars2.githubusercontent.com/u/103264?v=4","gravatar_id":"","url":"https://api.github.com/users/bclozel","html_url":"https://github.com/bclozel","followers_url":"https://api.github.com/users/bclozel/followers","following_url":"https://api.github.com/users/bclozel/following{/other_user}","gists_url":"https://api.github.com/users/bclozel/gists{/gist_id}","starred_url":"https://api.github.com/users/bclozel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bclozel/subscriptions","organizations_url":"https://api.github.com/users/bclozel/orgs","repos_url":"https://api.github.com/users/bclozel/repos","events_url":"https://api.github.com/users/bclozel/events{/privacy}","received_events_url":"https://api.github.com/users/bclozel/received_events","type":"User","site_admin":false},"assignees":[{"login":"bclozel","id":103264,"avatar_url":"https://avatars2.githubusercontent.com/u/103264?v=4","gravatar_id":"","url":"https://api.github.com/users/bclozel","html_url":"https://github.com/bclozel","followers_url":"https://api.github.com/users/bclozel/followers","following_url":"https://api.github.com/users/bclozel/following{/other_user}","gists_url":"https://api.github.com/users/bclozel/gists{/gist_id}","starred_url":"https://api.github.com/users/bclozel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bclozel/subscriptions","organizations_url":"https://api.github.com/users/bclozel/orgs","repos_url":"https://api.github.com/users/bclozel/repos","events_url":"https://api.github.com/users/bclozel/events{/privacy}","received_events_url":"https://api.github.com/users/bclozel/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/spring-projects/spring-boot/milestones/98","html_url":"https://github.com/spring-projects/spring-boot/milestone/98","labels_url":"https://api.github.com/repos/spring-projects/spring-boot/milestones/98/labels","id":3152524,"number":98,"title":"2.0.1","description":"","creator":{"login":"philwebb","id":519772,"avatar_url":"https://avatars1.githubusercontent.com/u/519772?v=4","gravatar_id":"","url":"https://api.github.com/users/philwebb","html_url":"https://github.com/philwebb","followers_url":"https://api.github.com/users/philwebb/followers","following_url":"https://api.github.com/users/philwebb/following{/other_user}","gists_url":"https://api.github.com/users/philwebb/gists{/gist_id}","starred_url":"https://api.github.com/users/philwebb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philwebb/subscriptions","organizations_url":"https://api.github.com/users/philwebb/orgs","repos_url":"https://api.github.com/users/philwebb/repos","events_url":"https://api.github.com/users/philwebb/events{/privacy}","received_events_url":"https://api.github.com/users/philwebb/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":120,"state":"open","created_at":"2018-03-01T06:07:33Z","updated_at":"2018-03-29T18:37:54Z","due_on":"2018-04-05T07:00:00Z","closed_at":null},"comments":9,"created_at":"2018-03-21T13:43:26Z","updated_at":"2018-03-29T18:37:54Z","closed_at":"2018-03-29T18:37:53Z","author_association":"NONE","body":"Greetings,\r\n\r\nI'm migrating my project from Boot 1.5.x to 2.0.0.RELEASE and to micrometer in the process.\r\nI'm a bit annoyed with WebMvcTags' default behavior regarding exceptions and URI tracking for a WebMVC REST API application :\r\n\r\n```\r\n\tpublic static Tag uri(HttpServletRequest request, HttpServletResponse response) {\r\n\t\tif (response != null) {\r\n\t\t\tHttpStatus status = extractStatus(response);\r\n\t\t\tif (status != null && status.is3xxRedirection()) {\r\n\t\t\t\treturn Tag.of(\"uri\", \"REDIRECTION\");\r\n\t\t\t}\r\n\t\t\tif (status != null && status.equals(HttpStatus.NOT_FOUND)) {\r\n\t\t\t\treturn Tag.of(\"uri\", \"NOT_FOUND\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (request == null) {\r\n\t\t\treturn Tag.of(\"uri\", \"UNKNOWN\");\r\n\t\t}\r\n\t\tString uri = getUri(request);\r\n\t\turi = uri.replaceAll(\"//+\", \"/\").replaceAll(\"/$\", \"\");\r\n\t\treturn Tag.of(\"uri\", uri.isEmpty() ? \"root\" : uri);\r\n\t}\r\n```\r\n\r\nThis implies that All 404 errors won't have any specific URI information, being grouped in that NOT_FOUND uri.\r\nThis does effectly prevents anything relevant from being retrieved of those metrics.\r\n\r\nIt seems to me that using relevant http codes for functional returns is a good practice, but this default tag provider harms this.\r\n\r\nWas the reason backing this implementation to avoid creating meaningless metrics entries for each and every false / crawled URI ? It could be worth it checking wether the initial URI did match a correct route, and in that case, use the route's mapping as uri.\r\n\r\nThanks for any hint / answer\r\n\r\n"}}
{"actor":{"display_login":"bclozel"}}