Skip to content

Commit ec43ce1

Browse files
authoredSep 13, 2018
add http method to the resource name (#126)
1 parent 658d531 commit ec43ce1

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed
 

‎src/Datadog.Trace.ClrProfiler.Managed/Integrations/AspNetCoreMvc2Integration.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ public AspNetCoreMvc2Integration(object actionDescriptorObj, object httpContextO
3131
dynamic actionDescriptor = actionDescriptorObj;
3232
string controllerName = (actionDescriptor.ControllerName as string)?.ToLowerInvariant();
3333
string actionName = (actionDescriptor.ActionName as string)?.ToLowerInvariant();
34-
string resourceName = $"{controllerName}.{actionName}";
3534

3635
_httpContext = httpContextObj;
3736
string httpMethod = _httpContext.Request.Method.ToUpperInvariant();
@@ -40,7 +39,7 @@ public AspNetCoreMvc2Integration(object actionDescriptorObj, object httpContextO
4039
_scope = Tracer.Instance.StartActive(RequestOperationName);
4140
Span span = _scope.Span;
4241
span.Type = SpanTypes.Web;
43-
span.ResourceName = resourceName;
42+
span.ResourceName = $"{httpMethod} {controllerName}.{actionName}";
4443
span.SetTag(Tags.HttpMethod, httpMethod);
4544
span.SetTag(Tags.HttpUrl, url);
4645
span.SetTag(Tags.AspNetController, controllerName);

‎src/Datadog.Trace.ClrProfiler.Managed/Integrations/AspNetMvc5Integration.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public AspNetMvc5Integration(object controllerContextObj)
7070
IDictionary<string, object> routeValues = controllerContext.RouteData.Values;
7171
string controllerName = (routeValues.GetValueOrDefault("controller") as string)?.ToLowerInvariant();
7272
string actionName = (routeValues.GetValueOrDefault("action") as string)?.ToLowerInvariant();
73-
string resourceName = $"{controllerName}.{actionName}";
73+
string resourceName = $"{httpMethod} {controllerName}.{actionName}";
7474

7575
_scope = Tracer.Instance.StartActive(RequestOperationName);
7676
Span span = _scope.Span;

0 commit comments

Comments
 (0)
Please sign in to comment.