Skip to content
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

Don't add k8s metadata for agent's own events #244

Closed
JamieDanielson opened this issue Sep 26, 2023 · 0 comments · Fixed by #260
Closed

Don't add k8s metadata for agent's own events #244

JamieDanielson opened this issue Sep 26, 2023 · 0 comments · Fixed by #260
Labels
type: enhancement New feature or request
Milestone

Comments

@JamieDanielson
Copy link
Contributor

JamieDanielson commented Sep 26, 2023

k8s pod name is sometimes wrong for the IP - looks like it's related to hostnetwork:true so it's not easy to exclude those events entirely from telemetry, but we can remove k8s metadata from those events.

          To consider as an intermediate: don't add k8s metadata to these events.

Originally posted by @JamieDanielson in #240 (comment)

@JamieDanielson JamieDanielson added the type: enhancement New feature or request label Sep 26, 2023
@vreynolds vreynolds added this to the Pre beta milestone Sep 26, 2023
@MikeGoldsmith MikeGoldsmith changed the title don't add k8s metadata for agent's own events Don't add k8s metadata for agent's own events Oct 2, 2023
MikeGoldsmith added a commit that referenced this issue Oct 3, 2023
…nt IP (#260)

## Which problem is this PR solving?
When processing events, the agent tries to lookup the source and
destination IPs in the list of cached k8s pods. However, because the
agent uses host network, the agent gets the same IP as the node and any
other pods who also use host networking which leads to inconsistent
results.

This PR updates event processing to not lookup pod attributes if the
source or destination IP matches the agent IP.

- Closes #244

## Short description of the changes
- Move cached client utils functions onto the cached client as member
funcs
- Update GetAttr* funcs to also take agent IP
- Return from getting attributes early if pod IP and agent IP match
- Add unit test to verify behaviour

## How to verify that this has the expected result
When processing an event when the source or dest IPs match the agent IP,
k8s attributes are no longer added.

---------

Co-authored-by: Jamie Danielson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
2 participants