Skip to content

Conversation

@benkilimnik
Copy link
Member

@benkilimnik benkilimnik commented Aug 28, 2023

Summary: Adds selectors to TracepointDeployment and 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

@benkilimnik benkilimnik changed the title [Kernel scoping 3/5] Add selectors to tracepoint deployment (#1659, #1582) [Kernel scoping 3/5] Add selectors to tracepoint deployment Aug 28, 2023
@benkilimnik benkilimnik requested review from a team August 28, 2023 19:05
Signed-off-by: Benjamin Kilimnik <bkilimnik@pixielabs.ai>
Copy link
Member

@ddelnano ddelnano left a 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.

Comment on lines 440 to 443
agentIDs := make([]uuid.UUID, len(validAgentsForProgram))
for i, agt := range validAgentsForProgram {
agentIDs[i] = utils.UUIDFromProtoOrNil(agt.Info.AgentID)
}
Copy link
Member

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.

Copy link
Member Author

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>
Comment on lines 448 to 453
agentIDs := validAgentsForProgram.AgentIDs
for i, agt := range validAgentsForProgram.Agents {
agentIDs[i] = utils.UUIDFromProtoOrNil(agt.Info.AgentID)
}

err = m.agtMgr.MessageAgents(agentIDs, msg)
Copy link
Member

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)

Copy link
Member Author

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>
@ddelnano
Copy link
Member

@pixie-io/maintainers this is ready for review now.

@JamesMBartlett JamesMBartlett merged commit 5db3fe6 into pixie-io:main Sep 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

px/tcp_drops pxl script broken due to missing tcp_drop kprobe

3 participants