Add smoke test for Logback MDC instrumentation - Spring Boot app changes (#1228)

This commit is contained in:
Mateusz Rzeszutek 2020-09-21 16:51:23 +02:00 committed by GitHub
parent b240cf95e7
commit c45a8cd432
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -17,13 +17,18 @@
package io.opentelemetry.smoketest.springboot.controller; package io.opentelemetry.smoketest.springboot.controller;
import io.opentelemetry.extensions.auto.annotations.WithSpan; import io.opentelemetry.extensions.auto.annotations.WithSpan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@RestController @RestController
public class WebController { public class WebController {
private static final Logger LOGGER = LoggerFactory.getLogger(WebController.class);
@RequestMapping("/greeting") @RequestMapping("/greeting")
public String greeting() { public String greeting() {
LOGGER.info("HTTP request received");
return withSpan(); return withSpan();
} }

View File

@ -1 +1,3 @@
logging.level.root=WARN logging.level.root=WARN
logging.level.io.opentelemetry=INFO
logging.pattern.console=%-5level [%t] %C{1.}: %msg traceId=%X{traceId}%n