Skip to content

Commit

Permalink
Merge pull request #797 from solarwinds/remove-name-and-version-from-…
Browse files Browse the repository at this point in the history
…scope

Removed `name` and `version` from the scope context
  • Loading branch information
turytsia authored Nov 15, 2024
2 parents 63043e9 + 9d39338 commit 5da5aba
Show file tree
Hide file tree
Showing 8 changed files with 176 additions and 1 deletion.
7 changes: 7 additions & 0 deletions deploy/helm/events-collector-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,12 @@ processors:
# convert body to string
- set(body, body.string)
{{- end }}
transform/scope:
log_statements:
- context: scope
statements:
- set(name, "")
- set(version, "")
{{- if .Values.otel.manifests.enabled }}
groupbyattrs/manifest:
keys:
Expand Down Expand Up @@ -365,6 +371,7 @@ service:
- groupbyattrs/manifest
- resource/manifest
- swk8sattributes
- transform/scope
{{- if not (empty .Values.otel.events.k8s_instrumentation.labels.excludePattern) }}
- resource/swk8sattributes_labels_filter
{{- end }}
Expand Down
7 changes: 7 additions & 0 deletions deploy/helm/metrics-collector-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ processors:
{{- include "common-config.filter-remove-internal" . | nindent 2 }}
{{- include "common-config.filter-remove-internal-post-processing" . | nindent 2 }}

transform/scope:
metric_statements:
- context: scope
statements:
- set(name, "")
- set(version, "")
# unify attributes
attributes/unify_node_attribute:
include:
Expand Down Expand Up @@ -1247,6 +1253,7 @@ service:
- otlp
processors:
- memory_limiter
- transform/scope
- filter/histograms
- batch
receivers:
Expand Down
13 changes: 12 additions & 1 deletion deploy/helm/node-collector-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,17 @@ processors:
metrics:
metric:
- 'type == METRIC_DATA_TYPE_HISTOGRAM and not(name == "k8s.rest_client_request_duration_seconds" or name == "k8s.workqueue_queue_duration_seconds" or name == "k8s.etcd_disk_wal_fsync_duration_seconds" or name == "k8s.etcd_disk_backend_commit_duration_seconds")'

