Skip to content
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
@@ -1,5 +1,5 @@
logging:
level: INFO
loggers:
"datadog.trace": DEBUG
"stackstate.trace": DEBUG
"io.opentracing": DEBUG
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class AWSClientTest extends AgentTestRunner {
tags1["component"] == "apache-httpclient"
tags1["thread.name"] != null
tags1["thread.id"] != null
tags1.size() == 3
tags1.size() == 5

and: // span 1 - from aws instrumentation
def span2 = trace[1]
Expand All @@ -131,7 +131,7 @@ class AWSClientTest extends AgentTestRunner {
tags2[Tags.PEER_PORT.key] == server.address.port
tags2[STSTags.THREAD_NAME] != null
tags2[STSTags.THREAD_ID] != null
tags2.size() == 9
tags2.size() == 11

and:

Expand Down Expand Up @@ -162,7 +162,7 @@ class AWSClientTest extends AgentTestRunner {
tags["span.type"] == "web"
tags["thread.name"] != null
tags["thread.id"] != null
tags.size() == 13
tags.size() == 15

receivedHeaders.get().get("x-stackstate-trace-id") == "$span.traceId"
receivedHeaders.get().get("x-stackstate-parent-id") == "$span.spanId"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ class JaxRsClientTest extends AgentTestRunner {
tags[STSTags.SPAN_TYPE] == STSSpanTypes.HTTP_CLIENT
tags[STSTags.THREAD_NAME] != null
tags[STSTags.THREAD_ID] != null
tags.size() == 8
tags[STSTags.SPAN_PID] != 0
tags[STSTags.SPAN_HOSTNAME] != ""
tags.size() == 10

receivedHeaders.get().get("x-stackstate-trace-id") == "$span.traceId"
receivedHeaders.get().get("x-stackstate-parent-id") == "$span.spanId"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,11 @@ class JMS1Test extends AgentTestRunner {

tags0["span.origin.type"] == ActiveMQMessageProducer.name

tags0["span.hostname"] != null
tags0["span.pid"] != 0l
tags0["thread.name"] != null
tags0["thread.id"] != null
tags0.size() == 6
tags0.size() == 8

and: // span 1
def span1 = trace[1]
Expand All @@ -86,9 +88,11 @@ class JMS1Test extends AgentTestRunner {

tags1["span.origin.type"] == ActiveMQMessageProducer.name

tags1["span.hostname"] != null
tags1["span.pid"] != 0l
tags1["thread.name"] != null
tags1["thread.id"] != null
tags1.size() == 6
tags1.size() == 8

and: // span 2
def span2 = trace[2]
Expand All @@ -107,9 +111,11 @@ class JMS1Test extends AgentTestRunner {

tags2["span.origin.type"] == ActiveMQMessageProducer.name

tags2["span.hostname"] != null
tags2["span.pid"] != 0l
tags2["thread.name"] != null
tags2["thread.id"] != null
tags2.size() == 6
tags2.size() == 8

and: // consumer trace
def consumerTrace = TEST_WRITER.get(1)
Expand All @@ -133,7 +139,7 @@ class JMS1Test extends AgentTestRunner {

consumerTags["thread.name"] != null
consumerTags["thread.id"] != null
consumerTags.size() == 6
consumerTags.size() == 8

cleanup:
producer.close()
Expand Down Expand Up @@ -189,9 +195,11 @@ class JMS1Test extends AgentTestRunner {

tags0["span.origin.type"] == ActiveMQMessageProducer.name

tags0["span.hostname"] != null
tags0["span.pid"] != 0l
tags0["thread.name"] != null
tags0["thread.id"] != null
tags0.size() == 6
tags0.size() == 8

and: // span 1
def span1 = trace[1]
Expand All @@ -209,10 +217,11 @@ class JMS1Test extends AgentTestRunner {
tags1["component"] == "jms1"

tags1["span.origin.type"] == ActiveMQMessageProducer.name

tags1["span.hostname"] != null
tags1["span.pid"] != 0l
tags1["thread.name"] != null
tags1["thread.id"] != null
tags1.size() == 6
tags1.size() == 8

and: // span 2
def span2 = trace[2]
Expand All @@ -230,10 +239,11 @@ class JMS1Test extends AgentTestRunner {
tags2["component"] == "jms1"

tags2["span.origin.type"] == ActiveMQMessageProducer.name

tags2["span.hostname"] != null
tags2["span.pid"] != 0l
tags2["thread.name"] != null
tags2["thread.id"] != null
tags2.size() == 6
tags2.size() == 8

and: // consumer trace
def consumerTrace = TEST_WRITER.get(1)
Expand All @@ -254,10 +264,11 @@ class JMS1Test extends AgentTestRunner {
consumerTags["component"] == "jms1"

consumerTags["span.origin.type"] != null

consumerTags["span.hostname"] != null
consumerTags["span.pid"] != 0l
consumerTags["thread.name"] != null
consumerTags["thread.id"] != null
consumerTags.size() == 6
consumerTags.size() == 8

cleanup:
producer.close()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,11 @@ class JMS2Test extends AgentTestRunner {
producerTags["component"] == "jms2"

producerTags["span.origin.type"] == HornetQMessageProducer.name

producerTags["span.hostname"] != null
producerTags["span.pid"] != 0l
producerTags["thread.name"] != null
producerTags["thread.id"] != null
producerTags.size() == 6
producerTags.size() == 8

and: // consumer trace
def consumerTrace = TEST_WRITER.get(1)
Expand All @@ -121,10 +122,11 @@ class JMS2Test extends AgentTestRunner {
consumerTags["component"] == "jms2"

consumerTags["span.origin.type"] == HornetQMessageConsumer.name

consumerTags["span.hostname"] != null
consumerTags["span.pid"] != 0l
consumerTags["thread.name"] != null
consumerTags["thread.id"] != null
consumerTags.size() == 6
consumerTags.size() == 8

cleanup:
producer.close()
Expand Down Expand Up @@ -179,9 +181,11 @@ class JMS2Test extends AgentTestRunner {

producerTags["span.origin.type"] == HornetQMessageProducer.name

producerTags["span.hostname"] != null
producerTags["span.pid"] != 0l
producerTags["thread.name"] != null
producerTags["thread.id"] != null
producerTags.size() == 6
producerTags.size() == 8

and: // consumer trace
def consumerTrace = TEST_WRITER.get(1)
Expand All @@ -203,9 +207,11 @@ class JMS2Test extends AgentTestRunner {

consumerTags["span.origin.type"] != null

consumerTags["span.hostname"] != null
consumerTags["span.pid"] != 0l
consumerTags["thread.name"] != null
consumerTags["thread.id"] != null
consumerTags.size() == 6
consumerTags.size() == 8

cleanup:
producer.close()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,11 @@ class KafkaClientTest extends AgentTestRunner {
t1tags1["component"] == "java-kafka"
t1tags1["span.kind"] == "producer"
t1tags1["span.type"] == "queue"
t1tags1["span.hostname"] != null
t1tags1["span.pid"] != 0l
t1tags1["thread.name"] != null
t1tags1["thread.id"] != null
t1tags1.size() == 5
t1tags1.size() == 7

and: // CONSUMER span 0
def t2span1 = t2[0]
Expand All @@ -114,9 +116,11 @@ class KafkaClientTest extends AgentTestRunner {
t1tags1["span.type"] == "queue"
t2tags1["partition"] >= 0
t2tags1["offset"] == 0
t2tags1["span.hostname"] != null
t2tags1["span.pid"] != 0l
t2tags1["thread.name"] != null
t2tags1["thread.id"] != null
t2tags1.size() == 7
t2tags1.size() == 9

def headers = received.headers()
headers.iterator().hasNext()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,11 @@ class KafkaStreamsTest extends AgentTestRunner {
t1tags1["component"] == "java-kafka"
t1tags1["span.kind"] == "producer"
t1tags1["span.type"] == "queue"
t1tags1["span.hostname"] != null
t1tags1["span.pid"] != 0l
t1tags1["thread.name"] != null
t1tags1["thread.id"] != null
t1tags1.size() == 5
t1tags1.size() == 7

and: // STREAMING span 0
def t2span1 = t2[0]
Expand All @@ -136,9 +138,11 @@ class KafkaStreamsTest extends AgentTestRunner {
t2tags1["component"] == "java-kafka"
t2tags1["span.kind"] == "producer"
t2tags1["span.type"] == "queue"
t2tags1["span.hostname"] != null
t2tags1["span.pid"] != 0l
t2tags1["thread.name"] != null
t2tags1["thread.id"] != null
t2tags1.size() == 5
t2tags1.size() == 7

and: // STREAMING span 1
def t2span2 = t2[1]
Expand All @@ -157,10 +161,12 @@ class KafkaStreamsTest extends AgentTestRunner {
t1tags1["span.type"] == "queue"
t2tags2["partition"] >= 0
t2tags2["offset"] == 0
t2tags2["span.hostname"] != null
t2tags2["span.pid"] != 0l
t2tags2["thread.name"] != null
t2tags2["thread.id"] != null
t2tags2["asdf"] == "testing"
t2tags2.size() == 8
t2tags2.size() == 10

and: // CONSUMER span 0
def t3span1 = t3[0]
Expand All @@ -178,10 +184,12 @@ class KafkaStreamsTest extends AgentTestRunner {
t2tags2["span.type"] == "queue"
t3tags1["partition"] >= 0
t3tags1["offset"] == 0
t3tags1["span.hostname"] != null
t3tags1["span.pid"] != 0l
t3tags1["thread.name"] != null
t3tags1["thread.id"] != null
t3tags1["testing"] == 123
t3tags1.size() == 8
t3tags1.size() == 10

def headers = received.headers()
headers.iterator().hasNext()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@ class OkHttp3Test extends AgentTestRunner {

def tags1 = span1.context().tags
tags1["component"] == "okhttp"
tags1["span.hostname"] != null
tags1["span.pid"] != 0l
tags1["thread.name"] != null
tags1["thread.id"] != null
tags1.size() == 3
tags1.size() == 5

and: // span 1
def span2 = trace[1]
Expand All @@ -74,9 +76,11 @@ class OkHttp3Test extends AgentTestRunner {
tags2[Tags.PEER_HOSTNAME.key] == "localhost"
tags2[Tags.PEER_PORT.key] == server.address.port
tags2[Tags.PEER_HOST_IPV4.key] != null
tags2[STSTags.SPAN_HOSTNAME] != ""
tags2[STSTags.SPAN_PID] != 0l
tags2[STSTags.THREAD_NAME] != null
tags2[STSTags.THREAD_ID] != null
tags2.size() == 11
tags2.size() == 13

receivedHeaders.get().get("x-stackstate-trace-id") == "$span2.traceId"
receivedHeaders.get().get("x-stackstate-parent-id") == "$span2.spanId"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,11 @@ class JettyServletTest extends AgentTestRunner {
span.context().tags["span.kind"] == "server"
span.context().tags["component"] == "java-web-servlet"
span.context().tags["http.status_code"] == null // sadly servlet 2.x doesn't expose it generically.
span.context().tags["span.hostname"] != null
span.context().tags["span.pid"] != 0l
span.context().tags["thread.name"] != null
span.context().tags["thread.id"] != null
span.context().tags.size() == 7
span.context().tags.size() == 9

where:
path | expectedResponse
Expand Down Expand Up @@ -143,13 +145,15 @@ class JettyServletTest extends AgentTestRunner {
span.context().tags["span.kind"] == "server"
span.context().tags["component"] == "java-web-servlet"
span.context().tags["http.status_code"] == null // sadly servlet 2.x doesn't expose it generically.
span.context().tags["span.hostname"] != null
span.context().tags["span.pid"] != 0l
span.context().tags["thread.name"] != null
span.context().tags["thread.id"] != null
span.context().tags["error"] == true
span.context().tags["error.msg"] == "some $path error"
span.context().tags["error.type"] == RuntimeException.getName()
span.context().tags["error.stack"] != null
span.context().tags.size() == 11
span.context().tags.size() == 13

where:
path | expectedResponse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,11 @@ class JettyServletTest extends AgentTestRunner {
span.context().tags["span.kind"] == "server"
span.context().tags["component"] == "java-web-servlet"
span.context().tags["http.status_code"] == 200
span.context().tags["span.hostname"] != null
span.context().tags["span.pid"] != 0l
span.context().tags["thread.name"] != null
span.context().tags["thread.id"] != null
span.context().tags.size() == 8
span.context().tags.size() == 10

where:
path | expectedResponse
Expand Down Expand Up @@ -146,13 +148,15 @@ class JettyServletTest extends AgentTestRunner {
span.context().tags["span.kind"] == "server"
span.context().tags["component"] == "java-web-servlet"
span.context().tags["http.status_code"] == 500
span.context().tags["span.hostname"] != null
span.context().tags["span.pid"] != 0l
span.context().tags["thread.name"] != null
span.context().tags["thread.id"] != null
span.context().tags["error"] == true
span.context().tags["error.msg"] == "some $path error"
span.context().tags["error.type"] == RuntimeException.getName()
span.context().tags["error.stack"] != null
span.context().tags.size() == 12
span.context().tags.size() == 14

where:
path | expectedResponse
Expand Down Expand Up @@ -187,13 +191,15 @@ class JettyServletTest extends AgentTestRunner {
span.context().tags["span.kind"] == "server"
span.context().tags["component"] == "java-web-servlet"
span.context().tags["http.status_code"] == 500
span.context().tags["span.hostname"] != null
span.context().tags["span.pid"] != 0l
span.context().tags["thread.name"] != null
span.context().tags["thread.id"] != null
span.context().tags["error"] == true
span.context().tags["error.msg"] == null
span.context().tags["error.type"] == null
span.context().tags["error.stack"] == null
span.context().tags.size() == 9
span.context().tags.size() == 11

where:
path | expectedResponse
Expand Down
Loading