-
Notifications
You must be signed in to change notification settings - Fork 526
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
feat: include unscoped queries and default the batch size to 7 #4436
base: main
Are you sure you want to change the base?
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.
Looks good but the new manifest check has been merged so I think you'll need to rebase on main and run `make generate-manifest``
@@ -114,12 +114,17 @@ func (c weightRequestWare) setTraceQLWeight(req Request) { | |||
if c.Op != traceql.OpNone { | |||
conditions++ | |||
} | |||
|
|||
if c.Attribute.Intrinsic == traceql.IntrinsicNone && c.Attribute.Scope == traceql.AttributeScopeNone { |
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.
what are we trying to catch here?
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.
oh, you are looking for unscoped attributes. it may be safer to test spanRequest.AllConditions
at the bottom?
i'm fine with this, but perhaps do a bit of testing before we merge?
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 you mean something like?:
if heavyQuery && !spanRequest.AllConditions{
req.SetWeight(c.weights.TraceQLSearchWeight + 1)
}
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.
apologies, i meant to edit this comment and got sidetracked. AllConditions
will only be true if its a single spanset selector will all conditions &&
'ed. It will be true even with unscoped attributes, so it will be true on both of these:
{ span.foo = "bar" && resource.baz = "bat" }
{ .foo = "bar" && .baz = "bat" }
If AllConditions is false -OR- there are unscoped attributes the querier is a heavier query b/c it cannot be evaluated in the fetch layer and requires the engine.
It's possible that both unscoped attributes and AllConditions false should result in TraceQLSerachWeight + 1
but would need some testing.
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.
good with the change. needs a changelog and a quick test to confirm that the unscoped attributes change is a winner
@@ -114,12 +114,17 @@ func (c weightRequestWare) setTraceQLWeight(req Request) { | |||
if c.Op != traceql.OpNone { | |||
conditions++ | |||
} | |||
|
|||
if c.Attribute.Intrinsic == traceql.IntrinsicNone && c.Attribute.Scope == traceql.AttributeScopeNone { |
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.
oh, you are looking for unscoped attributes. it may be safer to test spanRequest.AllConditions
at the bottom?
i'm fine with this, but perhaps do a bit of testing before we merge?
Does this impact configuration or how a user would run queries? In other words, are there any changes in this PR that would impact how a user interacts or configures Tempo? If so, we should consider updating the docs. |
What this PR does:
It checks for unscoped attributes to weigh the request.
It sets the default batch size to 7. Our tests have proved that a batch size of less than 7 in combination with weighted requests introduces a latency penalty due to contention.
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]