Skip to content

Commit

Permalink
add http method to the resource name (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaspimentel authored Sep 13, 2018
1 parent 658d531 commit ec43ce1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ public AspNetCoreMvc2Integration(object actionDescriptorObj, object httpContextO
dynamic actionDescriptor = actionDescriptorObj;
string controllerName = (actionDescriptor.ControllerName as string)?.ToLowerInvariant();
string actionName = (actionDescriptor.ActionName as string)?.ToLowerInvariant();
string resourceName = $"{controllerName}.{actionName}";

_httpContext = httpContextObj;
string httpMethod = _httpContext.Request.Method.ToUpperInvariant();
Expand All @@ -40,7 +39,7 @@ public AspNetCoreMvc2Integration(object actionDescriptorObj, object httpContextO
_scope = Tracer.Instance.StartActive(RequestOperationName);
Span span = _scope.Span;
span.Type = SpanTypes.Web;
span.ResourceName = resourceName;
span.ResourceName = $"{httpMethod} {controllerName}.{actionName}";
span.SetTag(Tags.HttpMethod, httpMethod);
span.SetTag(Tags.HttpUrl, url);
span.SetTag(Tags.AspNetController, controllerName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public AspNetMvc5Integration(object controllerContextObj)
IDictionary<string, object> routeValues = controllerContext.RouteData.Values;
string controllerName = (routeValues.GetValueOrDefault("controller") as string)?.ToLowerInvariant();
string actionName = (routeValues.GetValueOrDefault("action") as string)?.ToLowerInvariant();
string resourceName = $"{controllerName}.{actionName}";
string resourceName = $"{httpMethod} {controllerName}.{actionName}";

_scope = Tracer.Instance.StartActive(RequestOperationName);
Span span = _scope.Span;
Expand Down

0 comments on commit ec43ce1

Please sign in to comment.