-
Notifications
You must be signed in to change notification settings - Fork 1
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
Configurable capture filter based on k8s pod and/or namespace? #188
Comments
Probably easiest to start with something like K8S_NAMESPACE_LIST/FILTER, where a list of namespaces can be provided that, to start, are excluded. And then we can add an option that the list is either for include or exclude. The purpose of this agent is to tell you about everything, and maybe things you don't even know about. If for security reasons or because the telemetry is unnecessary for some namespaces (maybe instrumented with otel already), you can have an exclude list. |
Adding a filter is more complicated than first thought and could be accomplished in two ways, each with pros and cons. CaptureOption 1: BPF filterUse the k8s client to get a list of pod IPs and use to form part of the bpf filter (eg Option 2: Ignore when receiving packetWhen a packet is received from the capture source, lookup the source & destination IPs and decide if we should continue to handle the packet (eg pass into assembler). This is less efficient than option 1 because packets we don't want will still be captured but this is the earliest opportunity we can ignore them and wouldn't need to recompute & apply a bpf filter. Option 3: Drop in event handlerThis is the easiest but least efficient option. The event handler already has access to a complete event and uses the k8s client to lookup additional k8s metadata. Deciding what to dropThe second part of the question is more challenging, what traffic should we drop? There are three types of traffic:
Should we omit traffic when one or both IPs are part of the excluded namespace? Initial PR and comment that make us pause and think before continuing: |
Moving out of beta, we're going to wait for additional feedback before implementing. The following PR can still be used as a reference when we come back to this issue. |
New Option: filter based on pod annotations. |
Is your feature request related to a problem? Please describe.
There may be scenarios where folks only want specific namespaces or pods included in telemetry. This is also an option for limiting resource usage if needed.
The text was updated successfully, but these errors were encountered: