-
Notifications
You must be signed in to change notification settings - Fork 150
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
Ingest cluster receiver events into index defined in annotation #1481
base: main
Are you sure you want to change the base?
Ingest cluster receiver events into index defined in annotation #1481
Conversation
functional_tests/testdata_histogram/expected/v1.29/controller_manager_metrics.yaml
Outdated
Show resolved
Hide resolved
@@ -73,6 +73,7 @@ receivers: | |||
{{- end }} | |||
|
|||
processors: | |||
{{- include "splunk-otel-collector.k8sClusterReceiverAttributesProcessor" . | nindent 2 }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets refactor this a little for a couple reasons. This configurations will always be included even if not used and we could relocate it to be closer to similar configurations like it.
- Move this content to around lines 92-112
- Add conditional clauses appropriately to make this configuration content only included when it is used. Something like this.
{{- if and $clusterReceiver.eventsEnabled (eq (include "splunk-otel-collector.logsEnabled" .) "true") }}
{{- include "splunk-otel-collector.k8sClusterReceiverAttributesProcessor" . | nindent 2 }}
{{- end }}`
@@ -209,6 +209,34 @@ k8sattributes: | |||
{{- include "splunk-otel-collector.addExtraLabels" . | nindent 6 }} | |||
{{- end }} | |||
{{- end }} | |||
{{- define "splunk-otel-collector.k8sClusterReceiverAttributesProcessor" -}} | |||
k8sattributes/clusterReceiver: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're adding this change, we need to address some cleanup and refactor work to prevent code duplication related to setting Kubernetes attributes:
- Remove or replace redundant attribute setting: We should clean up any attributes set using the previous method that will now be handled by the k8sattributes processor. Try to only set the k8s attributes using one processor.
- Clean up unused environment variables: The environment variables in the cluster receiver deployment that are no longer used to set attributes the old way should also be removed.
Description:
Ingest cluster receiver events into index defined in annotation
Link to Splunk idea:
Testing: Tested manually
Documentation: