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

Trace Analytics: Add support for querying traces by lucene queries #129

Merged
merged 7 commits into from
Apr 11, 2023

Conversation

sarahzinger
Copy link
Member

@sarahzinger sarahzinger commented Apr 7, 2023

Based off of: #122

What this PR does / why we need it:
While working on #122 we did not hook up the lucene query string input field. This pr adds the ability for a user to continue to filter traces results with the lucene query field. While doing so, I realized it might make more sense to combine this field and the traceid field as I'm not sure there's a use case for users wanting to filter their spans with a lucene query, nor am I confident there's a usecase to show a single traceId in the trace list view.

While I was working on this, I kind of realized it might not make sense to store the entire lucene query object that we send to the backend within grafana. Instead we simply store that this is a traces query.

Then in datasource.ts's query function we check if the query is a traces query and if so return back the query formatted in DSL. Then when we map responses to dataframes, we do a similar check to see if it's a trace query and whether it is a single trace query and format the response.

In doing this I was able to delete the TracesQueryEditor and I ended up moving some of the traces files out of components and more top level as they are no longer involved in react. I apologies for the big git diff, but we could probably use another review anyway.

Which issue(s) this PR fixes:

Fixes #124
Fixes #123

Special notes for your reviewer:

Screen.Recording.2023-04-07.at.4.59.59.PM.mov

Also quickly added the ability to make clickable links!:

Screen.Recording.2023-04-10.at.8.42.06.AM.mov

@sarahzinger sarahzinger marked this pull request as ready for review April 7, 2023 21:23
@sarahzinger sarahzinger requested a review from a team as a code owner April 7, 2023 21:23
@sarahzinger sarahzinger requested review from idastambuk and kevinwcyu and removed request for a team April 7, 2023 21:23
@github-actions
Copy link

github-actions bot commented Apr 7, 2023

Levitate is-compatible report:

🔍 Resolving @grafana/data@latest...
🔍 Resolving @grafana/ui@latest...
🔍 Resolving @grafana/runtime@latest...
🔍 Resolving @grafana/e2e-selectors@latest...

🔬 Checking compatibility between ./src/module.ts and @grafana/data@9.4.7...
✔ Found @grafana/data version 9.0.2 locally

🔬 Checking compatibility between ./src/module.ts and @grafana/ui@9.4.7...
✔ Found @grafana/ui version 9.0.2 locally

🔬 Checking compatibility between ./src/module.ts and @grafana/runtime@9.4.7...
✔ Found @grafana/runtime version 9.0.2 locally

🔬 Checking compatibility between ./src/module.ts and @grafana/e2e-selectors@9.4.7...
✔ Found @grafana/e2e-selectors version 9.0.2 locally

✔️ ./src/module.ts appears to be compatible with @grafana/data,@grafana/ui,@grafana/runtime,@grafana/e2e-selectors

@github-actions
Copy link

github-actions bot commented Apr 7, 2023

Backend code coverage report for PR #129
No changes

@github-actions
Copy link

github-actions bot commented Apr 7, 2023

Frontend code coverage report for PR #129

Plugin Main PR Difference
src 76.89% 76.72% -.17%

Copy link
Contributor

@idastambuk idastambuk left a comment

Choose a reason for hiding this comment

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

I really like the improvements, great job!

@sarahzinger sarahzinger merged commit 758a928 into traces-query-editor Apr 11, 2023
3 checks passed
@sarahzinger sarahzinger deleted the lucene-query branch April 11, 2023 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants