1

I'm facing an issue that requires me to debug the HTTP traffic within two microservices, we are implementing our microservices with microprofile v3 and openliberty. I've tried to enable the HTTP traces through server.xml and by environmental variables without success.

Does someone know how to enable WIRE traces in Openliberty+OpenJ9?, we are using as base docker image the official open-liberty:javaee8-java11 (Open Liberty 19.0.0.8/wlp-1.0.31.cl190820190813-1136)

Javier Toja
  • 1,630
  • 1
  • 14
  • 31

2 Answers2

2

I confirmed with WAS development that WAS diagnostic trace does not print raw packet contents of request/response bodies although it does print metadata like the request/response lines and headers.

A couple of options for full body tracing:

  1. Use a proxy or network sniffer outside the Docker image.

  2. If the traffic is TLS, -Djavax.net.debug=all (or less verbosely, -Djavax.net.debug=ssl,plaintext) prints response content although no metadata (i.e. no request/response lines and no headers).

  3. Install and use tcpdump (of course, if it's TLS, you'll need the private key to decrypt and more if the conversation uses a cipher like DHE):

    docker exec -u root -it $CONTAINER bash
      apt-get update
      apt-get install -y tcpdump
      tcpdump -nn -v -i any -B 4096 -s 0 -C 100 -W 10 -Z root -w capture_$(hostname)_$(date +"%Y%m%d_%H%M%S_%N").pcap
    

    tcpdump can be baked into the Dockerfile with:

    USER root
    RUN apt-get update && apt-get install -y tcpdump
    USER default
    [...]
    
  4. Use a Docker sidecar.

kgibm
  • 852
  • 10
  • 22
  • Hi, i end up using a sidecar, we are in a early phase using swarm, but taking into account your point regarding the sidecar pattern we are going to go with istio + kubernetes to our next iteration, thank you – Javier Toja Jan 09 '20 at 09:13
1

I think the closest you can get with trace is webcontainer + channel framework trace, which is

"com.ibm.ws.webcontainer*=all:com.ibm.wsspi.webcontainer*=all:HTTPChannel=all:GenericBNF=all"

If you need more than that, you might need to insert some sort of proxy logging tool in between the two microservices.

Bruce T.
  • 992
  • 4
  • 5
  • I need to see the plain http traffic, this level is not enough, I'm going to install a proxy and re-route my request, thank you for your response – Javier Toja Jan 08 '20 at 11:25