Skip to content

Commit 526d7de

Browse files
committed
Hardcode tag names, improve formatting
1 parent f2d1f0c commit 526d7de

File tree

3 files changed

+27
-29
lines changed

3 files changed

+27
-29
lines changed

dd-java-agent-ittests/src/test/groovy/com/datadoghq/agent/integration/servlet/JettyServletTest.groovy

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -133,22 +133,22 @@ class JettyServletTest extends Specification {
133133
span.context().operationName == "servlet.request"
134134
span.context().getErrorFlag()
135135
span.context().parentId != 0 // parent should be the okhttp call.
136-
span.context().tags[Tags.HTTP_URL.key] == "http://localhost:$PORT/$path"
137-
span.context().tags[Tags.HTTP_METHOD.key] == "GET"
138-
span.context().tags[Tags.SPAN_KIND.key] == Tags.SPAN_KIND_SERVER
139-
span.context().tags[Tags.COMPONENT.key] == "java-web-servlet"
140-
span.context().tags[Tags.HTTP_STATUS.key] == 500
141-
span.context().tags[DDTags.THREAD_NAME] != null
142-
span.context().tags[DDTags.THREAD_ID] != null
143-
span.context().tags[Tags.ERROR.key] == true
144-
span.context().tags[DDTags.ERROR_MSG] == "some $path error"
145-
span.context().tags[DDTags.ERROR_TYPE] == RuntimeException.getName()
146-
span.context().tags[DDTags.ERROR_STACK] != null
136+
span.context().tags["http.url"] == "http://localhost:$PORT/$path"
137+
span.context().tags["http.method"] == "GET"
138+
span.context().tags["span.kind"] == "server"
139+
span.context().tags["component"] == "java-web-servlet"
140+
span.context().tags["http.status_code"] == 500
141+
span.context().tags["thread.name"] != null
142+
span.context().tags["thread.id"] != null
143+
span.context().tags["error"] == true
144+
span.context().tags["error.msg"] == "some $path error"
145+
span.context().tags["error.type"] == RuntimeException.getName()
146+
span.context().tags["error.stack"] != null
147147
span.context().tags.size() == 11
148148

149149
where:
150150
path | expectedResponse
151-
// "async" | "Hello Async" // I can't seem get the async error handler to trigger
151+
//"async" | "Hello Async" // FIXME: I can't seem get the async error handler to trigger
152152
"sync" | "Hello Sync"
153153
}
154154

dd-java-agent-ittests/src/test/groovy/com/datadoghq/agent/integration/servlet/TomcatServletTest.groovy

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -133,22 +133,22 @@ class TomcatServletTest extends Specification {
133133
span.context().operationName == "servlet.request"
134134
span.context().getErrorFlag()
135135
span.context().parentId != 0 // parent should be the okhttp call.
136-
span.context().tags[Tags.HTTP_URL.key] == "http://localhost:$PORT/$path"
137-
span.context().tags[Tags.HTTP_METHOD.key] == "GET"
138-
span.context().tags[Tags.SPAN_KIND.key] == Tags.SPAN_KIND_SERVER
139-
span.context().tags[Tags.COMPONENT.key] == "java-web-servlet"
140-
span.context().tags[Tags.HTTP_STATUS.key] == 500
141-
span.context().tags[DDTags.THREAD_NAME] != null
142-
span.context().tags[DDTags.THREAD_ID] != null
143-
span.context().tags[Tags.ERROR.key] == true
144-
span.context().tags[DDTags.ERROR_MSG] == "some $path error"
145-
span.context().tags[DDTags.ERROR_TYPE] == RuntimeException.getName()
146-
span.context().tags[DDTags.ERROR_STACK] != null
136+
span.context().tags["http.url"] == "http://localhost:$PORT/$path"
137+
span.context().tags["http.method"] == "GET"
138+
span.context().tags["span.kind"] == "server"
139+
span.context().tags["component"] == "java-web-servlet"
140+
span.context().tags["http.status_code"] == 500
141+
span.context().tags["thread.name"] != null
142+
span.context().tags["thread.id"] != null
143+
span.context().tags["error"] == true
144+
span.context().tags["error.msg"] == "some $path error"
145+
span.context().tags["error.type"] == RuntimeException.getName()
146+
span.context().tags["error.stack"] != null
147147
span.context().tags.size() == 11
148148

149149
where:
150150
path | expectedResponse
151-
// "async" | "Hello Async" // I can't seem get the async error handler to trigger
151+
//"async" | "Hello Async" // FIXME: I can't seem get the async error handler to trigger
152152
"sync" | "Hello Sync"
153153
}
154154

dd-trace/src/main/java/com/datadoghq/trace/DDTags.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ public class DDTags {
88
public static final String THREAD_ID = "thread.id";
99
public static final String DB_STATEMENT = "sql.query";
1010

11-
public static final String ERROR_MSG = "error.msg"; // a string representing the error message
12-
public static final String ERROR_TYPE =
13-
"error.type"; // a string representing the type of the error
14-
public static final String ERROR_STACK =
15-
"error.stack"; // a human readable version of the stack. beta.
11+
public static final String ERROR_MSG = "error.msg"; // string representing the error message
12+
public static final String ERROR_TYPE = "error.type"; // string representing the type of the error
13+
public static final String ERROR_STACK = "error.stack"; // human readable version of the stack
1614
}

0 commit comments

Comments
 (0)