Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/io/appform/core/hystrix/CommandFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public static <R> GenericHystrixCommand<R> create(

public static <R> GenericHystrixCommand<R> create(
String group, String command) {
return create(group,command, UUID.randomUUID().toString().replaceAll("-", ""));
return create(group,command, UUID.randomUUID().toString().replace("-", ""));
}

private CommandFactory() {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ protected R run() throws Exception {
if (parentMDCContext != null) {
MDC.setContextMap(parentMDCContext);
}
final Span span = TracingHandler.startChildSpan(tracer, parentActiveSpan, command);
final Span span = TracingHandler.startChildSpan(tracer, parentActiveSpan, commandKey(group, command));
final Scope scope = TracingHandler.activateSpan(tracer, span);

MDC.put(TRACE_ID, traceId);
Expand Down
9 changes: 6 additions & 3 deletions src/main/java/io/appform/core/hystrix/TracingHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,15 @@ public static Span getParentActiveSpan(final Tracer tracer) {

public static Span startChildSpan(final Tracer tracer,
final Span parentSpan,
final String command) {
final String commandKey) {
try {
if (tracer == null || parentSpan == null) {
return null;
}
return tracer.buildSpan("hystrix:"+command)

return tracer.buildSpan("hystrix:" + commandKey)
.asChildOf(parentSpan)
.withTag("hystrix.command", command)
.withTag("hystrix.command", commandKey)
.start();
} catch (Exception e) {
log.error("Error while starting child span", e);
Expand Down Expand Up @@ -73,4 +74,6 @@ public static void closeScopeAndSpan(final Span span,
log.error("Error while closing span and scope", e);
}
}

private TracingHandler() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ public void testCreateCollectionCommand() {
.execute();
Assert.assertEquals(result, list);
}
}
}