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

Feature: Add support query with select arbitrary fields from spans for tracesql #518

Open mk-raven opened 2 weeks ago

mk-raven commented 2 weeks ago

We have a problem with kind of query: {span.service.name="service" && span.release_name="dev" && span.k8s.cluster="cluster_name" && duration>1s} | select( [span.http.target) In qryn logs: qryn-read-58dc5966df-ldtnq Couldn't execute script: qryn-read-58dc5966df-ldtnq Expected [ or 'WSP' ] @1:97 encountered ' du'. qryn-read-58dc5966df-ldtnq {span.service.name="service" && span.release_name="dev" && span.k8s.cluster="cluster_name" && duration>1s} | select( span.http.target) qryn-read-58dc5966df-ldtnq {"level":50,"time":1718616486633,"pid":19,"hostname":"qryn-read-58dc5966df-ldtnq","name":"qryn","reqId":"req-qdu","err":"Cannot read properties of null (reading 'rootToken')\nTypeError: Cannot read properties of null (reading 'rootToken')\n at search (/app/traceql/index.js:29:33)\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/@fastify/websocket/index.js:150:24)\n at preHandlerCallback (/app/node_modules/fastify/lib/handleRequest.js:137:37)\n at validationCompleted (/app/node_modules/fastify/lib/handleRequest.js:121:5)\n at preValidationCallback (/app/node_modules/fastify/lib/handleRequest.js:98:5)\n at handler (/app/node_modules/fastify/lib/handleRequest.js:75:7)\n at handleRequest (/app/node_modules/fastify/lib/handleRequest.js:24:5)\n at next (/app/node_modules/fastify/lib/hooks.js:339:7)","msg":"Cannot read properties of null (reading 'rootToken')"} Its common query in traceql: https://grafana.com/docs/tempo/latest/traceql/#selection

Its useful feature for making queries with adding colums

lmangani commented 2 weeks ago

@mk-raven we'll add this to the roadmap. Please provide any relevant links to the documentation/examples of the requested feature

lmangani commented 1 week ago

@mk-raven please retest with the latest version and provide feedback. Thanks!

akvlad commented 1 week ago

should work in 3.2.24. feel free to try.