Tracing URL template render using String#format does not play well with URLs
Currently, the GITLAB_TRACING_URL
configuration for distributed tracing uses String#format
:
For example, for Jaeger, it could be:
GITLAB_TRACING_URL=http://localhost:16686/search?service=%{service}&tags=%7B"correlation_id"%3A"%{correlation_id}"%7D
Turns out that using String#format
/ %
operator doesn't work well with URL encoded values as Ruby doesn't like the extraneous %
characters in the string.
Originally, a manual .gsub
approach was used with {{ correlation_id }}
and {{ service }}
. I suggest we go back to this approach.
An additional reason why I prefer this approach is that String#format
can throw runtime errors, which is something we would prefer to avoid with Distributed Tracing configuration variables.
Related to gitlab-development-kit!611 (merged)
cc @reprazent