Skip to content

Commit

Permalink
Fixing the Zipkin API (endpoint: /api/v2/trace/{traceId})
Browse files Browse the repository at this point in the history
  • Loading branch information
zarna1parekh committed Oct 31, 2024
1 parent a5c6ab0 commit 7706293
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions astra/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,11 @@
</dependency>

<!-- Misc -->
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20210307</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.TimeUnit;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -200,7 +201,13 @@ public HttpResponse getTraceByTraceId(
@Param("endTimeEpochMs") Optional<Long> endTimeEpochMs,
@Param("maxSpans") Optional<Integer> maxSpans)
throws IOException {
String queryString = "trace_id:" + traceId;

JSONObject traceObject = new JSONObject();
traceObject.put("trace_id", traceId);
JSONObject queryJson = new JSONObject();
queryJson.put("term", traceObject);
String queryString = queryJson.toString();

long startTime =
startTimeEpochMs.orElseGet(
() -> Instant.now().minus(LOOKBACK_MINS, ChronoUnit.MINUTES).toEpochMilli());
Expand Down

0 comments on commit 7706293

Please sign in to comment.