You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently you can access an attribute in TraceQL with a dot (.) and then typing the attribute name: .value. All characters after the dot and up to the next breaking character are considered part of the attribute name. Examples of breaking characters include things like =, space, etc (full list here). This allows queries like .value=5 to work as expected. However it also prevents using attributes with these special characters in the name. Attribute names can contain any UTF-8 character and TraceQL should support it.
We can solve this with a new optional quoted syntax for attribute names, like this: ."value with a space". All characters between the quotes will be considered part of the attribute name, including all breaking characters that were previously not allowed. Backslashes can be used to escape and embed quotes and the backslash itself ."name with a quote \" and a slash \\". We think this solution solves 100% of the attribute naming issues.
Quoted names can be combined with scopes: resource."name"span."name". The quotes only wrap the name portion to change the way it is parsed.
Additional notes
All previous attribute name parsing still remains. The default syntax .name is simple and readable and we want to keep it.
The only required escape sequences are \" (double quote) and \\ backslash. But this provides a good framework for adding more escape sequences in the future if we think of them.
This quoted approach should mesh well with other how other languages will support non-standard characters (i.e. PromQL)
The text was updated successfully, but these errors were encountered:
Currently you can access an attribute in TraceQL with a dot (.) and then typing the attribute name:
.value
. All characters after the dot and up to the next breaking character are considered part of the attribute name. Examples of breaking characters include things like=
, space, etc (full list here). This allows queries like.value=5
to work as expected. However it also prevents using attributes with these special characters in the name. Attribute names can contain any UTF-8 character and TraceQL should support it.We can solve this with a new optional quoted syntax for attribute names, like this:
."value with a space"
. All characters between the quotes will be considered part of the attribute name, including all breaking characters that were previously not allowed. Backslashes can be used to escape and embed quotes and the backslash itself."name with a quote \" and a slash \\"
. We think this solution solves 100% of the attribute naming issues.Quoted names can be combined with scopes:
resource."name"
span."name"
. The quotes only wrap the name portion to change the way it is parsed.Additional notes
.name
is simple and readable and we want to keep it.\"
(double quote) and\\
backslash. But this provides a good framework for adding more escape sequences in the future if we think of them.The text was updated successfully, but these errors were encountered: