-
Notifications
You must be signed in to change notification settings - Fork 64
Tracing: enable tracing for main query execution steps #544
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
base: main
Are you sure you want to change the base?
Tracing: enable tracing for main query execution steps #544
Conversation
b9faa50
to
393e6f9
Compare
6bfdf1c
to
a595f5c
Compare
Signed-off-by: Pedro Tanaka <[email protected]> fixing go mods and docs Signed-off-by: Pedro Tanaka <[email protected]> move docs to go package Signed-off-by: Pedro Tanaka <[email protected]>
Signed-off-by: Pedro Tanaka <[email protected]>
9155080
to
0fd592d
Compare
Signed-off-by: Pedro Tanaka <[email protected]> appease linter Signed-off-by: Pedro Tanaka <[email protected]>
0fd592d
to
708a108
Compare
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.
Thanks for the great work! Left some minor comments.
As a next step, should the time taken in each operator be measured?
@@ -237,14 +248,21 @@ type Engine struct { | |||
} | |||
|
|||
func (e *Engine) MakeInstantQuery(ctx context.Context, q storage.Queryable, opts *QueryOpts, qs string, ts time.Time) (promql.Query, error) { | |||
span, ctx := tracing.StartSpanFromContext(ctx, "engine.MakeInstantQuery") | |||
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.
Do we expect the engine to take a lot of time before query execution phase? Does these spans add value?
defer span.Finish() | ||
span.SetTag("query_type", q.t.String()) | ||
span.SetTag("query_string", q.String()) | ||
if q.t == RangeQuery { |
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.
nit: Should we just set start=end and step=0 for instant query?
Summary
Adding tracing to some steps inside the engine so we can get better visibility into where we spend time. Had to duplicate some code from Thanos to avoid cyclic dependency.
This is what a trace will look like: