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

feat: Add config option to filter events based on namespace #278

Closed
wants to merge 5 commits into from

Conversation

MikeGoldsmith
Copy link
Contributor

Which problem is this PR solving?

When deploying the agent in an environment where some apps may already be instrumented and the agent would be duplicating events. It is desireable that some namespaces be omitted from generating events.

This PR adds a configuration option to provide a list of namespaces that will be used as an exclude list. When either the source or destination IP matches a pod or service that is in an excluded namespaces, it is not converted into a libhoney event.

Short description of the changes

  • Add config option to hold lookup map of namespaces that is populated from the NAMESPACES env var built from a comma separated list
  • Extend the liboney event handler to check whether it should send the event by looking up the asscociated resource namespace
  • Update README with new config option
  • Add unit tests for config and libhoney handler

How to verify that this has the expected result

It's now possible to provide a list of namespaces that will be used ignore events when the event's source or destination resource is in that namespace.

@MikeGoldsmith MikeGoldsmith added the type: enhancement New feature or request label Oct 11, 2023
@MikeGoldsmith MikeGoldsmith self-assigned this Oct 11, 2023
@MikeGoldsmith MikeGoldsmith requested a review from a team October 11, 2023 16:41
@robbkidd
Copy link
Member

@MikeGoldsmith and I were talking about this out-of-band. We suspect we don't yet know in what specific cases users would want to omit traffic to/from a namespace.

Should the filter only exclude traffic where both the source and destination are k8s resources within excluded namespaces?

@MikeGoldsmith
Copy link
Contributor Author

Closing while we work out what traffic we want to omit when a namespace matches. This could be re-opened or a new one using this as the basis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Configurable capture filter based on k8s pod and/or namespace?
2 participants