transform/scope:
metric_statements:
- context: scope
statements:
- set(name, "")
- set(version, "")
log_statements:
- context: scope
statements:
- set(name, "")
- set(version, "")
transform/istio-metrics:
metric_statements:
- context: metric
Expand Down Expand Up @@ -884,6 +894,7 @@ service:
- memory_limiter
- filter/histograms
- swk8sattributes
- transform/scope
{{- if not (empty .Values.otel.metrics.k8s_instrumentation.labels.excludePattern) }}
- resource/swk8sattributes_labels_filter
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,12 @@ Custom events filter with new syntax:
- context: log
statements:
- set(attributes["sw.namespace"], "sw.events.inframon.k8s")
transform/scope:
log_statements:
- context: scope
statements:
- set(name, "")
- set(version, "")
transform/set_labels_and_annotations_for_entities:
error_mode: ignore
log_statements:
Expand Down Expand Up @@ -556,6 +562,7 @@ Custom events filter with new syntax:
- groupbyattrs/manifest
- resource/manifest
- swk8sattributes
- transform/scope
- transform/cleanup_attributes_for_nonexisting_entities
- batch
receivers:
Expand Down Expand Up @@ -924,6 +931,12 @@ Custom events filter with old syntax:
- context: log
statements:
- set(attributes["sw.namespace"], "sw.events.inframon.k8s")
transform/scope:
log_statements:
- context: scope
statements:
- set(name, "")
- set(version, "")
transform/set_labels_and_annotations_for_entities:
error_mode: ignore
log_statements:
Expand Down Expand Up @@ -1126,6 +1139,7 @@ Custom events filter with old syntax:
- groupbyattrs/manifest
- resource/manifest
- swk8sattributes
- transform/scope
- transform/cleanup_attributes_for_nonexisting_entities
- batch
receivers:
Expand Down Expand Up @@ -1487,6 +1501,12 @@ Events config should match snapshot when using default values:
- context: log
statements:
- set(attributes["sw.namespace"], "sw.events.inframon.k8s")
transform/scope:
log_statements:
- context: scope
statements:
- set(name, "")
- set(version, "")
transform/set_labels_and_annotations_for_entities:
error_mode: ignore
log_statements:
Expand Down Expand Up @@ -1688,6 +1708,7 @@ Events config should match snapshot when using default values:
- groupbyattrs/manifest
- resource/manifest
- swk8sattributes
- transform/scope
- transform/cleanup_attributes_for_nonexisting_entities
- batch
receivers:
Expand Down Expand Up @@ -1944,6 +1965,12 @@ Events config should not contain manifest collection pipeline when disabled:
- context: log
statements:
- set(attributes["sw.namespace"], "sw.events.inframon.k8s")
transform/scope:
log_statements:
- context: scope
statements:
- set(name, "")
- set(version, "")
transform/severity:
log_statements:
- context: log
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1699,6 +1699,12 @@ Metrics config should match snapshot when using default values:
- delete_key(resource.attributes, "sw.k8s.job.found")
- delete_key(resource.attributes, "sw.k8s.cronjob.found")
- delete_key(resource.attributes, "sw.k8s.node.found")
transform/scope:
metric_statements:
- context: scope
statements:
- set(name, "")
- set(version, "")
transform/unify_node_attribute:
metric_statements:
- context: datapoint
Expand Down Expand Up @@ -1880,6 +1886,7 @@ Metrics config should match snapshot when using default values:
- otlp
processors:
- memory_limiter
- transform/scope
- filter/histograms
- batch
receivers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1699,6 +1699,12 @@ Metrics config should match snapshot when fargate is enabled:
- delete_key(resource.attributes, "sw.k8s.job.found")
- delete_key(resource.attributes, "sw.k8s.cronjob.found")
- delete_key(resource.attributes, "sw.k8s.node.found")
transform/scope:
metric_statements:
- context: scope
statements:
- set(name, "")
- set(version, "")
transform/unify_node_attribute:
metric_statements:
- context: datapoint
Expand Down Expand Up @@ -1880,6 +1886,7 @@ Metrics config should match snapshot when fargate is enabled:
- otlp
processors:
- memory_limiter
- transform/scope
- filter/histograms
- batch
receivers:
Expand Down Expand Up @@ -3658,6 +3665,12 @@ Metrics config should match snapshot when using Prometheus url with extra_scrape
- delete_key(resource.attributes, "sw.k8s.job.found")
- delete_key(resource.attributes, "sw.k8s.cronjob.found")
- delete_key(resource.attributes, "sw.k8s.node.found")
transform/scope:
metric_statements:
- context: scope
statements:
- set(name, "")
- set(version, "")
transform/unify_node_attribute:
metric_statements:
- context: datapoint
Expand Down Expand Up @@ -3774,6 +3787,7 @@ Metrics config should match snapshot when using Prometheus url with extra_scrape
- otlp
processors:
- memory_limiter
- transform/scope
- filter/histograms
- batch
receivers:
Expand Down Expand Up @@ -5559,6 +5573,12 @@ Metrics config should match snapshot when using default values:
- delete_key(resource.attributes, "sw.k8s.job.found")
- delete_key(resource.attributes, "sw.k8s.cronjob.found")
- delete_key(resource.attributes, "sw.k8s.node.found")
transform/scope:
metric_statements:
- context: scope
statements:
- set(name, "")
- set(version, "")
transform/unify_node_attribute:
metric_statements:
- context: datapoint
Expand Down Expand Up @@ -5660,6 +5680,7 @@ Metrics config should match snapshot when using default values:
- otlp
processors:
- memory_limiter
- transform/scope
- filter/histograms
- batch
receivers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -920,6 +920,17 @@ Node collector config for windows nodes should match snapshot when using default
"k8s.istio_request_duration_milliseconds_sum"
- set(name, "k8s.istio_request_duration_milliseconds_count_temp") where name
== "k8s.istio_request_duration_milliseconds_count"
transform/scope:
log_statements:
- context: scope
statements:
- set(name, "")
- set(version, "")
metric_statements:
- context: scope
statements:
- set(name, "")
- set(version, "")
transform/syslogify:
error_mode: ignore
log_statements:
Expand Down Expand Up @@ -1117,6 +1128,7 @@ Node collector config for windows nodes should match snapshot when using default
- memory_limiter
- filter/histograms
- swk8sattributes
- transform/scope
- filter/remove_temporary_metrics
- batch/metrics
receivers:
Expand Down Expand Up @@ -2093,6 +2105,17 @@ Node collector config for windows nodes should match snapshot when using legacy
"k8s.istio_request_duration_milliseconds_sum"
- set(name, "k8s.istio_request_duration_milliseconds_count_temp") where name
== "k8s.istio_request_duration_milliseconds_count"
transform/scope:
log_statements:
- context: scope
statements:
- set(name, "")
- set(version, "")
metric_statements:
- context: scope
statements:
- set(name, "")
- set(version, "")
transform/syslogify:
error_mode: ignore
log_statements:
Expand Down Expand Up @@ -2364,6 +2387,7 @@ Node collector config for windows nodes should match snapshot when using legacy
- memory_limiter
- filter/histograms
- swk8sattributes
- transform/scope
- filter/remove_temporary_metrics
- batch/metrics
receivers:
Expand Down
Loading

0 comments on commit 5da5aba

Please sign in to comment.