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

Implement namespace/multi-account filter for Event Logs from the Singleton collector (k8seventreceiver) #109

Closed
tvalchev2 opened this issue Jan 24, 2024 · 2 comments · Fixed by #127
Assignees
Labels
enhancement New feature or request helm Everything regarding the Helm chart

Comments

@tvalchev2
Copy link

Summary

We want to enable our customers and partners to be able to use NewRelic for troubleshooting purposes. That is part of our deployment observability strategy.
Therefore we need them to be able to see kubernetes Events coming from their namespaces. At the moment the Events are being sent only to the "opsteam" NR account.

Desired Behavior

We want the namespace specific events to also land in the corresponding NR Accounts. This means there should be also a working filter processor for the SNG collector, which splits and sends the events as logs to the corresponding NewRelic accounts (i.e. team1 account should get the Team1 eventlogs into their own NR account from the defined namespaces under team1)

Possible Solution

I really think this should be possible, as according to opentelemetry namespace should be added as a log attribute meanwhile: open-telemetry/opentelemetry-collector-contrib#23991 (comment)

This means it should be able to adapt a filter processor in a way, that it works similar to the statefulset collector, which also filters and splits the Logs based on the namespace attribute.

From what I understand the namespace is appended to the LogRecords attributes as semconv.AttributeK8SNamespaceName:
https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/d5b99206aea1612ede64b1a60b9b0678561ccc1a/receiver/k8seventsreceiver/k8s_event_to_logdata.go#L74

Maybe this means that the namespace should not be obtained from k8s.namespace.name but there should nonetheless be possible to enrich the event Logs data with the namespace attribute, so that it can be exported to multiple accounts based on it.

@tvalchev2 tvalchev2 added the enhancement New feature or request label Jan 24, 2024
@utr1903 utr1903 self-assigned this Apr 15, 2024
@utr1903
Copy link
Contributor

utr1903 commented Apr 15, 2024

@tvalchev2 Within the OTel contrib repo, the issue 32369 explained where the problem is... Such a rookie mistake. Adding the functionality immediately!

@utr1903 utr1903 added the helm Everything regarding the Helm chart label Apr 15, 2024
@utr1903 utr1903 linked a pull request Apr 15, 2024 that will close this issue
@utr1903
Copy link
Contributor

utr1903 commented Apr 15, 2024

Implemented with #127.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request helm Everything regarding the Helm chart
Projects
2 participants