Skip to content

tracing: encode UUIDs to with \x hex formatting for FixedString(16) compatbility

Joe Shaw requested to merge joe/e2e_tracing_flakes into main

Using native query parameters for FixedString(16) UUIDs often directly generates non-graphical/printable characters. These tend to work fine over the wire, but we can also end up in situations where invalid escape sequences are generated and there are a limited number of valid string literal escape sequences in ClickHouse.

To avoid these issues the trace UUIDs are encoded into '\XFF' format hex format. This is directly compatible with native query parameters and it provides a readable output that can be compared with the original UUID with human eyes.

The sting array formatting has also been updated to handle escaping of \ and ' characters that otherwise break the quoted string literals in a printed array.

Also make all tracing e2e tests repeatable, which weren't generating unique names to query against.

Tested by running all tracing e2e tests with the MustPassRepeatedly(10) decorator a number of times.

Fixes #2740 (closed)

Edited by Joe Shaw

Merge request reports