Skip to content
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: Highlight errors in TraceQL query #74697

Merged
merged 10 commits into from
Oct 3, 2023
Merged

Conversation

fabrizio-grafana
Copy link
Contributor

As of now, when a TraceQL query contains syntax errors, it just fail when submitted to Tempo. No feedback is given to the user before submitting it, and the error message returned by Tempo is not particularly user friendly.

To help users understand why their query failed, we want to highlight the parts of the query that might be wrong due to syntax errors. This should simplify the user experience and the usage of TraceQL.

Example of outcome after changes:
image

Fixes #74264

@fabrizio-grafana fabrizio-grafana changed the title [Dashboards] Highlight errors in TraceQL query [Tempo] Highlight errors in TraceQL query Sep 13, 2023
@fabrizio-grafana fabrizio-grafana changed the title [Tempo] Highlight errors in TraceQL query Tempo: Highlight errors in TraceQL query Sep 13, 2023
@fabrizio-grafana fabrizio-grafana marked this pull request as ready for review September 18, 2023 12:13
@fabrizio-grafana fabrizio-grafana requested a review from a team as a code owner September 18, 2023 12:13
Copy link
Contributor

@adrapereira adrapereira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great improvement! However I would like us to work on this a little more before merging, let me know what you think!

@fabrizio-grafana
Copy link
Contributor Author

fabrizio-grafana commented Sep 18, 2023

Sure, let's improve it a little more. Currently this feature works as in the LogQL editor, but we can definitely make it better, I'll work on it!

@fabrizio-grafana
Copy link
Contributor Author

@adrapereira let me know if you think we are going in the right direction. We can then improve the details, such as changing a little bit the error messages—e.g., instead of "Invalid comparison operator", have something like "Expected comparison operator, received X instead".

@adrapereira adrapereira merged commit e8a708c into main Oct 3, 2023
15 checks passed
@adrapereira adrapereira deleted the traceql/highlight-errors branch October 3, 2023 14:07
bergquist added a commit that referenced this pull request Oct 3, 2023
* main:
  Docs: Fix link to developing plugins (#75816)
  Fix: visualization vs visualisation in feature description (#75895)
  Chore: Bump storybook 7.4.5 (#75652)
  Correlations: Add an editor in Explore (#73315)
  i18n: dashboard settings (#75854)
  Tempo: Highlight errors in TraceQL query (#74697)
  Datasources: Filter plugin errors to only show datasource plugins (#74339)
  Fix sticky header issue (#75710)
  Transformations: Extended support for variables in filter by name (#75734)
  Alerting: Fix being redirected to list view when clicking Save rule button (#75510)
  Tracing: Standardize on otel tracing (#75528)
  Fix developer links and newly discovered spelling errors (#75875)
  i18n: Mark up GeneralSettings for translations (#75827)
  DockedMegaMenu: Refactor and rename to simplify (#75872)
  sql: numeric inputs: use it's own simple implementation (#74904)
mildwonkey pushed a commit that referenced this pull request Oct 4, 2023
* Highlight errors

* Chores

* Refactor

* Address PR comments

* Refactoring

* Fix

* Handle another case

* Handle more use cases
@zerok zerok removed this from the 10.2.x milestone Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Highlight erroneous query parts
3 participants