Skip to content

Commit

Permalink
test: synchronizing json spec (#1833)
Browse files Browse the repository at this point in the history
Co-authored-by: apmmachine <[email protected]>
  • Loading branch information
apmmachine and apmmachine authored Sep 26, 2022
1 parent 02d69a7 commit 3220fa1
Show file tree
Hide file tree
Showing 7 changed files with 1,325 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"testUnderscores": {
"groupLine": "1:name=systemd:/kubepods.slice/kubepods-burstable.slice/kubepods-burstable-pod90d81341_92de_11e7_8cf2_507b9d4141fa.slice/crio-2227daf62df6694645fee5df53c1f91271546a9560e8600a525690ae252b7f63.scope",
"containerId": "2227daf62df6694645fee5df53c1f91271546a9560e8600a525690ae252b7f63",
"podId": "90d81341-92de-11e7-8cf2-507b9d4141fa"
},
"testOpenshiftForm": {
"groupLine": "9:freezer:/kubepods.slice/kubepods-pod22949dce_fd8b_11ea_8ede_98f2b32c645c.slice/docker-b15a5bdedd2e7645c3be271364324321b908314e4c77857bbfd32a041148c07f.scope",
"containerId": "b15a5bdedd2e7645c3be271364324321b908314e4c77857bbfd32a041148c07f",
"podId": "22949dce-fd8b-11ea-8ede-98f2b32c645c"
},
"testUbuntuCGroup": {
"groupLine": "1:name=systemd:/user.slice/user-1000.slice/[email protected]/apps.slice/apps-org.gnome.Terminal.slice/vte-spawn-75bc72bd-6642-4cf5-b62c-0674e11bfc84.scope",
"containerId": null,
"podId": null
},
"testAwsEcsCGroup": {
"groupLine": "1:name=systemd:/ecs/03752a671e744971a862edcee6195646/03752a671e744971a862edcee6195646-4015103728",
"containerId": "03752a671e744971a862edcee6195646-4015103728",
"podId": null
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,289 @@
[
{
"span": {
"exit": "true",
"type": "custom",
"subtype": "test-subtype"
},
"expected_resource": "test-subtype",
"expected_service_target": {
"type": "test-subtype"
},
"failure_message": "In the absence of specific context fields, subtype should used"
},
{
"span": {
"exit": "true",
"type": "custom",
"subtype": "test-subtype",
"context": {
"service": {
"target": {
"type": "custom-service-type",
"name": "custom-service-name"
}
}
}
},
"expected_resource": "custom-service-type/custom-service-name",
"expected_service_target": {
"type": "custom-service-type",
"name": "custom-service-name"
},
"failure_message": "If the `service target type or name` is already set, the inference mechanism should not override it"
},
{
"span": {
"exit": "true",
"type": "custom"
},
"expected_resource": "custom",
"expected_service_target": {
"type": "custom"
},
"failure_message": "In the absence of specific context fields and absence of subtype, the type should be used"
},
{
"span": {
"exit": "false",
"type": "custom",
"subtype": "test-subtype"
},
"expected_resource": null,
"expected_service_target": null,
"failure_message": "The output for non-exit spans should be `null`"
},
{
"span": {
"exit": "false",
"type": "custom",
"subtype": "proprietary-db",
"context": {
"db": {
"instance": "myInstance"
}
}
},
"expected_resource": null,
"expected_service_target": null,
"failure_message": "The output for non-exit spans should be `null` even if exit-related context data is set"
},
{
"span": {
"exit": "true",
"type": "db",
"subtype": "mysql",
"context": {
"db": {
"instance": "myInstance"
}
}
},
"expected_resource": "mysql/myInstance",
"expected_service_target": {
"type": "mysql",
"name": "myInstance"
},
"failure_message": "If `context.db.instance` exists, the output should be: `${subtype}/${context.db.instance}`"
},
{
"span": {
"exit": "true",
"type": "db",
"subtype": "mysql",
"context": {
"db": {
"type": "sql"
}
}
},
"expected_resource": "mysql",
"expected_service_target": {
"type": "mysql"
},
"failure_message": "If `context.db` exists without `context.db.instance`, the subtype should be used"
},
{
"span": {
"exit": "true",
"type": "db",
"context": {
"db": {
"instance": "myInstance"
}
}
},
"expected_resource": "db/myInstance",
"expected_service_target": {
"type": "db",
"name": "myInstance"
},
"failure_message": "If `context.db.instance` exists and subtype is `null`, the output should be: `${type}/${context.db.instance}`"
},
{
"span": {
"exit": "true",
"type": "db",
"subtype": "elasticsearch",
"context": {
"db": {
"type": "elasticsearch"
},
"http": {
"url": {
"host": "my-cluster.com",
"port": 9200
}
}
}
},
"expected_resource": "elasticsearch",
"expected_service_target": {
"type": "elasticsearch"
},
"failure_message": "If `context.db` exists without `context.db.instance`, the subtype should be used, even if `context.http` exists"
},
{
"span": {
"exit": "true",
"type": "messaging",
"subtype": "msg-http-client",
"context": {
"message": {
"body": "Text message"
},
"http": {
"url": {
"host": "my-broker.com",
"port": 8888
}
}
}
},
"expected_resource": "msg-http-client",
"expected_service_target": {
"type": "msg-http-client"
},
"failure_message": "If `context.message` exists without `context.message.queue.name`, the subtype should be used, even if `context.http` exists"
},
{
"span": {
"exit": "true",
"type": "external",
"subtype": "http",
"context": {
"http": {
"url": {
"host": "my-cluster.com",
"port": 9200
}
}
}
},
"expected_resource": "my-cluster.com:9200",
"expected_service_target": {
"type": "http",
"name": "my-cluster.com:9200"
},
"failure_message": "If `context.http.url` exists, output should be `${context.http.url.host}:${context.http.url.port}"
},
{
"span": {
"exit": "true",
"type": "external",
"subtype": "http",
"context": {
"http": {
"url": {
"host": "my-cluster.com",
"port": -1
}
}
}
},
"expected_resource": "my-cluster.com",
"expected_service_target": {
"type": "http",
"name": "my-cluster.com"
},
"failure_message": "Negative `context.http.url.port` should be omitted from output"
},
{
"span": {
"exit": "true",
"type": "external",
"subtype": "http",
"context": {
"http": {
"url": {
"host": "my-cluster.com"
}
}
}
},
"expected_resource": "my-cluster.com",
"expected_service_target": {
"type": "http",
"name": "my-cluster.com"
},
"failure_message": "If `context.http.url.port` does not exist, output should be `${context.http.url.host}`"
},
{
"span": {
"exit": "true",
"type": "messaging",
"context": {
"message": {
"body": "Text message",
"queue": {
"name": "myQueue"
}
}
}
},
"expected_resource": "messaging/myQueue",
"expected_service_target": {
"type": "messaging",
"name": "myQueue"
},
"failure_message": "If `context.message` exists, and subtype is `null`, output should be `${type}/${context.message.queue.name}"
},
{
"span": {
"exit": "true",
"type": "messaging",
"subtype": "kafka",
"context": {
"message": {
"body": "Text message",
"queue": {
"name": "myQueue"
}
}
}
},
"expected_resource": "kafka/myQueue",
"expected_service_target": {
"type": "kafka",
"name": "myQueue"
},
"failure_message": "If `context.message` exists, output should be `${subtype}/${context.message.queue.name}"
},
{
"span": {
"exit": "true",
"type": "messaging",
"subtype": "kafka",
"context": {
"message": {
"body": "Text message"
}
}
},
"expected_resource": "kafka",
"expected_service_target": {
"type": "kafka"
},
"failure_message": "If `context.message` exists without `context.message.queue.name`, output should be `${subtype}`"
}
]
Loading

0 comments on commit 3220fa1

Please sign in to comment.