Skip to content

Remove resourcedetector from cluster receiver event/object#2369

Draft
jinja2 wants to merge 2 commits intomainfrom
fix/cluster-receiver-event-resourcedetection
Draft

Remove resourcedetector from cluster receiver event/object#2369
jinja2 wants to merge 2 commits intomainfrom
fix/cluster-receiver-event-resourcedetection

Conversation

@jinja2
Copy link
Copy Markdown
Collaborator

@jinja2 jinja2 commented Apr 11, 2026

*Description:

The logs (k8s_events), logs/objects, and logs/events pipelines in the cluster receiver were using the full resourcedetection processor, which adds host-level attributes (host.id, host.name, cloud.provider, etc.). These pipelines carry cluster-scoped data where host identity is the cluster receiver pod, not the source of the event.

Align with the metrics pipeline which correctly uses only resourcedetection/k8s_cluster_name for auto-detect distributions.

…lines

The logs (k8s_events), logs/objects, and logs/events pipelines in the
cluster receiver were using the full resourcedetection processor, which
adds host-level attributes (host.id, host.name, cloud.provider, etc.).
These pipelines carry cluster-scoped data where host identity is the
cluster receiver pod, not the source of the event — making those
attributes misleading.

Align with the metrics pipeline which correctly uses only
resourcedetection/k8s_cluster_name for auto-detect distributions.
@jinja2 jinja2 requested review from a team as code owners April 11, 2026 03:42
Copilot AI review requested due to automatic review settings April 11, 2026 03:42
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aligns the cluster receiver’s cluster-scoped log pipelines (k8s events, smartagent events, and k8s objects) with the existing metrics approach by removing the full resourcedetection processor (which injects host-/node-level attributes) and using only resourcedetection/k8s_cluster_name when cluster name auto-detection is enabled.

Changes:

  • Update cluster receiver log pipelines to conditionally use resourcedetection/k8s_cluster_name (and stop using full resourcedetection) for cluster-scoped telemetry.
  • Expand/adjust Helm unit tests to assert the exact processor wiring (including the “explicit clusterName disables autodetect” case) and add guard/inventory coverage for related pipelines.
  • Regenerate example rendered manifests and add a changelog entry documenting the bug fix.

Reviewed changes

