Skip to content

Commit

Permalink
updating helm
Browse files Browse the repository at this point in the history
  • Loading branch information
mpecenka committed Jan 17, 2025
1 parent e01bc40 commit 716785b
Show file tree
Hide file tree
Showing 12 changed files with 354 additions and 1,352 deletions.
4 changes: 2 additions & 2 deletions deploy/helm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: swo-k8s-collector
version: 4.4.0-alpha.2
appVersion: 0.12.3
version: 4.4.0-alpha.3
appVersion: 0.13.0
description: SolarWinds Kubernetes Integration
keywords:
- monitoring
Expand Down
34 changes: 3 additions & 31 deletions deploy/helm/events-collector-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,32 +88,6 @@ processors:
- set(resource.attributes["k8s.node.name"], resource.attributes["k8s.object.name"]) where resource.attributes["k8s.object.kind"] == "Node"
- set(resource.attributes["k8s.namespace.name"], attributes["k8s.namespace.name"]) where attributes["k8s.namespace.name"] != nil
- delete_key(attributes, "k8s.namespace.name") where attributes["k8s.namespace.name"] != nil
transform/cleanup_attributes_for_nonexisting_entities:
log_statements:
- context: log
statements:
- delete_key(resource.attributes, "k8s.pod.name") where resource.attributes["sw.k8s.pod.found"] == "false"
- delete_key(resource.attributes, "k8s.deployment.name") where resource.attributes["sw.k8s.deployment.found"] == "false"
- delete_key(resource.attributes, "k8s.statefulset.name") where resource.attributes["sw.k8s.statefulset.found"] == "false"
- delete_key(resource.attributes, "k8s.replicaset.name") where resource.attributes["sw.k8s.replicaset.found"] == "false"
- delete_key(resource.attributes, "k8s.daemonset.name") where resource.attributes["sw.k8s.daemonset.found"] == "false"
- delete_key(resource.attributes, "k8s.job.name") where resource.attributes["sw.k8s.job.found"] == "false"
- delete_key(resource.attributes, "k8s.cronjob.name") where resource.attributes["sw.k8s.cronjob.found"] == "false"
- delete_key(resource.attributes, "k8s.node.name") where resource.attributes["sw.k8s.node.found"] == "false"
- delete_key(resource.attributes, "k8s.persistentvolume.name") where resource.attributes["sw.k8s.persistentvolume.found"] == "false"
- delete_key(resource.attributes, "k8s.persistentvolumeclaim.name") where resource.attributes["sw.k8s.persistentvolumeclaim.found"] == "false"
- delete_key(resource.attributes, "k8s.service.name") where resource.attributes["sw.k8s.service.found"] == "false"
- delete_key(resource.attributes, "sw.k8s.pod.found")
- delete_key(resource.attributes, "sw.k8s.deployment.found")
- delete_key(resource.attributes, "sw.k8s.statefulset.found")
- delete_key(resource.attributes, "sw.k8s.replicaset.found")
- delete_key(resource.attributes, "sw.k8s.daemonset.found")
- delete_key(resource.attributes, "sw.k8s.job.found")
- delete_key(resource.attributes, "sw.k8s.cronjob.found")
- delete_key(resource.attributes, "sw.k8s.node.found")
- delete_key(resource.attributes, "sw.k8s.persistentvolume.found")
- delete_key(resource.attributes, "sw.k8s.persistentvolumeclaim.found")
- delete_key(resource.attributes, "sw.k8s.service.found")

transform/stringify_body:
error_mode: ignore
Expand Down Expand Up @@ -309,7 +283,7 @@ processors:

batch:
{{ toYaml .Values.otel.events.batch | indent 4 }}
swk8sattributes:
k8sattributes:
{{ include "common.k8s-instrumentation" . | indent 4 }}

receivers:
Expand Down Expand Up @@ -357,8 +331,7 @@ service:
- transform/namespace
- transform/entity_attributes
- resource/events
- swk8sattributes
- transform/cleanup_attributes_for_nonexisting_entities
- k8sattributes
{{- if and .Values.otel.events.filter (eq (include "isDeprecatedFilterSyntax" .Values.otel.events.filter) "false") }}
- filter
{{- end }}
Expand All @@ -379,8 +352,7 @@ service:
- transform/stringify_body
- resource/manifest
- resourcedetection/providers
- swk8sattributes
- transform/cleanup_attributes_for_nonexisting_entities
- k8sattributes
{{- if not (and .Values.otel.events.enabled .Values.otel.manifests.enabled) }}
- filter/k8s_collector_config_include
{{- end }}
Expand Down
22 changes: 2 additions & 20 deletions deploy/helm/metrics-collector-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ extensions:
endpoint: 0.0.0.0:13133

processors:
swk8sattributes:
k8sattributes:
{{ include "common.k8s-instrumentation" . | indent 4 }}
memory_limiter:
{{ toYaml .Values.otel.metrics.memory_limiter | indent 4 }}
Expand Down Expand Up @@ -724,23 +724,6 @@ processors:

{{- include "common-config.resource-metrics" . | nindent 2 }}

