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

Fixes Nested Tags Search Error #4651

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pmuls99
Copy link
Contributor

@pmuls99 pmuls99 commented Aug 12, 2023

Which problem is this PR solving?

Description of the changes

  • Added AllTagsAsFields in the SpanReader Object
  • Seperated the Query Creation for Nested tags and Nested logs

@pmuls99 pmuls99 requested a review from a team as a code owner August 12, 2023 12:57
@codecov
Copy link

codecov bot commented Aug 12, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (5b9e7e1) 97.06% compared to head (db2245e) 97.07%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4651   +/-   ##
=======================================
  Coverage   97.06%   97.07%           
=======================================
  Files         301      301           
  Lines       17878    17884    +6     
=======================================
+ Hits        17354    17361    +7     
+ Misses        420      419    -1     
  Partials      104      104           
Flag Coverage Δ
unittests 97.07% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
plugin/storage/es/factory.go 97.67% <100.00%> (+0.01%) ⬆️
plugin/storage/es/spanstore/reader.go 100.00% <100.00%> (ø)

... and 3 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: bugslayer-332 <ayashwanth9503@gmail.com>
@pmuls99
Copy link
Contributor Author

pmuls99 commented Aug 12, 2023

@yurishkuro , as discussed in #3900 , I have raised this PR. Could you please take a look and give pointers on improvement?

@pmuls99 pmuls99 changed the title [WIP] Fixes Nested Tags Search Error Fixes Nested Tags Search Error Aug 13, 2023
}
// Nested Logs Query
Copy link
Member

Choose a reason for hiding this comment

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

explain why this is separate?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So we had all the nested fields query together initally (tags , process tags , logs) . When we set AllTagsAsFields as true , we still want to query the nested logs field.

Copy link
Member

Choose a reason for hiding this comment

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

is it because with AllTagsAsFields=true the tags from logs are still written as nested? Then how does this fix prevent the reported issue? When a span has no logs, it has no tags:[] in the document, but the query would still be looking for that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, when AllTagsAsFields is true, logs are written as nested field. Arent logs and tags two independent fields in span context ? The change that I made does not search in the tags field and the process.tags field when allTagsAsFields is true. The reported issue said that they had a different mapping configuration than the jaeger default configuration and hence it never populated the tags field.

Copy link
Member

Choose a reason for hiding this comment

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

that's my point - we should have a test that reproduces the reported issue in the first place (maybe as a new integration test), before we try fixing it. Otherwise how do you know that these changes are fixing it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, I understand that. Its however redundant to query the tags field when all tags as fields is true. I will work on the integration test!

@@ -168,6 +168,7 @@ func (s *ESStorageIntegration) initSpanstore(allTagsAsFields, archive bool) erro
IndexPrefix: indexPrefix,
MaxSpanAge: maxSpanAge,
TagDotReplacement: tagKeyDeDotChar,
AllTagsAsFields: allTagsAsFields,
Copy link
Member

Choose a reason for hiding this comment

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

can there be a test that validates this new behavior?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The integration tests were strong and gave the expected behaviour. I can add the unit tests.

Copy link
Member

Choose a reason for hiding this comment

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

but those tests didn't catch the issue reported by user?

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.

[Bug]: Jaeger Query Tags Search Causes Nested Search Error
3 participants