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.
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
#4147 added
tenant_id
tag to tracing spans #4186#4147 added
tenant_id
tag to tracing spans #4186Changes from 5 commits
3a3cb4b
acef697
f3c5648
4865018
3ff0b80
1d15a71
669b8d2
f0fb3bd
aed8dab
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
I think it would make sense to create a span during the creation of the queriers and the finish the span once
Close()
of the resulting mergeQuerier is called.I have played with that here:
6ebd273
That's how that looks like:

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 feels at least like it can group the same tenants nicely together. Obvisouly for a real fix we need context propagation as a part of LabelValues,LabelName, Select.
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.
yes, it will help to group spans by tenant_id . thanks, i will implement it
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.
however, it might confuse a little bit because all spans

mergeQuerier.NewQuerier
will take almost similar time for each tenant. but inside this span we will see real picture.in current implementation it looks less confusing, i think.
what do you think?
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.
To be honest I agree partly with your point, but I am not too sure, how to fix this properly.
I guess part of the problem is that the a query is only finished once
Close()
is called, which happens at the same time for underlying queriers.I think the most confusing part of not grouping spans by tenant_id is seeing all (and even unrelated) spans together. I think until we implement context passing in those methods, we won't be able to solve that properly.
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.
You could instantiate the queriers (call the callback inside LabelValues, etc.) and the right context will be applied.