transform/cleanup_attributes_for_nonexisting_entities:
metric_statements:
- context: metric
statements:
- delete_key(resource.attributes, "k8s.node.name") where resource.attributes["sw.k8s.node.found"] == "false"
- delete_key(resource.attributes, "sw.k8s.pod.found")
- delete_key(resource.attributes, "sw.k8s.deployment.found")
- delete_key(resource.attributes, "sw.k8s.statefulset.found")
- delete_key(resource.attributes, "sw.k8s.replicaset.found")
- delete_key(resource.attributes, "sw.k8s.daemonset.found")
- delete_key(resource.attributes, "sw.k8s.job.found")
- delete_key(resource.attributes, "sw.k8s.cronjob.found")
- delete_key(resource.attributes, "sw.k8s.node.found")
- delete_key(resource.attributes, "sw.k8s.persistentvolume.found")
- delete_key(resource.attributes, "sw.k8s.persistentvolumeclaim.found")
- delete_key(resource.attributes, "sw.k8s.service.found")

attributes/remove_prometheus_attributes_endpoint:
exclude:
match_type: regexp
Expand Down Expand Up @@ -1187,8 +1170,7 @@ service:
- metricstransform/aggregate_pod_level
- groupbyattrs/all
- resource/metrics
- swk8sattributes
- transform/cleanup_attributes_for_nonexisting_entities
- k8sattributes
{{- if .Values.otel.metrics.filter }}
- filter
{{- end }}
Expand Down
4 changes: 2 additions & 2 deletions deploy/helm/metrics-discovery-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ extensions:
observe_pods: true

processors:
swk8sattributes:
k8sattributes:
{{ include "common.k8s-instrumentation" . | indent 4 }}

memory_limiter:
Expand Down Expand Up @@ -247,7 +247,7 @@ service:
processors:
- memory_limiter
- filter/histograms
- swk8sattributes
- k8sattributes
{{- if .Values.otel.metrics.filter }}
- filter/metrics
{{- end }}
Expand Down
6 changes: 3 additions & 3 deletions deploy/helm/node-collector-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ processors:
batch/metrics:
{{ toYaml .Values.otel.metrics.batch | indent 4 }}

swk8sattributes:
k8sattributes:
auth_type: "serviceAccount"
passthrough: false
filter:
Expand Down Expand Up @@ -744,7 +744,7 @@ service:
- transform/syslogify
- groupbyattrs/common-all
- resource/container
- swk8sattributes
- k8sattributes
{{- if eq (include "isDeprecatedFilterSyntax" .Values.otel.logs.filter) "false" }}
{{- if (include "logsFilter" .) }}
- filter/logs
Expand Down Expand Up @@ -837,7 +837,7 @@ service:
processors:
- memory_limiter
- filter/histograms
- swk8sattributes
- k8sattributes
{{- if .Values.otel.metrics.filter }}
- filter/metrics
{{- end }}
Expand Down
31 changes: 0 additions & 31 deletions deploy/helm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -124,30 +124,9 @@ attributes["k8s.event.reason"] == "ProbeWarning"
or attributes["k8s.event.reason"] == "Unhealthy"
{{- end -}}

{{- define "common.k8s-instrumentation.resource.namespaced" -}}
{{ index . 1 }}:
extract:
association:
- sources:
- from: resource_attribute
name: k8s.{{ index . 1 }}.name
- from: resource_attribute
name: k8s.namespace.name
{{- end -}}

{{- define "common.k8s-instrumentation.resource" -}}
{{ index . 1 }}:
extract:
association:
- sources:
- from: resource_attribute
name: k8s.{{ index . 1 }}.name
{{- end -}}

{{- define "common.k8s-instrumentation" -}}
auth_type: "serviceAccount"
passthrough: false
set_object_existence: true
extract:
metadata:
- k8s.deployment.name
Expand All @@ -163,16 +142,6 @@ pod_association:
name: k8s.pod.name
- from: resource_attribute
name: k8s.namespace.name
{{ include "common.k8s-instrumentation.resource.namespaced" (tuple . "deployment") }}
{{ include "common.k8s-instrumentation.resource.namespaced" (tuple . "statefulset") }}
{{ include "common.k8s-instrumentation.resource.namespaced" (tuple . "replicaset") }}
{{ include "common.k8s-instrumentation.resource.namespaced" (tuple . "daemonset") }}
{{ include "common.k8s-instrumentation.resource.namespaced" (tuple . "job") }}
{{ include "common.k8s-instrumentation.resource.namespaced" (tuple . "cronjob") }}
{{ include "common.k8s-instrumentation.resource" (tuple . "persistentvolume") }}
{{ include "common.k8s-instrumentation.resource.namespaced" (tuple . "persistentvolumeclaim") }}
{{ include "common.k8s-instrumentation.resource" (tuple . "node") }}
{{ include "common.k8s-instrumentation.resource.namespaced" (tuple . "service") }}
{{- end -}}

{{/*
Expand Down
Loading

0 comments on commit 716785b

Please sign in to comment.