The version of the Elastic.Apm nuget package used: master branch directly, AspNetFullFrameworkSampleApp
Operating system and version: Windows Version 10.0.19042.804
.NET Framework/Core name and version (e.g. .NET 4.6.1, NET Core 3.1.100) : .NET 4.6.1
Application Target Framework(s) (e.g. net461, netcoreapp3.1): net461
Transaction names are generated from request.Unvalidated.Path for WebApi routes that have [Route] attribute on it.
Steps to reproduce the behavior:
master branch (set default apm and kibana from for example Quick start guide AspNetFullFrameworkSampleApp.Controllers.WebApiController[RoutePrefix("api/webapi")]
public class WebApiController : ApiController
{
...
[HttpGet]
[Route("{someId}")]
public IHttpActionResult AskMe(Guid someId) => Ok($"This is an example response from a web api controller: {someId}");
...
AspNetFullFrameworkSampleApp
Transaction name is taken from subroute route template.

Example fix would be in Elastic.Apm.Model.Transaction.GetNameFromRouteContext(IDictionary<string, object> routeValues) you can add another if statement (around line 546):
else if (routeValues.TryGetValue("MS_SubRoutes", out var template))
{
var subroute = ((IEnumerable<IHttpRouteData>)template).FirstOrDefault();
if(subroute != null)
{
name = subroute.Route.RouteTemplate;
}
}
Guid is used as transaction name:

Thanks for opening @kszymanski. This seems like a reasonable change to include
Thank you @russcam! Looking forward to 1.9.0 release!
@kszymanski Could you tell me why RouteData might be empty?
Route Attrubute:

Request URL:

Route Data:

@insanity13 the RouteData looks like one that's associated with an MVC controller (System.Web.Routing.RouteData) and not one associated with a Web API controller (System.Web.Http.Routing.HttpRouteData). Does the controller derive from System.Web.Http.ApiController and are attribute routes registered with HttpConfiguration? e.g.
Does the controller derive from System.Web.Http.ApiController
Yes, all API-contrillers derive from System.Web.Http.ApiController:

and are attribute routes registered with HttpConfiguration
Yes, we are call MapHttpAttributeRoutes()
@insanity13 I'm sorry but I don't know why. I had myself a problem with Route attribute and APM that did not see correct route name so I debug it and google around. That is how I found article about MS_SubRoutes. I also noticed RoutePrefix attribute is making a difference some times.
Unfortunately, I have not found a way to get information about the route in my case (in Request End).
Found only one option: to register the ActionFilter and get a template from ControllerContext. In this place, the template is correct.
Most helpful comment
Thanks for opening @kszymanski. This seems like a reasonable change to include