grafana / tempo

Grafana Tempo is a high volume, minimal dependency distributed tracing backend.
https://grafana.com/oss/tempo/
GNU Affero General Public License v3.0
3.88k stars 504 forks source link

Search query TraceQL is truncated to 1024 characters #3747

Closed Handy-caT closed 2 weeks ago

Handy-caT commented 3 months ago

For a query longer than 1024 characters, Tempo will return an error:

Error (invalid TraceQL query: parse error at line 1, col 1025: syntax error: unexpected $end). Please check the server logs for more details.

It alsways returns 1025, not real query length (for my example length is 1073).

To Reproduce Steps to reproduce the behavior:

  1. Start Tempo
  2. Send a request with query longer than 1024 characters
  3. The error is returned

Expected behavior Any query works.

Environment:

Infrastructure: docker

Additional Context

Снимок экрана 2024-06-04 в 12 48 47

2024-06-04 12:34:08 level=error ts=2024-06-04T09:34:08.392342793Z caller=search_handlers.go:84 msg="search: parse search request failed" err="invalid TraceQL query: parse error at line 1, col 1025: syntax error: unexpected $end"
2024-06-04 12:34:08 level=info ts=2024-06-04T09:34:08.392377084Z caller=handler.go:133 tenant=single-tenant method=GET traceID=3e4195d536fe281f url="/api/search?q=<query>&limit=20000&spss=3&start=1717488489&end=1717492089" duration=144.542µs response_size=0 status=400

This issue is similar to #3513, but related to whole query lenght, not character attribute names or static values.

joe-elliott commented 3 months ago

That's interesting. The linked PR adds a test that includes queries > 1024:

https://github.com/grafana/tempo/pull/3571/files#diff-d8f0eeb0f51fa96478a53e37dcfc511f62d7b6b34960229c984308f6bf541df6R1171

Likely we're overrunning the same lex buffer in a different way?

github-actions[bot] commented 1 month ago

This issue has been automatically marked as stale because it has not had any activity in the past 60 days. The next time this stale check runs, the stale label will be removed if there is new activity. The issue will be closed after 15 days if there is no new activity. Please apply keepalive label to exempt this Issue.