So it looks like the ‘SELECT @@max_allowed_packet;’ part is not returning any data to Grafana and its getting stuck here as can be seem by these tcpdump comparisons:
SELECT @@max_allowed_packet;
10:19:01.479534 IP 10.166.9.57.42708 > 10.166.4.52.3306: Flags [P.], seq 157:189, ack 254, win 229, options [nop,nop,TS val 499757159 ecr 498421067], length 32
0x0000: 4508 0054 0b73 4000 4006 0c71 0aa6 0939 E..T.s@.@..q...9
0x0010: 0aa6 0434 a6d4 0cea f0ba 21c3 e12c 8247 ...4......!..,.G
0x0020: 8018 00e5 e92f 0000 0101 080a 1dc9 b067 ...../.........g
0x0030: 1db5 4d4b 1c00 0000 0353 454c 4543 5420 ..MK.....SELECT.
0x0040: 4040 6d61 785f 616c 6c6f 7765 645f 7061 @@max_allowed_pa
0x0050: 636b 6574 cket
10:19:01.480323 IP 10.166.4.52.3306 > 10.166.9.57.42708: Flags [P.], seq 254:337, ack 189, win 227, options [nop,nop,TS val 498517692 ecr 499757159], length 83
0x0000: 4500 0087 c1f0 4000 4006 55c8 0aa6 0434 E.....@.@.U....4
0x0010: 0aa6 0939 0cea a6d4 e12c 8247 f0ba 21e3 ...9.....,.G..!.
0x0020: 8018 00e3 2332 0000 0101 080a 1db6 c6bc ....#2..........
0x0030: 1dc9 b067 0100 0001 012a 0000 0203 6465 ...g.....*....de
0x0040: 6600 0000 1440 406d 6178 5f61 6c6c 6f77 f....@@max_allow
0x0050: 6564 5f70 6163 6b65 7400 0c3f 0015 0000 ed_packet..?....
0x0060: 0008 a080 0000 0005 0000 03fe 0000 0200 ................
0x0070: 0a00 0004 0931 3334 3231 3737 3238 0500 .....134217728..
0x0080: 0005 fe00 0002 00 .......
10:19:01.480978 IP 10.166.9.57.42708 > 10.166.4.52.3306: Flags [.], ack 337, win 229, options [nop,nop,TS val 499757161 ecr 498517692], length 0
0x0000: 4508 0034 0b74 4000 4006 0c90 0aa6 0939 E..4.t@.@......9
0x0010: 0aa6 0434 a6d4 0cea f0ba 21e3 e12c 829a ...4......!..,..
0x0020: 8010 00e5 7656 0000 0101 080a 1dc9 b069 ....vV.........i
0x0030: 1db6 c6bc
Starting Grafana:
10:19:29.956701 IP 10.166.9.57.37700 > 10.166.4.52.6033: Flags [P.], seq 104:136, ack 90, win 229, options [nop,nop,TS val 499785637 ecr 498546168], length 32
0x0000: 4500 0054 c7c2 4000 4006 5029 0aa6 0939 E..T..@.@.P)...9
0x0010: 0aa6 0434 9344 1791 fdfa d885 aa97 4344 ...4.D........CD
0x0020: 8018 00e5 4bc1 0000 0101 080a 1dca 1fa5 ....K...........
0x0030: 1db7 35f8 1c00 0000 0353 454c 4543 5420 ..5......SELECT.
0x0040: 4040 6d61 785f 616c 6c6f 7765 645f 7061 @@max_allowed_pa
0x0050: 636b 6574 cket
10:19:29.996216 IP 10.166.4.52.6033 > 10.166.9.57.37700: Flags [.], ack 136, win 227, options [nop,nop,TS val 498546208 ecr 499785637], length 0
0x0000: 4500 0034 771f 4000 4006 a0ec 0aa6 0434 E..4w.@.@......4
0x0010: 0aa6 0939 1791 9344 aa97 4344 fdfa d8a5 ...9...D..CD....
0x0020: 8010 00e3 22df 0000 0101 080a 1db7 3620 ....".........6.
0x0030: 1dca 1fa5
The query is the same, but when Grafana sends it no answer is given back, not sure what it’s doing different.