metrico / qryn

Polyglot Observability Stack. Lightweight & Drop-in compatible with Loki, Prometheus, Tempo, Pyroscope, Opentelemetry, Datadog & more! WASM powered ⭐️ Star to Support
https://qryn.dev
GNU Affero General Public License v3.0
1.05k stars 63 forks source link

TraceQL parse error when tag name include "-" #496

Closed Cluas closed 2 months ago

Cluas commented 2 months ago

When span tag name include "-", traceQL parse broken.

Example traceQL:

{span.account-channel="xxx"}

Logs:

"level":50,"time":1713771427525,"pid":23,"hostname":"qryn-77f8c87d45-227hd","name":"qryn","reqId":"req-362","err":"1:14: unexpected token \"-\" (expected (\"=\" | \"!=\" | \"<\" | \"<=\" | \">\" | \">=\" | \"=~\" | \"!~\") Value)\nError: 1:14: unexpected token \"-\" (expected (\"=\" | \"!=\" | \"<\" | \"<=\" | \">\" | \">=\" | \"=~\" | \"!~\") Value)\n    at module.exports.TranspileTraceQL (/app/wasm_parts/main.js:129:13)\n    at search (/app/traceql/index.js:38:15)\n    at searchV2 (/app/lib/handlers/tempo_search.js:74:26)\n    at Object.handler (/app/lib/handlers/tempo_search.js:25:18)\n    at routeOptions.handler (/app/node_modules/.store/@fastify+websocket@8.2.0/node_modules/@fastify/websocket/index.js:150:24)\n    at preHandlerCallback (/app/node_modules/.store/fastify@4.24.3/node_modules/fastify/lib/handleRequest.js:137:37)\n    at validationCompleted (/app/node_modules/.store/fastify@4.24.3/node_modules/fastify/lib/handleRequest.js:121:5)\n    at preValidationCallback (/app/node_modules/.store/fastify@4.24.3/node_modules/fastify/lib/handleRequest.js:98:5)\n    at handler (/app/node_modules/.store/fastify@4.24.3/node_modules/fastify/lib/handleRequest.js:75:7)\n    at handleRequest (/app/node_modules/.store/fastify@4.24.3/node_modules/fastify/lib/handleRequest.js:24:5)","msg":"1:14: unexpected token \"-\" (expected (\"=\" | \"!=\" | \"<\" | \"<=\" | \">\" | \">=\" | \"=~\" | \"!~\") Value)"}
akvlad commented 2 months ago

should be fixed in 3.2.20