-
Notifications
You must be signed in to change notification settings - Fork 22
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
Refactor Response Parser #309
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sarahzinger
requested review from
fridgepoet and
kevinwcyu
and removed request for
a team
November 20, 2023 00:55
1 task
sarahzinger
force-pushed
the
sarahzinger/refactor-parser
branch
from
November 20, 2023 01:12
ed7e5b5
to
7dfbf2f
Compare
kevinwcyu
approved these changes
Nov 20, 2023
pkg/opensearch/response_parser.go
Outdated
@@ -13,6 +13,7 @@ import ( | |||
simplejson "github.com/bitly/go-simplejson" | |||
"github.com/grafana/grafana-plugin-sdk-go/backend" | |||
"github.com/grafana/grafana-plugin-sdk-go/data" | |||
"github.com/grafana/opensearch-datasource/pkg/opensearch/client" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this line can be removed following the two code suggestions below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great catch thank you!
Co-authored-by: Kevin Yu <[email protected]>
Co-authored-by: Kevin Yu <[email protected]>
idastambuk
approved these changes
Nov 21, 2023
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While working on adding backend support for traces as part of #287 I noticed that our response parser could use some refactoring improvements. To make the prs easier to read I've broken them up.
Changes:
newTimeSeriesQuery
tonewQueryRequest
. It seems a bit confusing to describe all the work that happens in there as timeSeries queries (although I do think they often---always?-- have a time field attached).getTimeSeries
toparseQuery
I think this more accurately describes what's happening. The request has already been made, the responses just need to be parsed and again I think describing all of the types we support as timeseries feels a bit misleading maybe?newQueryRequest
,luceneHandler
, and ultimately to the requestParser. This will eventually be necessary when adding traces to the request parser because we need to use the datasourceUID and datasource Name to add to the field for TraceId, so that all traceIds are clickable and open an individual trace view. I could have possibly instead accessed this off ofclient
the way we do with configurable fields, but it felt a bit strange to me to add a getter in client to access the datasource, when client's main responsibility is to communicate with open search.debugInfo
within the if conditional's scipe where it's used inside of parseQuery.