[receiver/k8sobjectsreceiver]: support exclude_namespaces to exclude namespace from being watched#41440
Conversation
|
Please add a changelog and check the CI |
|
@atoulme Thanks, added the required file for changelog |
|
I am not a maintainer or anything, so my opinion carries little weight. But I think the name Edit: Other components, like the filelog receiver, seem to use the include/exclude naming pattern. So how about |
|
I agree with @ChristianCiach. Please also use https://github.com/open-telemetry/opentelemetry-collector/blob/main/filter/config.go. So the user config could be |
|
Moving to draft while you address the feedback - please mark ready to review once done. |
|
hey @dmitryax, i have addressed you comments, thanks! |
|
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
|
Not stale |
|
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
|
not stale, i will rebase in the next 2 days probably |
Signed-off-by: AvivGuiser <avivguiser@gmail.com>
…_namespaces Signed-off-by: AvivGuiser <avivguiser@gmail.com>
Signed-off-by: AvivGuiser <avivguiser@gmail.com>
Signed-off-by: AvivGuiser <avivguiser@gmail.com>
…type Signed-off-by: AvivGuiser <avivguiser@gmail.com>
Signed-off-by: AvivGuiser <avivguiser@gmail.com>
Signed-off-by: AvivGuiser <avivguiser@gmail.com>
Signed-off-by: AvivGuiser <avivguiser@gmail.com>
Co-authored-by: Christos Markou <chrismarkou92@gmail.com>
Signed-off-by: AvivGuiser <avivguiser@gmail.com>
Signed-off-by: AvivGuiser <avivguiser@gmail.com>
Signed-off-by: AvivGuiser <avivguiser@gmail.com>
Signed-off-by: AvivGuiser <avivguiser@gmail.com>
Signed-off-by: AvivGuiser <avivguiser@gmail.com>
Signed-off-by: AvivGuiser <avivguiser@gmail.com>
Signed-off-by: AvivGuiser <avivguiser@gmail.com>
Signed-off-by: AvivGuiser <avivguiser@gmail.com>
Signed-off-by: AvivGuiser <avivguiser@gmail.com>
Signed-off-by: AvivGuiser <avivguiser@gmail.com>
|
/rerun |
|
Thank you for your contribution @KyriosGN0! 🎉 We would like to hear from you about your experience contributing to OpenTelemetry by taking a few minutes to fill out this survey. If you are getting started contributing, you can also join the CNCF Slack channel #opentelemetry-new-contributors to ask for guidance and get help. |
|
Hey, there is an ongoing refactoring of this component and some of the functionality was moved to internal/k8sinventory with this PR. Would you @KyriosGN0 b interested in adapting the internal library as well and afterwards using the adapted internal code in the k8sobjectsreceiver? There is an already PR with adapted code using the k8sinventory lib (without your changes) here. I would gladly step back from the PR in case you would be interested in bringing it to the line. Thanks! |
hey @odubajDT this sounds really interesting, but i don't have the bandwith for that right now |
Description
This PR introduces a new parameter to the receiver config, called
ignore_namespacesits array of string that specify which namespaces should be excluded from being watched at all (can be a regex expression)the option in my opinion should not be used together with the
Namespacesoption, as one is allowlist and the other is denylistLink to tracking issue
Fixes #36217
Testing
ran a kind cluster, deployed otel collector configured with this receiver and a debug exporter, created pods in a namespace that is in the deny list and saw that they are not being pulled/watched and that pods in other namespaces are pulled/watched