-
Notifications
You must be signed in to change notification settings - Fork 492
[Kernel scoping 3/5] Add selectors to tracepoint deployment #1686
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
Conversation
e447b07 to
a7f6699
Compare
Signed-off-by: Benjamin Kilimnik <bkilimnik@pixielabs.ai>
a7f6699 to
4ceff57
Compare
ddelnano
left a comment
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.
A few minor comments, but otherwise looks good.
src/vizier/services/metadata/controllers/tracepoint/tracepoint.go
Outdated
Show resolved
Hide resolved
src/vizier/services/metadata/controllers/tracepoint/tracepoint.go
Outdated
Show resolved
Hide resolved
| agentIDs := make([]uuid.UUID, len(validAgentsForProgram)) | ||
| for i, agt := range validAgentsForProgram { | ||
| agentIDs[i] = utils.UUIDFromProtoOrNil(agt.Info.AgentID) | ||
| } |
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.
Instead of creating this agentdIDs slice twice (line 403 and here), what if we made agentsHashToAgents a make(map[string][]struct{*agentpb.Agent, uuid.UUID}). That would avoid looping over it a second time and duplicating the UUID conversion.
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.
Added!
…rror case to parseKernelVersion, remove comment Signed-off-by: Benjamin Kilimnik <bkilimnik@pixielabs.ai>
Signed-off-by: Benjamin Kilimnik <bkilimnik@pixielabs.ai>
| agentIDs := validAgentsForProgram.AgentIDs | ||
| for i, agt := range validAgentsForProgram.Agents { | ||
| agentIDs[i] = utils.UUIDFromProtoOrNil(agt.Info.AgentID) | ||
| } | ||
|
|
||
| err = m.agtMgr.MessageAgents(agentIDs, msg) |
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.
Isn't this for loop redundant now? I was hoping we would be able to remove it entirely and write the following:
err = m.agtMgr.MessageAgents(validAgentsForProgram.AgentIDs, msg)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 sorry, I forgot to remove that loop. Should be fixed now.
Signed-off-by: Benjamin Kilimnik <bkilimnik@pixielabs.ai>
Signed-off-by: Benjamin Kilimnik <bkilimnik@pixielabs.ai>
|
@pixie-io/maintainers this is ready for review now. |
Summary: Adds selectors to
TracepointDeploymentand modifies query broker to deploy tracepoints only to agents with matching selectors. Currently intended to fix #1582, but can capture other restrictions (OS version etc.) in the future.Related issues: #1582 #1659
Type of change: /kind feature
Test Plan: Tested all existing targets and tested selection based on kernel version in
src/vizier/services/metadata/controllers/tracepoint/tracepoint_test.go