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

Ingest cluster receiver events into index defined in annotation #1481

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

pszkamruk-splunk
Copy link
Contributor

Description:
Ingest cluster receiver events into index defined in annotation

Link to Splunk idea:

Testing: Tested manually

Documentation:

@pszkamruk-splunk pszkamruk-splunk requested review from a team as code owners October 1, 2024 13:46
@@ -73,6 +73,7 @@ receivers:
{{- end }}

processors:
{{- include "splunk-otel-collector.k8sClusterReceiverAttributesProcessor" . | nindent 2 }}
Copy link
Contributor

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:
Copy link
Contributor

@jvoravong jvoravong Oct 10, 2024

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.

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

Successfully merging this pull request may close these issues.

2 participants