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

Extract container.image.tag attribute from container.image.name #285

Merged
merged 2 commits into from
Nov 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

- Field name compatibility for SCK (#258)

### Changed

- Extract `container.image.tag` attribute from `container.image.name` (#285)

### Removed

- Busybox image dependency (#275)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,21 @@ processors:
key: {{ .name }}
value: {{ .value }}
{{- end }}
# Extract "container.image.tag" attribute from "container.image.name" here until k8scluster
# receiver does it natively.
- key: container.image.name
pattern: ^(?P<temp_container_image_name>[^\:]+)(?:\:(?P<temp_container_image_tag>.*))?
action: extract
- key: container.image.name
from_attribute: temp_container_image_name
action: upsert
- key: temp_container_image_name
action: delete
- key: container.image.tag
from_attribute: temp_container_image_tag
action: upsert
- key: temp_container_image_tag
action: delete

exporters:
{{- if eq (include "splunk-otel-collector.o11yMetricsEnabled" $) "true" }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,19 @@ data:
- action: upsert
key: k8s.cluster.name
value: CHANGEME
- action: extract
key: container.image.name
pattern: ^(?P<temp_container_image_name>[^\:]+)(?:\:(?P<temp_container_image_tag>.*))?
- action: upsert
from_attribute: temp_container_image_name
key: container.image.name
- action: delete
key: temp_container_image_name
- action: upsert
from_attribute: temp_container_image_tag
key: container.image.tag
- action: delete
key: temp_container_image_tag
resource/add_collector_k8s:
attributes:
- action: insert
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ spec:
component: otel-k8s-cluster-receiver
release: default
annotations:
checksum/config: 0482b5c8dc6f8b2b65eaca8979490e13ddffaa7ef323cf330677deee0e635b5e
checksum/config: 1f01ab0ce60e050a9b9214ed9d89548557c428e16b1006d83182f5f4cd534a03
spec:
serviceAccountName: default-splunk-otel-collector
nodeSelector:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,19 @@ data:
- action: upsert
key: k8s.cluster.name
value: CHANGEME
- action: extract
key: container.image.name
pattern: ^(?P<temp_container_image_name>[^\:]+)(?:\:(?P<temp_container_image_tag>.*))?
- action: upsert
from_attribute: temp_container_image_name
key: container.image.name
- action: delete
key: temp_container_image_name
- action: upsert
from_attribute: temp_container_image_tag
key: container.image.tag
- action: delete
key: temp_container_image_tag
resource/add_collector_k8s:
attributes:
- action: insert
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ spec:
component: otel-k8s-cluster-receiver
release: default
annotations:
checksum/config: 0482b5c8dc6f8b2b65eaca8979490e13ddffaa7ef323cf330677deee0e635b5e
checksum/config: 1f01ab0ce60e050a9b9214ed9d89548557c428e16b1006d83182f5f4cd534a03
spec:
serviceAccountName: default-splunk-otel-collector
nodeSelector:
Expand Down