APM Agent language and version: Java Agent 1.16.0
Hi,
we are currently setting distributed tracing between our µservices and our legacy application.
Our µservices are based on spring boot. So no real problem excepted that WebFlux is not currently supported.
But the legacy application is an ear application deployed on a WIldFly 10.
So the problem is that our logs don't contain the trace.id or transaction.id
We can see all the transactions in kibana from REST to Database transactions.
But it seems the trace.id and transaction.id are not put in our MDC.
We followed the steps to configure the WF in domain mode.
We added the MDC part to the log4J pattern layout as for our µservices : [trace.id:%X{trace.id}, Transaction.id:%X{transaction.id}] ........
But both logging information remain empty:
Here is an example of our log output:
[Server:phenix-local] [trace.id:, transaction.id:] 12:41:14,013 INFO [stdout] (default task-30) 26-05-2020 12:41:14.014 INFO [H|buyway-internet|L171212|d31ab668-15b3-4fdf-a39b-8bdabd958209|0000|-] (ContainerResponseFilterWrapper.java:45) - * Client out-bound request
[Server:phenix-local] [trace.id:, transaction.id:] 12:41:14,013 INFO [stdout] (default task-30) > GET http://localhost:8080/bwwebservices/products/?retailerNumber=1989151&productCode=PAT&creditAmount=2500.00&mode=OPENING&filterRateRanges=true
[Server:phenix-local] [trace.id:, transaction.id:] 12:41:14,013 INFO [stdout] (default task-30) > Accept: application/json
[Server:phenix-local] [trace.id:, transaction.id:] 12:41:14,013 INFO [stdout] (default task-30) > Accept-Language: fr
[Server:phenix-local] [trace.id:, transaction.id:] 12:41:14,013 INFO [stdout] (default task-30) > Authorization: Basic Yn... <truncated>
[Server:phenix-local] [trace.id:, transaction.id:] 12:41:14,013 INFO [stdout] (default task-30) > Connection: keep-alive
[Server:phenix-local] [trace.id:, transaction.id:] 12:41:14,013 INFO [stdout] (default task-30) > Content-Type: application/json
[Server:phenix-local] [trace.id:, transaction.id:] 12:41:14,013 INFO [stdout] (default task-30) > elastic-apm-traceparent: 00-537fc812faa5fd84567ae0bc3af80953-131edc8b70f4f838-01
[Server:phenix-local] [trace.id:, transaction.id:] 12:41:14,013 INFO [stdout] (default task-30) > Host: localhost:8080
[Server:phenix-local] [trace.id:, transaction.id:] 12:41:14,013 INFO [stdout] (default task-30) > traceparent: 00-537fc812faa5fd84567ae0bc3af80953-131edc8b70f4f838-01
[Server:phenix-local] [trace.id:, transaction.id:] 12:41:14,013 INFO [stdout] (default task-30) > User-Agent: Java/1.8.0_144
[Server:phenix-local] [trace.id:, transaction.id:] 12:41:14,013 INFO [stdout] (default task-30)
I can see the elastic-apm-traceparent as well as the traceparent in the http request header.
And we are sure MDC is set and working because we have other fields injected in our MDC.
Is there additional setup we are missing ?
Thanks a lot for your help.
Kind Regards,
Stessy