From ddc0abd1a5d854c10a3f987f493be29a366fe27b Mon Sep 17 00:00:00 2001 From: Zarna Parekh Date: Fri, 8 Nov 2024 11:27:32 -0800 Subject: [PATCH] Making duration as long (int64) for zipkinApi (#1152) --- .../java/com/slack/astra/zipkinApi/ZipkinService.java | 2 +- .../com/slack/astra/zipkinApi/ZipkinSpanResponse.java | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/astra/src/main/java/com/slack/astra/zipkinApi/ZipkinService.java b/astra/src/main/java/com/slack/astra/zipkinApi/ZipkinService.java index 4d8420e6a0..67ab8cab0f 100644 --- a/astra/src/main/java/com/slack/astra/zipkinApi/ZipkinService.java +++ b/astra/src/main/java/com/slack/astra/zipkinApi/ZipkinService.java @@ -118,7 +118,7 @@ protected static String convertLogWireMessageToZipkinSpan(List m span.setRemoteEndpoint(remoteEndpoint); } span.setTimestamp(convertToMicroSeconds(message.getTimestamp())); - span.setDuration(Math.toIntExact(duration)); + span.setDuration(duration); span.setTags(messageTags); traces.add(span); } diff --git a/astra/src/main/java/com/slack/astra/zipkinApi/ZipkinSpanResponse.java b/astra/src/main/java/com/slack/astra/zipkinApi/ZipkinSpanResponse.java index b07ee59525..d3ba5668de 100644 --- a/astra/src/main/java/com/slack/astra/zipkinApi/ZipkinSpanResponse.java +++ b/astra/src/main/java/com/slack/astra/zipkinApi/ZipkinSpanResponse.java @@ -23,8 +23,8 @@ public class ZipkinSpanResponse { private ZipkinEndpointResponse remoteEndpoint = null; @JsonProperty("duration") - // Zipkin spec defines this is integer, even though a long seems like it would be more appropriate - private int durationMicros; + // Zipkin spec defines this is integer64, so a long seems like a more appropriate + private long durationMicros; private String kind; @@ -48,7 +48,7 @@ public void setTimestamp(long timestampMicros) { this.timestampMicros = timestampMicros; } - public void setDuration(int durationMicros) { + public void setDuration(long durationMicros) { this.durationMicros = durationMicros; } @@ -96,7 +96,7 @@ public long getTimestamp() { return timestampMicros; } - public int getDuration() { + public long getDuration() { return durationMicros; }