-
Notifications
You must be signed in to change notification settings - Fork 569
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
Distributor: small tracing improvements #8613
base: main
Are you sure you want to change the base?
Conversation
span, ctx := opentracing.StartSpanFromContext(ctx, "Distributor.sendWriteRequestToIngesters") | ||
span.SetTag("write.series", len(req.Timeseries)) | ||
defer span.Finish() |
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.
The functions inside ring.DoBatchWithOptions
here do some funky dancing with the context (note the remoteRequestContext
). Are you sure this span will be linked as the parent of those that are created down the c.Push
calls below?
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.
That's a good call-out, but I think the code I wrote is ok.
remoteRequestContext()
creates a child context of ctx
so things ought to look OK in the trace viewer.
And remoteRequestContext()
is intended to be called once the first call is ready, so we don't want to do it at the beginning of this function.
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.
Only to double-check: looking at an example of a trace below 👇 I believe, the changes here will put the new Distributor.sendWriteRequestToIngesters
span to be parallel to GEM's Distributor.biPushWrapper
and the first /cortex.Ingester/Push
(i.e. won't make the /cortex.Ingester/Push
spans the children of the sendWriteRequestToIngesters
span).
Is this still fine? Because this seems going against to what you mentioned in the description ("This helps to group potentially hundreds of spans when viewing a trace")

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.
Probably best not to discuss GEM in the public repo, but I am removing that span in the PR you can see linked.
Add spans for sending to ingesters and partitions. This helps to group potentially hundreds of spans when viewing a trace. Also break out the number of histograms and put that as a tag on the trace; it can be of interest.
986b224
to
a513435
Compare
The CHANGELOG has just been cut to prepare for the next release. Please rebase |
What this PR does
Add spans for sending to ingesters and partitions. This helps to group potentially hundreds of spans when viewing a trace.
Also break out the number of histograms and put that as a tag on the trace; it can be of interest.
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]
.about-versioning.md
updated with experimental features.