Skip to content

Commit 8b34720

Browse files
[nr-k8s-otel-collector] fix: Fix daemonset collected metrics (#1639)
<!-- Thank you for contributing to New Relic's Helm charts. Before you submit this PR we'd like to make sure you are aware of our technical requirements: * https://github.com/newrelic-experimental/helm-charts/blob/master/CONTRIBUTING.md#technical-requirements For a quick overview across what we will look at reviewing your PR, please read our review guidelines: * https://github.com/newrelic-experimental/helm-charts/blob/master/REVIEW_GUIDELINES.md Following our best practices right from the start will accelerate the review process and help get your PR merged quicker. When updates to your PR are requested, please add new commits and do not squash the history. This will make it easier to identify new changes. The PR will be squashed anyways when it is merged. Thanks. For fast feedback, please @-mention maintainers that are listed in the Chart.yaml file. Please make sure you test your changes before you push them. Once pushed, a Github Action will run across your changes and do some initial checks and linting. These checks run very quickly. Please check the results. We would like these checks to pass before we even continue reviewing your changes. --> #### Is this a new chart #### What this PR does / why we need it: #### Which issue this PR fixes *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)* - fixes # #### Special notes for your reviewer: #### Checklist [Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.] - [X] Chart Version bumped - [ ] Variables are documented in the README.md - [X] Title of the PR starts with chart name (e.g. `[mychartname]`)
1 parent 874e03a commit 8b34720

File tree

2 files changed

+14
-21
lines changed

2 files changed

+14
-21
lines changed

charts/nr-k8s-otel-collector/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ type: application
1717
# This is the chart version. This version number should be incremented each time you make changes
1818
# to the chart and its templates, including the app version.
1919
# Versions are expected to follow Semantic Versioning (https://semver.org/)
20-
version: 0.8.3
20+
version: 0.8.4
2121

2222
dependencies:
2323
- name: common-library

charts/nr-k8s-otel-collector/templates/daemonset-configmap.yaml

+13-20
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ data:
9797
- action: replace
9898
target_label: job_label
9999
replacement: cadvisor
100+
- source_labels: [__meta_kubernetes_node_name]
101+
regex: ${KUBE_NODE_NAME}
102+
action: keep
100103
scheme: https
101104
tls_config:
102105
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
@@ -118,6 +121,9 @@ data:
118121
- action: replace
119122
target_label: job_label
120123
replacement: kubelet
124+
- source_labels: [__meta_kubernetes_node_name]
125+
regex: ${KUBE_NODE_NAME}
126+
action: keep
121127
scheme: https
122128
tls_config:
123129
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
@@ -447,29 +453,13 @@ data:
447453
- key: type
448454
action: delete
449455
450-
resourcedetection/env:
451-
detectors: ["env", "system"]
452-
override: false
453-
system:
454-
hostname_sources: ["os"]
455-
resource_attributes:
456-
host.id:
457-
enabled: true
458-
459456
resourcedetection/cloudproviders:
460-
detectors: [gcp, eks, azure, aks, ec2, ecs]
457+
detectors: [gcp, eks, ec2, aks, azure]
461458
timeout: 2s
462459
override: false
463-
ec2:
464-
resource_attributes:
465-
host.name:
466-
enabled: false
467460
468461
resource:
469462
attributes:
470-
- key: host.id
471-
from_attribute: host.name
472-
action: upsert
473463
# TODO (chris): Upsert only when cluster name not found (resource detection override: true)
474464
- key: k8s.cluster.name
475465
action: upsert
@@ -508,6 +498,7 @@ data:
508498
- k8s.pod.name
509499
- k8s.pod.uid
510500
- k8s.deployment.name
501+
- k8s.daemonset.name
511502
- k8s.namespace.name
512503
- k8s.node.name
513504
- k8s.pod.start_time
@@ -519,11 +510,14 @@ data:
519510
attributes/self:
520511
actions:
521512
- key: k8s.pod.name
522-
action: update
513+
action: upsert
523514
from_attribute: pod
524515
- key: k8s.deployment.name
525516
action: update
526517
from_attribute: deployment
518+
- key: k8s.daemonset.name
519+
action: update
520+
from_attribute: daemonset
527521
- key: k8s.node.name
528522
action: update
529523
from_attribute: node
@@ -594,15 +588,14 @@ data:
594588
- filter/exclude_system_paging
595589
- filter/exclude_network
596590
- attributes/exclude_system_paging
597-
- resourcedetection/env
598591
- resourcedetection/cloudproviders
599592
- resource
600593
{{- if include "nrKubernetesOtel.lowDataMode" . }}
601594
- transform/low_data_mode_inator
602595
- resource/low_data_mode_inator
603596
{{- end }}
604-
- k8sattributes
605597
- attributes/self
598+
- k8sattributes
606599
- memory_limiter
607600
- cumulativetodelta
608601
- batch

0 commit comments

Comments
 (0)