Copilot reviewed 39 out of 39 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
unittests/resource_detection_test.yaml Updates and expands unit tests to ensure cluster receiver log pipelines use only resourcedetection/k8s_cluster_name (or neither when clusterName is explicit).
helm-charts/splunk-otel-collector/templates/config/_otel-k8s-cluster-receiver-config.tpl Changes cluster receiver log pipeline processor lists to remove full resourcedetection and conditionally add resourcedetection/k8s_cluster_name.
examples/splunk-platform-with-sourcetypes/rendered_manifests/deployment-cluster-receiver.yaml Regenerated example output (config checksum updated).
examples/splunk-platform-with-sourcetypes/rendered_manifests/configmap-cluster-receiver.yaml Regenerated example output reflecting removal of full resourcedetection from relevant pipelines.
examples/splunk-enterprise-index-routing/rendered_manifests/deployment-cluster-receiver.yaml Regenerated example output (config checksum updated).
examples/splunk-enterprise-index-routing/rendered_manifests/configmap-cluster-receiver.yaml Regenerated example output reflecting removal of full resourcedetection from relevant pipelines.
examples/secret-validation/rendered_manifests/deployment-cluster-receiver.yaml Regenerated example output (config checksum updated).
examples/secret-validation/rendered_manifests/configmap-cluster-receiver.yaml Regenerated example output reflecting removal of full resourcedetection from relevant pipelines.
examples/only-logs-with-extra-file-logs/rendered_manifests/deployment-cluster-receiver.yaml Regenerated example output (config checksum updated).
examples/only-logs-with-extra-file-logs/rendered_manifests/configmap-cluster-receiver.yaml Regenerated example output reflecting removal of full resourcedetection from relevant pipelines.
examples/multiline-logs/rendered_manifests/deployment-cluster-receiver.yaml Regenerated example output (config checksum updated).
examples/multiline-logs/rendered_manifests/configmap-cluster-receiver.yaml Regenerated example output reflecting removal of full resourcedetection from relevant pipelines.
examples/multi-metrics/rendered_manifests/deployment-cluster-receiver.yaml Regenerated example output (config checksum updated).
examples/multi-metrics/rendered_manifests/configmap-cluster-receiver.yaml Regenerated example output reflecting removal of full resourcedetection from relevant pipelines.
examples/kubernetes-windows-nodes/rendered_manifests/deployment-cluster-receiver.yaml Regenerated example output (config checksum updated).
examples/kubernetes-windows-nodes/rendered_manifests/configmap-cluster-receiver.yaml Regenerated example output reflecting removal of full resourcedetection from relevant pipelines.
examples/k8s-events-o11y-pipeline/rendered_manifests/deployment-cluster-receiver.yaml Regenerated example output (config checksum updated).
examples/k8s-events-o11y-pipeline/rendered_manifests/configmap-cluster-receiver.yaml Regenerated example output reflecting removal of full resourcedetection from relevant pipelines.
examples/host-journalctl-logs/rendered_manifests/deployment-cluster-receiver.yaml Regenerated example output (config checksum updated).
examples/host-journalctl-logs/rendered_manifests/configmap-cluster-receiver.yaml Regenerated example output reflecting removal of full resourcedetection from relevant pipelines.
examples/histograms-with-splunk-platform/rendered_manifests/deployment-cluster-receiver.yaml Regenerated example output (config checksum updated).
examples/histograms-with-splunk-platform/rendered_manifests/configmap-cluster-receiver.yaml Regenerated example output reflecting removal of full resourcedetection from relevant pipelines.
examples/histograms-disabled/rendered_manifests/deployment-cluster-receiver.yaml Regenerated example output (config checksum updated).
examples/histograms-disabled/rendered_manifests/configmap-cluster-receiver.yaml Regenerated example output reflecting removal of full resourcedetection from relevant pipelines.
examples/enable-persistence-queue/rendered_manifests/deployment-cluster-receiver.yaml Regenerated example output (config checksum updated).
examples/enable-persistence-queue/rendered_manifests/configmap-cluster-receiver.yaml Regenerated example output reflecting removal of full resourcedetection from relevant pipelines.
examples/enable-operator-and-auto-instrumentation/rendered_manifests/deployment-cluster-receiver.yaml Regenerated example output (config checksum updated).
examples/enable-operator-and-auto-instrumentation/rendered_manifests/configmap-cluster-receiver.yaml Regenerated example output reflecting removal of full resourcedetection from relevant pipelines.
examples/disable-persistence-queue-traces/rendered_manifests/deployment-cluster-receiver.yaml Regenerated example output (config checksum updated).
examples/disable-persistence-queue-traces/rendered_manifests/configmap-cluster-receiver.yaml Regenerated example output reflecting removal of full resourcedetection from relevant pipelines.
examples/collector-cluster-receiver-only/rendered_manifests/deployment-cluster-receiver.yaml Regenerated example output (config checksum updated).
examples/collector-cluster-receiver-only/rendered_manifests/configmap-cluster-receiver.yaml Regenerated example output reflecting removal of full resourcedetection from relevant pipelines.
examples/autodetect-istio/rendered_manifests/deployment-cluster-receiver.yaml Regenerated example output (config checksum updated).
examples/autodetect-istio/rendered_manifests/configmap-cluster-receiver.yaml Regenerated example output reflecting removal of full resourcedetection from relevant pipelines.
examples/add-kafkametrics-receiver/rendered_manifests/deployment-cluster-receiver.yaml Regenerated example output (config checksum updated).
examples/add-kafkametrics-receiver/rendered_manifests/configmap-cluster-receiver.yaml Regenerated example output reflecting removal of full resourcedetection from relevant pipelines.
examples/add-filter-processor/rendered_manifests/deployment-cluster-receiver.yaml Regenerated example output (config checksum updated).
examples/add-filter-processor/rendered_manifests/configmap-cluster-receiver.yaml Regenerated example output reflecting removal of full resourcedetection from relevant pipelines.
.chloggen/fix-cluster-receiver-event-resourcedetection.yaml Adds a changelog entry documenting the bug fix and rationale.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

*/}}
{{- define "splunk-otel-collector.autoDetectClusterName" -}}
{{- and (include "splunk-otel-collector.clusterNameOptional" .) (not .Values.clusterName) }}
{{- and (eq (include "splunk-otel-collector.clusterNameOptional" .) "true") (not .Values.clusterName) }}
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not directly related to the change but this is a no-op fix. The problem here was how Go templates evaluate truthiness. include returns a string, and in Go templates any non-empty string is truthy. So for distributions like AKS where clusterNameOptional returns "false", the old check would treat it as truthy because "false" is a non-empty string.

In practice, i think we were probably not hitting the issue since we have JSON schema enforcing clusterName for distributions where clusterNameOptional is false.

@jinja2
Copy link
Copy Markdown
Collaborator Author

jinja2 commented Apr 11, 2026

We need to decide on the appropriate host field for logs in Splunk platform

@jinja2 jinja2 marked this pull request as draft April 11, 2026 04:28
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