Skip to content

Commit

Permalink
Set cluster_name for host logs too if renameFieldsSck is enabled
Browse files Browse the repository at this point in the history
Up to now the cluster_name field was only set in `resource/logs`. This
snippet was only included for the container logs, but not for host logs
(files, journald).

This change moves the cluster_name field to the `resource` snippet,
which is according inline comment used for all things that pass through
otel.

Fixes signalfx#682
  • Loading branch information
vinzent committed Jun 28, 2023
1 parent 3ec2dfc commit b294211
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,6 @@ resource/logs:
- key: container_name
from_attribute: k8s.container.name
action: upsert
- key: cluster_name
from_attribute: k8s.cluster.name
action: upsert
- key: container_id
from_attribute: container.id
action: upsert
Expand All @@ -186,8 +183,6 @@ resource/logs:
{{- if not .Values.splunkPlatform.fieldNameConvention.keepOtelConvention }}
- key: k8s.container.name
action: delete
- key: k8s.cluster.name
action: delete
- key: container.id
action: delete
- key: k8s.pod.name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,15 @@ processors:
key: "{{ .name }}"
value: "{{ .value }}"
{{- end }}
{{- if .Values.splunkPlatform.fieldNameConvention.renameFieldsSck }}
- key: cluster_name
from_attribute: k8s.cluster.name
action: upsert
{{- if not .Values.splunkPlatform.fieldNameConvention.keepOtelConvention }}
- key: k8s.cluster.name
action: delete
{{- end }}
{{- end }}

# Resource attributes specific to the agent itself.
resource/add_agent_k8s:
Expand Down

0 comments on commit b294211

Please sign in to comment.