Skip to content

Commit

Permalink
Set cluster_name for host logs too if renameFieldsSck is enabled (#837)
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 #682
  • Loading branch information
vinzent authored Jun 29, 2023
1 parent 3ec2dfc commit 70fb9d3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## Unreleased

### Fixed

- Set cluster_name for host logs too if renameFieldsSck is enabled [#837](https://github.com/signalfx/splunk-otel-collector-chart/pull/837)

### Added

- Update PodDisruptionBudgets API version to allow both `policy/v1beta1` and `policy/v1` [#835](https://github.com/signalfx/splunk-otel-collector-chart/pull/835)
Expand Down
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 70fb9d3

Please sign in to comment.