We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
when we using webflux with sofa tracer, we have controller code like this:
@RestController public class SampleRestController { private static Logger logger = LoggerFactory.getLogger(SampleRestController.class); private static final String TEMPLATE = "Hello, %s!"; private final AtomicLong counter = new AtomicLong(); /*** * http://localhost:8080/springwebflux * @param name name * @return map */ @RequestMapping("/springwebflux") public Mono<Map<String, Object>> springwebflux(@RequestParam(value = "name", defaultValue = "SOFATracer SpringWebFlux DEMO") String name) { Map<String, Object> resultMap = new HashMap<String, Object>(); resultMap.put("success", true); resultMap.put("id", counter.incrementAndGet()); resultMap.put("content", String.format(TEMPLATE, name)); logger.info("result: {}", resultMap); return Mono.delay(Duration.ofSeconds(3)).map(i -> resultMap); } }
application.properties:
# Application Name spring.application.name=SOFATracerSpringWebFlux # logging path logging.path=./logs com.alipay.sofa.tracer.samplerPercentage=100 com.alipay.sofa.tracer.samplerName=PercentageBasedSampler com.alipay.sofa.tracer.zipkin.base-url=http://127.0.0.1:9411 com.alipay.sofa.tracer.zipkin.enabled=true
we visit http://localhost:8080/springwebflux in concurrent mode with env -Dreactor.netty.ioWorkerCount=1
-Dreactor.netty.ioWorkerCount=1
logs/tracelog/spring-mvc-digest.log should have output lines for every request
logs/tracelog/spring-mvc-digest.log
logs/tracelog/spring-mvc-digest.log lost some logs
java -version
uname -a
The text was updated successfully, but these errors were encountered:
code in WebfluxSofaTracrFilter.java using code:
SofaTracerSpan springMvcSpan = springMvcTracer.serverReceive(spanContext);
to create first SofaTracerSpan,
but serverReceive in AbstractTracer using
serverReceive
AbstractTracer
SofaTraceContext sofaTraceContext = SofaTraceContextHolder.getSofaTraceContext(); SofaTracerSpan serverSpan = sofaTraceContext.pop();
to keep SofaTracerSpan in ThreadLocal
as we known, in concurrent mode, multi reactor stream may share same thread, it will lead to unknown bug with thread local variables
Sorry, something went wrong.
No branches or pull requests
Describe the bug
when we using webflux with sofa tracer, we have controller code like this:
application.properties:
we visit http://localhost:8080/springwebflux in concurrent mode with env
-Dreactor.netty.ioWorkerCount=1
Expected behavior
logs/tracelog/spring-mvc-digest.log
should have output lines for every requestActual behavior
logs/tracelog/spring-mvc-digest.log
lost some logsSteps to reproduce
Minimal yet complete reproducer code (or GitHub URL to code)
Environment
java -version
):uname -a
):The text was updated successfully, but these errors were encountered: