-
Notifications
You must be signed in to change notification settings - Fork 11.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tempo: Allow quotes in tag names and attributes #77864
Conversation
@joe-elliott Tagging you just to be sure we are on the same page that allowing to use quotes for attribute names can also allow for some weird tag names and thus queries (see example in the PR description). I think this is a caveat we cannot avoid and that it is up to the user to avoid to abuse of this feature (usage of quotes in attribute names). But if you have better ideas, happy to hear them! |
Yup, this definitely makes some horrible things possible :). This is fine because if you are naming your tags:
Then it's ok that your TraceQL queries look unreadable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we get a more detailed error message for this?
![Screenshot 2023-11-15 at 20 31 16](https://private-user-images.githubusercontent.com/90795735/283246719-e3ff485a-0c18-4d94-9ea4-792b0777ab87.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAyNTUwOTUsIm5iZiI6MTcyMDI1NDc5NSwicGF0aCI6Ii85MDc5NTczNS8yODMyNDY3MTktZTNmZjQ4NWEtMGMxOC00ZDk0LTllYTQtNzkyYjA3NzdhYjg3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA2VDA4MzMxNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWM4OWQ5MjZjNDkyY2ZhNTk1MmY5M2ZlYmNkNzViMmI2YTRkYmQwYzcwMDcxMWZhMmI3M2RmZTA3NjdmMGE5NDMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.NVyyRLy90gv8dMSooSoVoSvhYPI-qxfSBZz226AjFMc)
Also, honestly I'm not sure why we need to support some of these strange strings with quotes all over the place :D Is it because the quotes can technically be anywhere in the string and we are not sure of all the cases where it would be invalid/valid so it would be difficult to restrict where the quotes can be? (so we just basically allow the quotes in many places)
We can discuss this, also with the Tempo squad. For now I've just implemented the original request and according to what Tempo allows, namely quotes at any point: |
Discussed offline. We agreed to allow quotes as in Tempo, at least for the moment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Allow tag names and values to use
![image](https://private-user-images.githubusercontent.com/135109076/281399974-25f4d3da-cda7-4a9f-87fe-f67af1e28c47.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAyNTUwOTUsIm5iZiI6MTcyMDI1NDc5NSwicGF0aCI6Ii8xMzUxMDkwNzYvMjgxMzk5OTc0LTI1ZjRkM2RhLWNkYTctNGE5Zi04N2ZlLWY2N2FmMWUyOGM0Ny5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzA2JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcwNlQwODMzMTVaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1lOTQ2YTRlNWFlMDE3YmRlMmIyZjZiYzYzNWRlYTYxNjMwNWM2NDQxYzRjNTY2NWE0YjA3OGY4MWQ0Mjk0YmMyJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.CxJjrPvyxMTXUchGntWZvnWfGkzHN6mdkt8kymtepRQ)
![image](https://private-user-images.githubusercontent.com/135109076/281413197-67f1f313-1fe0-479d-87bd-edf7d3c759a1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAyNTUwOTUsIm5iZiI6MTcyMDI1NDc5NSwicGF0aCI6Ii8xMzUxMDkwNzYvMjgxNDEzMTk3LTY3ZjFmMzEzLTFmZTAtNDc5ZC04N2JkLWVkZjdkM2M3NTlhMS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzA2JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcwNlQwODMzMTVaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1mZDI4OWEwYTIyNWFhOGM3N2IzMjA3ZDE0ZDQyNmE5ZmRhOTk3MTdhMWM3MmFmMzZhMTY3YTA0M2UyZTA0MTM5JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.MuU1CBMGwG8vfg-ffIyMz1rhmKZnpbpPtubWKMjrPfc)
"
. Examples:Note that this allows to write queries that might look wrong at first sight. Example (note the missing closing double quote after
![image](https://private-user-images.githubusercontent.com/135109076/281399873-5933dca8-0dea-46f4-aa35-f247a207c5f6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAyNTUwOTUsIm5iZiI6MTcyMDI1NDc5NSwicGF0aCI6Ii8xMzUxMDkwNzYvMjgxMzk5ODczLTU5MzNkY2E4LTBkZWEtNDZmNC1hYTM1LWYyNDdhMjA3YzVmNi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzA2JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcwNlQwODMzMTVaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT02YzE0ODY5M2M4OTg0YzRlNDQzZGU4YjE1ODA4Y2U3ZjExMmZjNWM0M2QzNjIzNWRjOThiZWZmMjQ0MDM3ZjkyJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.n_1rvYqHOvQDAsiJa__hQU-gHRpkzL-GZF_XA1vIgyU)
GET
):Also, note that for autocompletion to work properly, we need a corresponding fix in Tempo, as mentioned here.
Fixes #77394
Fixes #77685