Rename API endpoint.

This commit is contained in:
Attila Uhrin 2022-01-30 11:04:38 +01:00
parent fc36443ae2
commit e8d5b236cc

View File

@ -17,8 +17,8 @@ public class SleuthTraceIdController {
@Autowired @Autowired
private Tracer tracer; private Tracer tracer;
@GetMapping("/hello") @GetMapping("/traceid")
public String hello() { public String getSleuthTraceId() {
logger.info("Hello with Sleuth"); logger.info("Hello with Sleuth");
Span span = tracer.currentSpan(); Span span = tracer.currentSpan();
if (span != null) { if (span != null) {
@ -27,6 +27,6 @@ public class SleuthTraceIdController {
logger.info("Trace ID hex {}", span.context().traceIdString()); logger.info("Trace ID hex {}", span.context().traceIdString());
logger.info("Trace ID decimal {}", span.context().traceId()); logger.info("Trace ID decimal {}", span.context().traceId());
} }
return "hello"; return "Hello from Sleuth";
} }
} }