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

Query path - Add exhaustive search to combine traces split across blocks #489

Merged
merged 7 commits into from
Feb 5, 2021

Conversation

annanay25
Copy link
Contributor

@annanay25 annanay25 commented Jan 29, 2021

What this PR does:
Add exhaustive search at the querier to go through all blocks and combine traces.
Involves changes

  • to pool.RunJobs() to not stop after the first hit
  • and at the querier to search backend blocks even if a trace is found in an ingester

Which issue(s) this PR fixes:
Fixes #407

Checklist

  • Tests updated
  • NA Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Signed-off-by: Annanay <annanayagarwal@gmail.com>
Signed-off-by: Annanay <annanayagarwal@gmail.com>
Signed-off-by: Annanay <annanayagarwal@gmail.com>
if i == 0 {
continue
}
partialTraces[0], err = tempo_util.CombineTraces(partialTraces[0], partialTraces[i])
Copy link
Contributor

Choose a reason for hiding this comment

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

This will unmarshal/marshal the trace repeatedly for every partial. It would be more efficient use CombineTraceProtos. Probably not significant in practice (low likelihood).

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I agree with this. Let's have store.Find return a slice of all objects it finds. Then the querier can marshal each to proto once and combine.

Copy link
Contributor

@mdisibio mdisibio Feb 1, 2021

Choose a reason for hiding this comment

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

Created a variadic version of CombineTraces which I think is what we need here: https://github.com/mdisibio/tempo/blob/combinetracesv/pkg/util/trace.go#L17 This preserves all the error handling/logic of the current function, rather that doing it here in the Find method.

I will say it's a little complicated, as it preserves all edge cases and error messages in CombineTraces. Specifically, if all bytes are identical then we don't even attempt to unmarshal, and the error message is different if none of the byte slices were unmarshalled successfully. If we feel good about this method and relax these conditions, we could simplify things.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm going to go ahead with the current function signature in this PR to avoid including too many changes, but I agree that we need this @mdisibio. I'll work on it in a follow up PR.

Copy link
Member

@joe-elliott joe-elliott left a comment

Choose a reason for hiding this comment

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

Added some thoughts. Shouldn't there be other places with RunJobs? I'm only seeing one place you changed.

The places @mdisibio is currently removing in his PR?

modules/querier/querier.go Outdated Show resolved Hide resolved
if i == 0 {
continue
}
partialTraces[0], err = tempo_util.CombineTraces(partialTraces[0], partialTraces[i])
Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I agree with this. Let's have store.Find return a slice of all objects it finds. Then the querier can marshal each to proto once and combine.

tempodb/pool/pool.go Outdated Show resolved Hide resolved
Signed-off-by: Annanay <annanayagarwal@gmail.com>
@annanay25 annanay25 marked this pull request as ready for review February 3, 2021 07:37
Signed-off-by: Annanay <annanayagarwal@gmail.com>
Signed-off-by: Annanay <annanayagarwal@gmail.com>
Copy link
Member

@joe-elliott joe-elliott left a comment

Choose a reason for hiding this comment

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

one small comment, but looks good. let's go!

modules/querier/querier.go Show resolved Hide resolved
Signed-off-by: Annanay <annanayagarwal@gmail.com>
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.

Appending spans to flushed traces
3 participants