-
Notifications
You must be signed in to change notification settings - Fork 460
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
Add trace span for time spent lazily loading index-header in store-gateway #6922
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.
LGTM. My only concern is the number of spans we're going to be adding to a typical request since we're already running into trace size limits in some cases. I suppose this shouldn't be too bad in practice since we only add a span when doing lazy loading which is infrequent. WDYT?
That was my assumption too, so I'm not expecting this to be particularly impactful. |
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.
before the store-gateway starts serving a request it creates an index header reader. This happens here
mimir/pkg/storegateway/bucket.go
Lines 1923 to 1924 in 0a7eb89
// Call IndexVersion to lazy load the index header if it lazy-loaded. | |
_, _ = b.indexHeaderReader.IndexVersion() |
the idea was to trigger a method of the index header reader that will load it before starting to use it for general-purpose operations.
I suspect that this is the only place which may load an index header and we might not need all these extra context args.
Sorry, might have been a little too enthusiastic merging this before you had a chance to review it @dimitarvdimitrov. Would you like me to revert this and explore an alternative approach? |
I think that would keep the interfaces slightly simpler and still achieve the same. Sorry for not reviewing it on the day. |
I've reverted this change in #7065 - would you be able to take a look @dimitarvdimitrov? |
What this PR does
This PR adds further information to trace spans emitted by store-gateways while lazily loading an index-header.
I'd suggest reviewing the commits separately - the first introduces a
context.Context
argument to the methods on theindexheader.Reader
interface, and the second adds the trace span.Which issue(s) this PR fixes or relates to
(none)
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]
.about-versioning.md
updated with experimental features.