From a63bf61c5ba0a0209da0b3bec934212ad3018a38 Mon Sep 17 00:00:00 2001 From: Praveen Barli Date: Mon, 3 Jul 2017 11:31:30 -0700 Subject: [PATCH] add zipkin span in json as custom property to requests/dependencies table --- .../applicationinsights/ApplicationInsightsSpanConsumer.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/storage/applicationinsights/src/main/java/zipkin/storage/applicationinsights/ApplicationInsightsSpanConsumer.java b/storage/applicationinsights/src/main/java/zipkin/storage/applicationinsights/ApplicationInsightsSpanConsumer.java index d130630..6ad2e40 100644 --- a/storage/applicationinsights/src/main/java/zipkin/storage/applicationinsights/ApplicationInsightsSpanConsumer.java +++ b/storage/applicationinsights/src/main/java/zipkin/storage/applicationinsights/ApplicationInsightsSpanConsumer.java @@ -89,6 +89,8 @@ public void accept(List spans) { //data model changes telemetry.getContext().getOperation().setId(Util.toLowerHex(span.traceIdHigh, span.traceId)); telemetry.getContext().getOperation().setName(span.name); + telemetry.getContext().getProperties().put("zipkin-span", res.replace("\"", "\\\"")); + telemetry.getContext().getProperties().put("namespace", namespace); for (Annotation annotation : span.annotations) { @@ -99,7 +101,7 @@ public void accept(List spans) { } else if(annotation.value.equalsIgnoreCase(Constants.SERVER_SEND)){ String spanName = span.name !=null && !span.name.isEmpty()?span.name:Constants.SERVER_RECV; - telemetry.trackRequest(new RequestTelemetry(spanName, new Date(timestamp), span.duration/1000, + telemetry.trackRequest(new RequestTelemetry(spanName, new Date(timestamp), span.duration==null?0L:span.duration/1000, "Ok",true)); } }