Skip to content

Instantly share code, notes, and snippets.

@cyrille-leclerc
Last active November 3, 2020 11:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cyrille-leclerc/e5b4a1fb214f83cc9e7819953ebbd3e3 to your computer and use it in GitHub Desktop.
Save cyrille-leclerc/e5b4a1fb214f83cc9e7819953ebbd3e3 to your computer and use it in GitHub Desktop.
Elastic APM - OpenTelemetry Trace - Span custom attributes mixed with OpenTelemetry attributes

Demo Architecture

image

Span custom Attributes with OpenTelemetry instrumentation

image

The labels section is mixing the custom attributes (totalPrice, customerIpAddress, shippingCountry, and fraudScore) with some OpenTelemetry attributes thread_id, thread_name, service_namespace, and telemetry_auto_version.

Span labels with Elastic instrumentation

image

Tracer tracer = OpenTelemetry.getTracer("cyrille"); // TODO better way to get the tracer
tracer.getCurrentSpan().setAttribute("totalPrice", totalPrice);
tracer.getCurrentSpan().setAttribute("customerIpAddress", customerIpAddress);
tracer.getCurrentSpan().setAttribute("shippingCountry", shippingCountry);
tracer.getCurrentSpan().setAttribute("fraudScore", fraudScore);
try {
...
} catch (SQLException | InterruptedException e) {
// see https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/813
// see https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/semantic_conventions/exceptions.md
Span span = tracer.getCurrentSpan();
span.setAttribute("exception.message\t", e.getMessage());
span.setAttribute("exception.type", e.getClass().getName());
StringWriter errorString = new StringWriter();
e.printStackTrace(new PrintWriter(errorString));
span.setAttribute("exception.stacktrace", errorString.toString());
}
{
"_index": "apm-7.9.3-transaction-000001",
"_type": "_doc",
"_id": "T5_BjXUBfmnE4qmTYS7b",
"_version": 1,
"_score": null,
"_source": {
"parent": {
"id": "2159469181eff12c"
},
"agent": {
"name": "opentelemetry/java",
"version": "0.9.1"
},
"source": {
"ip": "127.0.0.1"
},
"processor": {
"name": "transaction",
"event": "transaction"
},
"url": {
"path": "/api/orders",
"scheme": "http",
"port": 8080,
"domain": "localhost",
"full": "http://localhost:8080/api/orders"
},
"labels": {
"thread_id": 43,
"thread_name": "http-nio-8080-exec-3",
"service_namespace": "com-shoppingcart",
"telemetry_auto_version": "0.9.0"
},
"observer": {
"hostname": "cyrillerclaptop.localdomain",
"id": "c6806dda-7615-4d01-bc3f-aeb7ca9aa2f2",
"ephemeral_id": "129c441c-0d75-4348-8326-44bf62c33008",
"type": "apm-server",
"version": "7.9.3",
"version_major": 7
},
"trace": {
"id": "6dbb8d4ec843989ef6e580697a38f23b"
},
"@timestamp": "2020-11-03T10:57:39.883Z",
"ecs": {
"version": "1.5.0"
},
"service": {
"environment": "staging",
"framework": {
"name": "io.opentelemetry.auto.servlet-3.0",
"version": "0.9.0"
},
"name": "frontend",
"language": {
"name": "java"
},
"version": "1.0-SNAPSHOT"
},
"host": {
"ip": "127.0.0.1"
},
"client": {
"ip": "127.0.0.1"
},
"http": {
"request": {
"headers": {
"User-Agent": [
"Java/15"
],
"X-Forwarded-For": [
"127.0.0.1"
]
},
"method": "post",
"socket": {
"remote_address": "127.0.0.1:53697"
}
},
"response": {
"status_code": 201
},
"version": "HTTP/1.1"
},
"event": {
"ingested": "2020-11-03T10:57:42.363149Z"
},
"transaction": {
"duration": {
"us": 203182
},
"result": "STATUS_CODE_OK",
"name": "/api/orders",
"id": "ce535b503b3ddc22",
"span_count": {
"dropped": 0,
"started": 0
},
"type": "request",
"sampled": true
},
"user_agent": {
"original": "Java/15",
"name": "Other",
"device": {
"name": "Spider"
}
},
"timestamp": {
"us": 1604401059883000
}
},
"fields": {
"event.ingested": [
"2020-11-03T10:57:42.363Z"
],
"@timestamp": [
"2020-11-03T10:57:39.883Z"
]
},
"highlight": {
"transaction.id": [
"@kibana-highlighted-field@ce535b503b3ddc22@/kibana-highlighted-field@"
],
"trace.id": [
"@kibana-highlighted-field@6dbb8d4ec843989ef6e580697a38f23b@/kibana-highlighted-field@"
],
"processor.event": [
"@kibana-highlighted-field@transaction@/kibana-highlighted-field@"
]
},
"sort": [
1604401059883
]
}
{
"_index": "apm-7.9.3-transaction-000001",
"_type": "_doc",
"_id": "T5_BjXUBfmnE4qmTYS7b",
"_version": 1,
"_score": null,
"_source": {
"parent": {
"id": "2159469181eff12c"
},
"agent": {
"name": "opentelemetry/java",
"version": "0.9.1"
},
"source": {
"ip": "127.0.0.1"
},
"processor": {
"name": "transaction",
"event": "transaction"
},
"url": {
"path": "/api/orders",
"scheme": "http",
"port": 8080,
"domain": "localhost",
"full": "http://localhost:8080/api/orders"
},
"labels": {
"thread_id": 43,
"thread_name": "http-nio-8080-exec-3",
"service_namespace": "com-shoppingcart",
"telemetry_auto_version": "0.9.0"
},
"observer": {
"hostname": "cyrillerclaptop.localdomain",
"id": "c6806dda-7615-4d01-bc3f-aeb7ca9aa2f2",
"ephemeral_id": "129c441c-0d75-4348-8326-44bf62c33008",
"type": "apm-server",
"version": "7.9.3",
"version_major": 7
},
"trace": {
"id": "6dbb8d4ec843989ef6e580697a38f23b"
},
"@timestamp": "2020-11-03T10:57:39.883Z",
"ecs": {
"version": "1.5.0"
},
"service": {
"environment": "staging",
"framework": {
"name": "io.opentelemetry.auto.servlet-3.0",
"version": "0.9.0"
},
"name": "frontend",
"language": {
"name": "java"
},
"version": "1.0-SNAPSHOT"
},
"host": {
"ip": "127.0.0.1"
},
"client": {
"ip": "127.0.0.1"
},
"http": {
"request": {
"headers": {
"User-Agent": [
"Java/15"
],
"X-Forwarded-For": [
"127.0.0.1"
]
},
"method": "post",
"socket": {
"remote_address": "127.0.0.1:53697"
}
},
"response": {
"status_code": 201
},
"version": "HTTP/1.1"
},
"event": {
"ingested": "2020-11-03T10:57:42.363149Z"
},
"transaction": {
"duration": {
"us": 203182
},
"result": "STATUS_CODE_OK",
"name": "/api/orders",
"id": "ce535b503b3ddc22",
"span_count": {
"dropped": 0,
"started": 0
},
"type": "request",
"sampled": true
},
"user_agent": {
"original": "Java/15",
"name": "Other",
"device": {
"name": "Spider"
}
},
"timestamp": {
"us": 1604401059883000
}
},
"fields": {
"event.ingested": [
"2020-11-03T10:57:42.363Z"
],
"@timestamp": [
"2020-11-03T10:57:39.883Z"
]
},
"highlight": {
"trace.id": [
"@kibana-highlighted-field@6dbb8d4ec843989ef6e580697a38f23b@/kibana-highlighted-field@"
]
},
"sort": [
1604401059883
]
}
{
"_index": "apm-7.9.3-span-000001",
"_type": "_doc",
"_id": "IZ_BjXUBfmnE4qmTYS7b",
"_version": 1,
"_score": null,
"_source": {
"parent": {
"id": "ce535b503b3ddc22"
},
"observer": {
"hostname": "cyrillerclaptop.localdomain",
"id": "c6806dda-7615-4d01-bc3f-aeb7ca9aa2f2",
"ephemeral_id": "129c441c-0d75-4348-8326-44bf62c33008",
"type": "apm-server",
"version": "7.9.3",
"version_major": 7
},
"agent": {
"name": "opentelemetry/java",
"version": "0.9.1"
},
"trace": {
"id": "6dbb8d4ec843989ef6e580697a38f23b"
},
"@timestamp": "2020-11-03T10:57:39.883Z",
"ecs": {
"version": "1.5.0"
},
"service": {
"environment": "staging",
"name": "frontend"
},
"processor": {
"name": "transaction",
"event": "span"
},
"labels": {
"thread_id": 43,
"order_price_range": "small",
"shipping_method": "standard",
"thread_name": "http-nio-8080-exec-3",
"order_price": 5,
"service_namespace": "com-shoppingcart",
"customer_id": "customer-24",
"shipping_country": "GB",
"payment_method": "credit_cart",
"telemetry_auto_version": "0.9.0"
},
"span": {
"duration": {
"us": 202232
},
"name": "OrderController.create",
"id": "2025d16f38677d70",
"type": "app"
},
"timestamp": {
"us": 1604401059883418
}
},
"fields": {
"@timestamp": [
"2020-11-03T10:57:39.883Z"
]
},
"highlight": {
"trace.id": [
"@kibana-highlighted-field@6dbb8d4ec843989ef6e580697a38f23b@/kibana-highlighted-field@"
]
},
"sort": [
1604401059883
]
}
{
"_index": "apm-7.9.3-span-000001",
"_type": "_doc",
"_id": "UJ_BjXUBfmnE4qmTYS7b",
"_version": 1,
"_score": null,
"_source": {
"parent": {
"id": "2025d16f38677d70"
},
"observer": {
"hostname": "cyrillerclaptop.localdomain",
"id": "c6806dda-7615-4d01-bc3f-aeb7ca9aa2f2",
"type": "apm-server",
"ephemeral_id": "129c441c-0d75-4348-8326-44bf62c33008",
"version": "7.9.3",
"version_major": 7
},
"agent": {
"name": "opentelemetry/java",
"version": "0.9.1"
},
"trace": {
"id": "6dbb8d4ec843989ef6e580697a38f23b"
},
"@timestamp": "2020-11-03T10:57:39.884Z",
"ecs": {
"version": "1.5.0"
},
"service": {
"environment": "staging",
"name": "frontend"
},
"destination": {
"address": "localhost",
"port": 8081
},
"processor": {
"name": "transaction",
"event": "span"
},
"labels": {
"net_transport": "IP.TCP",
"thread_id": 43,
"http_method": "GET",
"http_flavor": "1.1",
"thread_name": "http-nio-8080-exec-3",
"service_namespace": "com-shoppingcart",
"telemetry_auto_version": "0.9.0"
},
"timestamp": {
"us": 1604401059884402
},
"span": {
"duration": {
"us": 181017
},
"subtype": "http",
"name": "HTTP GET",
"destination": {
"service": {
"resource": "localhost:8081",
"name": "http://localhost:8081",
"type": "external"
}
},
"http": {
"response": {
"status_code": 200
},
"url": {
"original": "http://localhost:8081/fraud/checkOrder?orderPrice=5.0&customerIpAddress=127.0.0.1&shippingCountry=GB"
}
},
"id": "e00cdf96eaaf9922",
"type": "external"
}
},
"fields": {
"@timestamp": [
"2020-11-03T10:57:39.884Z"
]
},
"highlight": {
"trace.id": [
"@kibana-highlighted-field@6dbb8d4ec843989ef6e580697a38f23b@/kibana-highlighted-field@"
]
},
"sort": [
1604401059884
]
}
{
"_index": "apm-7.9.3-transaction-000001",
"_type": "_doc",
"_id": "25_BjXUBfmnE4qmTai6E",
"_version": 1,
"_score": null,
"_source": {
"parent": {
"id": "e00cdf96eaaf9922"
},
"agent": {
"name": "opentelemetry/java",
"version": "0.9.1"
},
"source": {
"ip": "127.0.0.1"
},
"processor": {
"name": "transaction",
"event": "transaction"
},
"url": {
"path": "/fraud/checkOrder",
"scheme": "http",
"port": 8081,
"query": "orderPrice=5.0&customerIpAddress=127.0.0.1&shippingCountry=GB",
"domain": "localhost",
"full": "http://localhost:8081/fraud/checkOrder?orderPrice=5.0&customerIpAddress=127.0.0.1&shippingCountry=GB"
},
"labels": {
"thread_id": 26,
"thread_name": "http-nio-8081-exec-1",
"service_namespace": "com-shoppingcart",
"telemetry_auto_version": "0.9.0"
},
"observer": {
"hostname": "cyrillerclaptop.localdomain",
"id": "c6806dda-7615-4d01-bc3f-aeb7ca9aa2f2",
"ephemeral_id": "129c441c-0d75-4348-8326-44bf62c33008",
"type": "apm-server",
"version": "7.9.3",
"version_major": 7
},
"trace": {
"id": "6dbb8d4ec843989ef6e580697a38f23b"
},
"@timestamp": "2020-11-03T10:57:39.885Z",
"ecs": {
"version": "1.5.0"
},
"service": {
"environment": "staging",
"framework": {
"name": "io.opentelemetry.auto.servlet-3.0",
"version": "0.9.0"
},
"name": "anti-fraud",
"language": {
"name": "java"
},
"version": "1.0-SNAPSHOT"
},
"host": {
"ip": "127.0.0.1"
},
"http": {
"request": {
"headers": {
"User-Agent": [
"Java/15"
],
"X-Forwarded-For": [
"127.0.0.1"
]
},
"method": "get",
"socket": {
"remote_address": "127.0.0.1:53655"
}
},
"response": {
"status_code": 200
},
"version": "HTTP/1.1"
},
"client": {
"ip": "127.0.0.1"
},
"event": {
"ingested": "2020-11-03T10:57:44.578344Z"
},
"transaction": {
"duration": {
"us": 180488
},
"result": "STATUS_CODE_OK",
"name": "/fraud/checkOrder",
"id": "a6b1e3bcffbd3fb7",
"span_count": {
"dropped": 0,
"started": 0
},
"type": "request",
"sampled": true
},
"user_agent": {
"original": "Java/15",
"name": "Other",
"device": {
"name": "Spider"
}
},
"timestamp": {
"us": 1604401059885001
}
},
"fields": {
"event.ingested": [
"2020-11-03T10:57:44.578Z"
],
"@timestamp": [
"2020-11-03T10:57:39.885Z"
]
},
"highlight": {
"trace.id": [
"@kibana-highlighted-field@6dbb8d4ec843989ef6e580697a38f23b@/kibana-highlighted-field@"
]
},
"sort": [
1604401059885
]
}
{
"_index": "apm-7.9.3-span-000001",
"_type": "_doc",
"_id": "4p_BjXUBfmnE4qmTai6E",
"_version": 1,
"_score": null,
"_source": {
"parent": {
"id": "2d7b96700c157c16"
},
"observer": {
"hostname": "cyrillerclaptop.localdomain",
"id": "c6806dda-7615-4d01-bc3f-aeb7ca9aa2f2",
"ephemeral_id": "129c441c-0d75-4348-8326-44bf62c33008",
"type": "apm-server",
"version": "7.9.3",
"version_major": 7
},
"agent": {
"name": "opentelemetry/java",
"version": "0.9.1"
},
"trace": {
"id": "6dbb8d4ec843989ef6e580697a38f23b"
},
"@timestamp": "2020-11-03T10:57:39.885Z",
"ecs": {
"version": "1.5.0"
},
"service": {
"environment": "staging",
"name": "anti-fraud"
},
"processor": {
"name": "transaction",
"event": "span"
},
"labels": {
"db_connection_string": "postgresql://localhost:5432",
"thread_id": 26,
"thread_name": "http-nio-8081-exec-1",
"service_namespace": "com-shoppingcart",
"telemetry_auto_version": "0.9.0"
},
"span": {
"duration": {
"us": 223
},
"subtype": "postgresql",
"name": "",
"destination": {
"service": {
"resource": "postgresql",
"name": "postgresql",
"type": "db"
}
},
"id": "5c1428d60544e5d0",
"type": "db",
"db": {
"instance": "test",
"type": "postgresql",
"user": {
"name": "test"
}
}
},
"timestamp": {
"us": 1604401059885879
}
},
"fields": {
"@timestamp": [
"2020-11-03T10:57:39.885Z"
]
},
"highlight": {
"trace.id": [
"@kibana-highlighted-field@6dbb8d4ec843989ef6e580697a38f23b@/kibana-highlighted-field@"
]
},
"sort": [
1604401059885
]
}
{
"_index": "apm-7.9.3-span-000001",
"_type": "_doc",
"_id": "05_BjXUBfmnE4qmTai6E",
"_version": 1,
"_score": null,
"_source": {
"parent": {
"id": "a6b1e3bcffbd3fb7"
},
"observer": {
"hostname": "cyrillerclaptop.localdomain",
"id": "c6806dda-7615-4d01-bc3f-aeb7ca9aa2f2",
"ephemeral_id": "129c441c-0d75-4348-8326-44bf62c33008",
"type": "apm-server",
"version": "7.9.3",
"version_major": 7
},
"agent": {
"name": "opentelemetry/java",
"version": "0.9.1"
},
"trace": {
"id": "6dbb8d4ec843989ef6e580697a38f23b"
},
"@timestamp": "2020-11-03T10:57:39.885Z",
"ecs": {
"version": "1.5.0"
},
"service": {
"environment": "staging",
"name": "anti-fraud"
},
"processor": {
"name": "transaction",
"event": "span"
},
"labels": {
"customer_ip_address": "127.0.0.1",
"thread_id": 26,
"thread_name": "http-nio-8081-exec-1",
"order_price": 5,
"service_namespace": "com-shoppingcart",
"shipping_country": "GB",
"fraud_score": -44,
"telemetry_auto_version": "0.9.0"
},
"span": {
"duration": {
"us": 179755
},
"name": "AntiFraudController.checkOrder",
"id": "2d7b96700c157c16",
"type": "app"
},
"timestamp": {
"us": 1604401059885465
}
},
"fields": {
"@timestamp": [
"2020-11-03T10:57:39.885Z"
]
},
"highlight": {
"trace.id": [
"@kibana-highlighted-field@6dbb8d4ec843989ef6e580697a38f23b@/kibana-highlighted-field@"
]
},
"sort": [
1604401059885
]
}
{
"_index": "apm-7.9.3-span-000001",
"_type": "_doc",
"_id": "45_BjXUBfmnE4qmTai6E",
"_version": 1,
"_score": null,
"_source": {
"parent": {
"id": "2d7b96700c157c16"
},
"observer": {
"hostname": "cyrillerclaptop.localdomain",
"id": "c6806dda-7615-4d01-bc3f-aeb7ca9aa2f2",
"ephemeral_id": "129c441c-0d75-4348-8326-44bf62c33008",
"type": "apm-server",
"version": "7.9.3",
"version_major": 7
},
"agent": {
"name": "opentelemetry/java",
"version": "0.9.1"
},
"trace": {
"id": "6dbb8d4ec843989ef6e580697a38f23b"
},
"@timestamp": "2020-11-03T10:57:39.886Z",
"ecs": {
"version": "1.5.0"
},
"service": {
"environment": "staging",
"name": "anti-fraud"
},
"processor": {
"name": "transaction",
"event": "span"
},
"labels": {
"db_connection_string": "postgresql://localhost:5432",
"thread_id": 26,
"thread_name": "http-nio-8081-exec-1",
"service_namespace": "com-shoppingcart",
"telemetry_auto_version": "0.9.0"
},
"span": {
"duration": {
"us": 120296
},
"subtype": "postgresql",
"name": "select pg_sleep(?)",
"destination": {
"service": {
"resource": "postgresql",
"name": "postgresql",
"type": "db"
}
},
"id": "aaca61ba8129f065",
"type": "db",
"db": {
"instance": "test",
"statement": "select pg_sleep(?)",
"type": "postgresql",
"user": {
"name": "test"
}
}
},
"timestamp": {
"us": 1604401059886277
}
},
"fields": {
"@timestamp": [
"2020-11-03T10:57:39.886Z"
]
},
"highlight": {
"trace.id": [
"@kibana-highlighted-field@6dbb8d4ec843989ef6e580697a38f23b@/kibana-highlighted-field@"
]
},
"sort": [
1604401059886
]
}
{
"_index": "apm-7.9.3-span-000001",
"_type": "_doc",
"_id": "EZ_BjXUBfmnE4qmTYS7b",
"_version": 1,
"_score": null,
"_source": {
"parent": {
"id": "2025d16f38677d70"
},
"observer": {
"hostname": "cyrillerclaptop.localdomain",
"id": "c6806dda-7615-4d01-bc3f-aeb7ca9aa2f2",
"ephemeral_id": "129c441c-0d75-4348-8326-44bf62c33008",
"type": "apm-server",
"version": "7.9.3",
"version_major": 7
},
"agent": {
"name": "opentelemetry/java",
"version": "0.9.1"
},
"trace": {
"id": "6dbb8d4ec843989ef6e580697a38f23b"
},
"@timestamp": "2020-11-03T10:57:40.065Z",
"ecs": {
"version": "1.5.0"
},
"service": {
"environment": "staging",
"name": "frontend"
},
"processor": {
"name": "transaction",
"event": "span"
},
"labels": {
"thread_id": 43,
"thread_name": "http-nio-8080-exec-3",
"service_namespace": "com-shoppingcart",
"telemetry_auto_version": "0.9.0"
},
"span": {
"duration": {
"us": 5765
},
"name": "CrudRepository.save",
"id": "17ddab81920a2bd6",
"type": "app"
},
"timestamp": {
"us": 1604401060065806
}
},
"fields": {
"@timestamp": [
"2020-11-03T10:57:40.065Z"
]
},
"highlight": {
"trace.id": [
"@kibana-highlighted-field@6dbb8d4ec843989ef6e580697a38f23b@/kibana-highlighted-field@"
]
},
"sort": [
1604401060065
]
}
{
"_index": "apm-7.9.3-span-000001",
"_type": "_doc",
"_id": "PZ_BjXUBfmnE4qmTYS7b",
"_version": 1,
"_score": null,
"_source": {
"parent": {
"id": "17ddab81920a2bd6"
},
"observer": {
"hostname": "cyrillerclaptop.localdomain",
"id": "c6806dda-7615-4d01-bc3f-aeb7ca9aa2f2",
"type": "apm-server",
"ephemeral_id": "129c441c-0d75-4348-8326-44bf62c33008",
"version": "7.9.3",
"version_major": 7
},
"agent": {
"name": "opentelemetry/java",
"version": "0.9.1"
},
"trace": {
"id": "6dbb8d4ec843989ef6e580697a38f23b"
},
"@timestamp": "2020-11-03T10:57:40.066Z",
"ecs": {
"version": "1.5.0"
},
"service": {
"environment": "staging",
"name": "frontend"
},
"processor": {
"name": "transaction",
"event": "span"
},
"labels": {
"db_connection_string": "postgresql://localhost:5432",
"thread_id": 43,
"thread_name": "http-nio-8080-exec-3",
"service_namespace": "com-shoppingcart",
"telemetry_auto_version": "0.9.0"
},
"span": {
"duration": {
"us": 5072
},
"subtype": "postgresql",
"name": "insert into orders (date_created, status) values (?, ?)",
"destination": {
"service": {
"resource": "postgresql",
"name": "postgresql",
"type": "db"
}
},
"id": "cd30406e0cac2caa",
"type": "db",
"db": {
"instance": "test",
"statement": "insert into orders (date_created, status) values (?, ?)",
"type": "postgresql",
"user": {
"name": "test"
}
}
},
"timestamp": {
"us": 1604401060066328
}
},
"fields": {
"@timestamp": [
"2020-11-03T10:57:40.066Z"
]
},
"highlight": {
"trace.id": [
"@kibana-highlighted-field@6dbb8d4ec843989ef6e580697a38f23b@/kibana-highlighted-field@"
]
},
"sort": [
1604401060066
]
}
{
"_index": "apm-7.9.3-span-000001",
"_type": "_doc",
"_id": "Ep_BjXUBfmnE4qmTYS7b",
"_version": 1,
"_score": null,
"_source": {
"parent": {
"id": "2025d16f38677d70"
},
"observer": {
"hostname": "cyrillerclaptop.localdomain",
"id": "c6806dda-7615-4d01-bc3f-aeb7ca9aa2f2",
"ephemeral_id": "129c441c-0d75-4348-8326-44bf62c33008",
"type": "apm-server",
"version": "7.9.3",
"version_major": 7
},
"agent": {
"name": "opentelemetry/java",
"version": "0.9.1"
},
"trace": {
"id": "6dbb8d4ec843989ef6e580697a38f23b"
},
"@timestamp": "2020-11-03T10:57:40.073Z",
"ecs": {
"version": "1.5.0"
},
"service": {
"environment": "staging",
"name": "frontend"
},
"processor": {
"name": "transaction",
"event": "span"
},
"labels": {
"thread_id": 43,
"thread_name": "http-nio-8080-exec-3",
"service_namespace": "com-shoppingcart",
"telemetry_auto_version": "0.9.0"
},
"timestamp": {
"us": 1604401060073299
},
"span": {
"duration": {
"us": 3099
},
"name": "CrudRepository.save",
"id": "9f79a0876528db42",
"type": "app"
}
},
"fields": {
"@timestamp": [
"2020-11-03T10:57:40.073Z"
]
},
"highlight": {
"trace.id": [
"@kibana-highlighted-field@6dbb8d4ec843989ef6e580697a38f23b@/kibana-highlighted-field@"
]
},
"sort": [
1604401060073
]
}
{
"_index": "apm-7.9.3-span-000001",
"_type": "_doc",
"_id": "Pp_BjXUBfmnE4qmTYS7b",
"_version": 1,
"_score": null,
"_source": {
"parent": {
"id": "9f79a0876528db42"
},
"observer": {
"hostname": "cyrillerclaptop.localdomain",
"id": "c6806dda-7615-4d01-bc3f-aeb7ca9aa2f2",
"ephemeral_id": "129c441c-0d75-4348-8326-44bf62c33008",
"type": "apm-server",
"version": "7.9.3",
"version_major": 7
},
"agent": {
"name": "opentelemetry/java",
"version": "0.9.1"
},
"trace": {
"id": "6dbb8d4ec843989ef6e580697a38f23b"
},
"@timestamp": "2020-11-03T10:57:40.074Z",
"ecs": {
"version": "1.5.0"
},
"service": {
"environment": "staging",
"name": "frontend"
},
"processor": {
"name": "transaction",
"event": "span"
},
"labels": {
"db_connection_string": "postgresql://localhost:5432",
"thread_id": 43,
"thread_name": "http-nio-8080-exec-3",
"service_namespace": "com-shoppingcart",
"telemetry_auto_version": "0.9.0"
},
"span": {
"duration": {
"us": 1579
},
"subtype": "postgresql",
"name": "select orderprodu0_.order_id as order_id2_0_0_, orderprodu0_.product_id as product_3_0_0_, orderprodu0_.quantity as quantity1_0_0_ from order_product orderprodu0_ where orderprodu0_.order_id=? and orderprodu0_.product_id=?",
"destination": {
"service": {
"resource": "postgresql",
"name": "postgresql",
"type": "db"
}
},
"id": "1979426b0dc0b0c7",
"type": "db",
"db": {
"instance": "test",
"statement": "select orderprodu0_.order_id as order_id2_0_0_, orderprodu0_.product_id as product_3_0_0_, orderprodu0_.quantity as quantity1_0_0_ from order_product orderprodu0_ where orderprodu0_.order_id=? and orderprodu0_.product_id=?",
"type": "postgresql",
"user": {
"name": "test"
}
}
},
"timestamp": {
"us": 1604401060074554
}
},
"fields": {
"@timestamp": [
"2020-11-03T10:57:40.074Z"
]
},
"highlight": {
"trace.id": [
"@kibana-highlighted-field@6dbb8d4ec843989ef6e580697a38f23b@/kibana-highlighted-field@"
]
},
"sort": [
1604401060074
]
}
{
"_index": "apm-7.9.3-span-000001",
"_type": "_doc",
"_id": "P5_BjXUBfmnE4qmTYS7b",
"_version": 1,
"_score": null,
"_source": {
"parent": {
"id": "2025d16f38677d70"
},
"observer": {
"hostname": "cyrillerclaptop.localdomain",
"id": "c6806dda-7615-4d01-bc3f-aeb7ca9aa2f2",
"ephemeral_id": "129c441c-0d75-4348-8326-44bf62c33008",
"type": "apm-server",
"version": "7.9.3",
"version_major": 7
},
"agent": {
"name": "opentelemetry/java",
"version": "0.9.1"
},
"trace": {
"id": "6dbb8d4ec843989ef6e580697a38f23b"
},
"@timestamp": "2020-11-03T10:57:40.077Z",
"ecs": {
"version": "1.5.0"
},
"service": {
"environment": "staging",
"name": "frontend"
},
"processor": {
"name": "transaction",
"event": "span"
},
"labels": {
"db_connection_string": "postgresql://localhost:5432",
"thread_id": 43,
"thread_name": "http-nio-8080-exec-3",
"service_namespace": "com-shoppingcart",
"telemetry_auto_version": "0.9.0"
},
"span": {
"duration": {
"us": 4508
},
"subtype": "postgresql",
"destination": {
"service": {
"resource": "postgresql",
"name": "postgresql",
"type": "db"
}
},
"name": "insert into order_product (quantity, order_id, product_id) values (?, ?, ?)",
"id": "b9e73a4f057af4fa",
"type": "db",
"db": {
"instance": "test",
"statement": "insert into order_product (quantity, order_id, product_id) values (?, ?, ?)",
"type": "postgresql",
"user": {
"name": "test"
}
}
},
"timestamp": {
"us": 1604401060077088
}
},
"fields": {
"@timestamp": [
"2020-11-03T10:57:40.077Z"
]
},
"highlight": {
"trace.id": [
"@kibana-highlighted-field@6dbb8d4ec843989ef6e580697a38f23b@/kibana-highlighted-field@"
]
},
"sort": [
1604401060077
]
}
{
"_index": "apm-7.9.3-span-000001",
"_type": "_doc",
"_id": "E5_BjXUBfmnE4qmTYS7b",
"_version": 1,
"_score": null,
"_source": {
"parent": {
"id": "2025d16f38677d70"
},
"observer": {
"hostname": "cyrillerclaptop.localdomain",
"id": "c6806dda-7615-4d01-bc3f-aeb7ca9aa2f2",
"ephemeral_id": "129c441c-0d75-4348-8326-44bf62c33008",
"type": "apm-server",
"version": "7.9.3",
"version_major": 7
},
"agent": {
"name": "opentelemetry/java",
"version": "0.9.1"
},
"trace": {
"id": "6dbb8d4ec843989ef6e580697a38f23b"
},
"@timestamp": "2020-11-03T10:57:40.082Z",
"ecs": {
"version": "1.5.0"
},
"service": {
"environment": "staging",
"name": "frontend"
},
"processor": {
"name": "transaction",
"event": "span"
},
"labels": {
"thread_id": 43,
"thread_name": "http-nio-8080-exec-3",
"service_namespace": "com-shoppingcart",
"telemetry_auto_version": "0.9.0"
},
"span": {
"duration": {
"us": 1550
},
"name": "CrudRepository.save",
"id": "38b2b48fe3f4c01b",
"type": "app"
},
"timestamp": {
"us": 1604401060082090
}
},
"fields": {
"@timestamp": [
"2020-11-03T10:57:40.082Z"
]
},
"highlight": {
"trace.id": [
"@kibana-highlighted-field@6dbb8d4ec843989ef6e580697a38f23b@/kibana-highlighted-field@"
]
},
"sort": [
1604401060082
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment