-
Notifications
You must be signed in to change notification settings - Fork 0
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
Update storage api to support query operations by spanKind #1
Conversation
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.
overall changes look ok-ish, but I still think we should limit the blast raduis and not require filtering logic to be done in the storage, just let it return all ops for a service, and do the filtering in the QueryService only (one place).
Just want to make sure your proposal is for avoiding potential duplicate filtering logic, not for reducing the number of affected files (I assume blast radius means the number of affected files). Because as long as we touch the interface (since spanKind has to be returned in the
Regarding logic duplication, if the storage support filtering in the query statement, then we are not really duplicate the filtering logic in the code. |
My point is that you're increasing the scope by requiring storage to implement filtering, which forces you to change memory storage implementation, for example. If you implement it once in the QueryService then all storage impls benefit automatically, whether they support internal filtering or not (e.g. do you know how to implement query-time filtering in Badger?) but ok, let's do it your way. |
Those storage plugins have to be changed anyway in order to write & read the extra spanKind, they might just as well add the filtering when they make the changes since it's pretty easy to them. I will make the changes in proto and break long lines then push another commit. Btw, I think we might need to keep the following so that old proto users don't need to change their code, otherwise they need to use the corresponding updated get or set method:
IIRC, the backward compatibility when change names only kicks in when you unmarshall saved data into new structure. |
you don't know if it's easy or not, it depends on storage implementation (I wouldn't know how to make Badger return only filtered records). And if you're talking about filtering in Go code, then that's exactly the duplication I am referring to. |
@@ -160,17 +167,14 @@ func TestOperationNamesStorageGetServices(t *testing.T) { | |||
query.On("Iter").Return(iter) | |||
|
|||
s.session.On("Query", mock.AnythingOfType("string"), mock.Anything).Return(query) | |||
services, err := s.storage.GetOperations("service-a") | |||
services, err := s.storage.GetOperations(&spanstore.OperationQueryParameters{ServiceName: "service-a"}) |
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.
Weird, this line of code is within the vertical 120 char line in my local intelliJ, somehow github still shows scroll bar.
579eb60
to
2f52984
Compare
Signed-off-by: Jun Guo <guo0693@gmail.com>
Signed-off-by: Jun Guo <guo0693@gmail.com>
Signed-off-by: Jun Guo <guo0693@gmail.com>
I need to reopen the PR with same changes against master since jaegertracing#1921-2 is merged |
Which problem is this PR solving?
Short description of the changes