router icon indicating copy to clipboard operation
router copied to clipboard

test_jaeger_tracing failing

Open SimonSapin opened this issue 2 years ago • 2 comments

Describe the bug test_jaeger_tracing fails on my machine

To Reproduce Steps to reproduce the behavior:

  1. Run docker compose up --build
  2. In another terminal, run cargo xtask test
  3. See test fail with the output below

Expected behavior DEVELOPMENT.md should have sufficient instructions to make tests pass for local development

Output

headers: {"content-type": "application/json", "accept": "application/json", "uber-trace-id": "d1309c0722b360f8b8218792b1c37591:c6e7702d4a69c91d:0:1", "host": "localhost:4005", "content-length": "31"}
flush result: [Ok(())]
error: incomplete traces, got {} expected {"products", "router", "my_app"}
error: incomplete traces, got {} expected {"products", "router", "my_app"}
error: incomplete traces, got {} expected {"products", "router", "my_app"}
error: incomplete traces, got {} expected {"my_app", "router", "products"}
error: incomplete traces, got {} expected {"my_app", "router", "products"}
error: incomplete traces, got {} expected {"my_app", "router", "products"}
error: incomplete traces, got {} expected {"router", "products", "my_app"}
error: incomplete traces, got {} expected {"my_app", "router", "products"}
error: incomplete traces, got {} expected {"products", "my_app", "router"}
error: incomplete traces, got {} expected {"router", "my_app", "products"}
thread 'test_jaeger_tracing' panicked at 'did not get full otel trace', apollo-router/tests/jaeger_test.rs:66:5

Desktop (please complete the following information):

  • OS: macOS
  • Version: 12.4

Additional context Docker runs in an Ubuntu 22.04 VM, with TCP forwarding for ports 4000, 4001, 4002, 4003, 4004, 4100, 16686, and 14268.

SimonSapin avatar Jun 03 '22 12:06 SimonSapin

With help from Bryn we’ve established that this is likely caused by traces sent by the Jaeger client within the router not reaching the Jaeger agent, because I’d need to also forward UDP port 6831

SimonSapin avatar Jun 07 '22 16:06 SimonSapin

With that redirect in place, I now see UDP packets with Wireshark on the (virtual) machine running Docker, including one that contains the string my_app:

image

This is a port number where something is listening:

❯ sudo netstat -ulnp | grep docker  
udp        0      0 0.0.0.0:6831            0.0.0.0:*                           25312/docker-proxy  
udp        0      0 0.0.0.0:6832            0.0.0.0:*                           25292/docker-proxy  
udp6       0      0 :::6831                 :::*                                25319/docker-proxy  
udp6       0      0 :::6832                 :::*                                25299/docker-proxy  

… but I still don’t find anything with my_app in Jaeger on http://localhost:16686/

SimonSapin avatar Jun 10 '22 13:06 SimonSapin

This seems to a docker config issue rather than a bug. Running docker outside of a vm will likely resolve the issue. Let's close for now.

BrynCooke avatar Nov 18 '22 11:11 BrynCooke