Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes error tag name from error.msg to error.message #4398

Merged
merged 2 commits into from
Dec 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ class AxisEngineTest extends AgentTestRunner {
topLevel parentSpan == null
tags {
if (error instanceof Exception) {
"error.msg" error.message
"error.message" error.message
"error.type" { it == error.class.name }
"error.stack" String
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ class GraphQLTest extends AgentTestRunner {
"$Tags.COMPONENT" "graphql-java"
"graphql.query" expectedQuery
"graphql.operation.name" null
"error.msg" { it.contains("Field 'title' in type 'Book' is undefined") }
"error.msg" { it.contains("(and 1 more errors)") }
"error.message" { it.contains("Field 'title' in type 'Book' is undefined") }
"error.message" { it.contains("(and 1 more errors)") }
defaultTags()
}
}
Expand Down Expand Up @@ -261,7 +261,7 @@ class GraphQLTest extends AgentTestRunner {
"$Tags.COMPONENT" "graphql-java"
"graphql.query" query
"graphql.operation.name" null
"error.msg" "Invalid Syntax : offending token ')' at line 2 column 25"
"error.message" "Invalid Syntax : offending token ')' at line 2 column 25"
defaultTags()
}
}
Expand All @@ -275,7 +275,7 @@ class GraphQLTest extends AgentTestRunner {
tags {
"$Tags.COMPONENT" "graphql-java"
"error.type" "graphql.parser.InvalidSyntaxException"
"error.msg" "Invalid Syntax : offending token ')' at line 2 column 25"
"error.message" "Invalid Syntax : offending token ')' at line 2 column 25"
"error.stack" String
defaultTags()
}
Expand Down Expand Up @@ -316,7 +316,7 @@ class GraphQLTest extends AgentTestRunner {
"$Tags.COMPONENT" "graphql-java"
"graphql.query" expectedQuery
"graphql.operation.name" "findBookById"
"error.msg" "Exception while fetching data (/bookById/cover) : TEST"
"error.message" "Exception while fetching data (/bookById/cover) : TEST"
defaultTags()
}
}
Expand All @@ -331,7 +331,7 @@ class GraphQLTest extends AgentTestRunner {
"$Tags.COMPONENT" "graphql-java"
"graphql.type" "String"
"error.type" "java.lang.IllegalStateException"
"error.msg" "TEST"
"error.message" "TEST"
"error.stack" String
defaultTags()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class ProcessImplInstrumentationSpecification extends AgentTestRunner {

then:
span.tags['cmd.exec'] == '["/bin/does-not-exist"]'
span.tags['error.msg'] != null
span.tags['error.message'] != null
span.isError() == true
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class WebServiceTest extends AgentTestRunner {
parent()
tags {
"component" "jax-ws-endpoint"
"error.msg" "bad request"
"error.message" "bad request"
"error.type" IllegalArgumentException.name
"error.stack" String
defaultTags()
Expand Down Expand Up @@ -105,7 +105,7 @@ class WebServiceTest extends AgentTestRunner {
parent()
tags {
"component" "jax-ws-endpoint"
"error.msg" "bad request"
"error.message" "bad request"
"error.type" IllegalArgumentException.name
"error.stack" String
defaultTags()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class WebServiceProviderTest extends AgentTestRunner {
parent()
tags {
"component" "jax-ws-endpoint"
"error.msg" "bad request"
"error.message" "bad request"
"error.type" IllegalArgumentException.name
"error.stack" String
defaultTags()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ class JSPInstrumentationBasicTests extends JSPTestBase {
"error.type" { String tagExceptionType ->
return tagExceptionType == exceptionClass.getName() || tagExceptionType.contains(exceptionClass.getSimpleName())
}
"error.msg" { String tagErrorMsg ->
"error.message" { String tagErrorMsg ->
return errorMessageOptional || tagErrorMsg instanceof String
}
"error.stack" String
Expand All @@ -285,7 +285,7 @@ class JSPInstrumentationBasicTests extends JSPTestBase {
"error.type" { String tagExceptionType ->
return tagExceptionType == exceptionClass.getName() || tagExceptionType.contains(exceptionClass.getSimpleName())
}
"error.msg" { String tagErrorMsg ->
"error.message" { String tagErrorMsg ->
return errorMessageOptional || tagErrorMsg instanceof String
}
"error.stack" String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class Liberty20Test extends HttpServerTest<Server> {
Map<String, Serializable> expectedExtraServerTags(ServerEndpoint endpoint) {
def res = ['servlet.context': '/testapp']
if (endpoint == ServerEndpoint.NOT_FOUND) {
res['error.msg'] = 'SRVE0190E: File not found: /not-found'
res['error.message'] = 'SRVE0190E: File not found: /not-found'
res['error.type'] = 'java.io.FileNotFoundException'
res['error.stack'] = ~/java\.io\.FileNotFoundException: SRVE0190E: File not found: \/not-found.*/
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ abstract class RestletTestBase extends HttpServerTest<Component> {
"$Tags.COMPONENT" ResourceDecorator.DECORATE.component()
if (endpoint == EXCEPTION) {
// Restlet wraps all Exception types with ResourceException
"error.msg" { String tagErrorMsg ->
"error.message" { String tagErrorMsg ->
return tagErrorMsg.startsWith("Internal Server Error")
}
"error.type" { it == null || it == ResourceException.name }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ abstract class AbstractServlet3Test<SERVER, CONTEXT> extends HttpServerTest<SERV
"servlet.path" "/dispatch$endpoint.path"

if (endpoint.throwsException) {
"error.msg" endpoint.body
"error.message" endpoint.body
"error.type" { it == Exception.name || it == InputMismatchException.name }
"error.stack" String
}
Expand Down Expand Up @@ -206,7 +206,7 @@ abstract class AbstractServlet3Test<SERVER, CONTEXT> extends HttpServerTest<SERV
}

if (endpoint.throwsException) {
"error.msg" endpoint.body
"error.message" endpoint.body
"error.type" { it == Exception.name || it == InputMismatchException.name }
"error.stack" String
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ abstract class JettyServlet3Test extends AbstractServlet3Test<Server, ServletCon
@Override
Map<String, Serializable> expectedExtraErrorInformation(ServerEndpoint endpoint) {
if (endpoint.throwsException) {
["error.msg": "${endpoint.body}",
["error.message": "${endpoint.body}",
"error.type": { it == Exception.name || it == InputMismatchException.name },
"error.stack": String]
} else {
Expand All @@ -168,7 +168,7 @@ abstract class JettyServlet3Test extends AbstractServlet3Test<Server, ServletCon
}
"servlet.path" "/dispatch$endpoint.path"
if (endpoint.throwsException) {
"error.msg" endpoint.body
"error.message" endpoint.body
"error.type" { it == Exception.name || it == InputMismatchException.name }
"error.stack" String
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class JettyServletHandlerTest extends AbstractServlet3Test<Server, ServletHandle
@Override
Map<String, Serializable> expectedExtraErrorInformation(ServerEndpoint endpoint) {
if (endpoint.throwsException && !dispatch) {
["error.msg": "${endpoint.body}",
["error.message": "${endpoint.body}",
"error.type": { it == Exception.name || it == InputMismatchException.name },
"error.stack": String]
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ abstract class TomcatServlet3Test extends AbstractServlet3Test<Tomcat, Context>
Map<String, Serializable> expectedExtraErrorInformation(ServerEndpoint endpoint) {
if (endpoint.throwsException) {
// Exception classes get wrapped in ServletException
["error.msg": { endpoint == EXCEPTION ? "Servlet execution threw an exception" : it == endpoint.body },
["error.message": { endpoint == EXCEPTION ? "Servlet execution threw an exception" : it == endpoint.body },
"error.type": { it == ServletException.name || it == InputMismatchException.name },
"error.stack": String]
} else {
Expand Down Expand Up @@ -157,7 +157,7 @@ abstract class TomcatServlet3Test extends AbstractServlet3Test<Tomcat, Context>
}
"servlet.path" "/dispatch$endpoint.path"
if (endpoint.throwsException) {
"error.msg" endpoint.body
"error.message" endpoint.body
"error.type" { it == Exception.name || it == InputMismatchException.name }
"error.stack" String
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class SpringBootZuulTest extends HttpServerTest<ConfigurableApplicationContext>
"$Tags.HTTP_ROUTE" String

if (endpoint.throwsException) {
"error.msg" EXCEPTION.body
"error.message" EXCEPTION.body
"error.type" Exception.name
"error.stack" String
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class TomcatServletTest extends AbstractServletTest<Tomcat, Context> {
Map<String, Serializable> expectedExtraErrorInformation(ServerEndpoint endpoint) {
if (endpoint.throwsException) {
// Exception classes get wrapped in ServletException
["error.msg": { endpoint == EXCEPTION ? "Servlet execution threw an exception" : it == endpoint.body },
["error.message": { endpoint == EXCEPTION ? "Servlet execution threw an exception" : it == endpoint.body },
"error.type": { it == ServletException.name || it == InputMismatchException.name },
"error.stack": String]
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ class TomcatServletTest extends AbstractServletTest<Embedded, Context> {
Map<String, Serializable> expectedExtraErrorInformation(ServerEndpoint endpoint) {
if (endpoint.throwsException) {
// Exception classes get wrapped in ServletException
["error.msg": { endpoint == EXCEPTION ? "Servlet execution threw an exception" : it == endpoint.body },
["error.message": { endpoint == EXCEPTION ? "Servlet execution threw an exception" : it == endpoint.body },
"error.type": { it == ServletException.name || it == InputMismatchException.name },
"error.stack": String]
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class UndertowDispatcherTest extends HttpServerTest<Undertow> {
@Override
Map<String, Serializable> expectedExtraErrorInformation(ServerEndpoint endpoint) {
if (endpoint.throwsException) {
["error.msg" : "${endpoint.body}",
["error.message" : "${endpoint.body}",
"error.type" : { it == Exception.name || it == InputMismatchException.name },
"error.stack": String]
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ class UndertowTest extends HttpServerTest<Undertow> {
@Override
Map<String, Serializable> expectedExtraErrorInformation(ServerEndpoint endpoint) {
if (endpoint.throwsException) {
["error.msg": "${endpoint.body}",
["error.message": "${endpoint.body}",
"error.type": { it == Exception.name || it == InputMismatchException.name },
"error.stack": String]
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class TagsAssert {
tag("error.stack", String)

if (message != null) {
tag("error.msg", message)
tag("error.message", message)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ abstract class HttpServerTest<SERVER> extends WithHttpServer<SERVER> {
// Only used if hasExtraErrorInformation is true
Map<String, Serializable> expectedExtraErrorInformation(ServerEndpoint endpoint) {
if (endpoint.errored) {
["error.msg" : { it == null || it == EXCEPTION.body },
["error.message" : { it == null || it == EXCEPTION.body },
"error.type" : { it == null || it == Exception.name },
"error.stack": { it == null || it instanceof String }]
} else {
Expand Down
Loading