Skip to content
Draft
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
2 changes: 1 addition & 1 deletion charts/agent/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: agent
description: Chart to install K8s collection stack based on Observe Agent
type: application
version: 0.63.1
version: 0.63.2
appVersion: "2.5.0"
dependencies:
- name: opentelemetry-collector
Expand Down
2 changes: 1 addition & 1 deletion charts/agent/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# agent

![Version: 0.63.1](https://img.shields.io/badge/Version-0.63.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.5.0](https://img.shields.io/badge/AppVersion-2.5.0-informational?style=flat-square)
![Version: 0.63.2](https://img.shields.io/badge/Version-0.63.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.5.0](https://img.shields.io/badge/AppVersion-2.5.0-informational?style=flat-square)

Chart to install K8s collection stack based on Observe Agent

Expand Down
4 changes: 2 additions & 2 deletions charts/agent/templates/_cluster-metrics-config.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ processors:
{{- include "config.processors.batch" . | nindent 2 }}

{{- include "config.processors.attributes.k8sattributes" (merge . (dict "target" "cluster_metrics")) | nindent 2 }}
{{- include "config.processors.attributes.drop_container_info" . | nindent 2 }}
{{- include "config.processors.attributes.drop_container_info" (merge . (dict "target" "cluster_metrics")) | nindent 2 }}

{{- include "config.processors.resource.observe_common" . | nindent 2 }}

Expand Down Expand Up @@ -64,7 +64,7 @@ service:
{{- if and (eq .Values.application.prometheusScrape.enabled true) (eq .Values.application.prometheusScrape.independentDeployment false) }}
metrics/pod_metrics:
receivers: [prometheus/pod_metrics]
processors: [memory_limiter, k8sattributes, batch, resource/observe_common, attributes/debug_source_pod_metrics]
processors: [memory_limiter, k8sattributes, batch, resource/observe_common, resource/drop_container_info, attributes/debug_source_pod_metrics]
exporters: [{{ join ", " $metricsExporters }}]
{{- end }}
{{- include "config.service.telemetry" . | nindent 2 }}
Expand Down
8 changes: 7 additions & 1 deletion charts/agent/templates/_config-processors.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@ k8sattributes:
- k8s.pod.name
- k8s.pod.uid
- k8s.cluster.uid
{{- if (ne .target "pod_metrics") }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this nested NE condition is a little tough to understand, can we add a comment here to explain what happens in the cases

  1. Not pod_metrics or cluster_metrics
  2. pod_metrics
  3. cluster_metrics

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah good callout. I add a comment

- k8s.container.name
{{- if ne .target "cluster_metrics" }}
{{- if (ne .target "cluster_metrics") }}
- container.id
{{- end }}
{{- end }}
- service.namespace
- service.name
- service.version
Expand Down Expand Up @@ -102,4 +104,8 @@ resource/drop_container_info:
attributes:
- key: container.id
action: delete
{{- if eq .target "pod_metrics" }}
- key: k8s.container.name
action: delete
{{- end }}
{{- end -}}
8 changes: 5 additions & 3 deletions charts/agent/templates/_prometheus-scraper-config.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ processors:

{{- include "config.processors.batch" . | nindent 2 }}

{{- include "config.processors.attributes.k8sattributes" . | nindent 2 }}
{{- include "config.processors.attributes.k8sattributes" (merge . (dict "target" "pod_metrics")) | nindent 2 }}
{{- include "config.processors.attributes.drop_container_info" (merge . (dict "target" "pod_metrics")) | nindent 2 }}

{{- include "config.processors.resource.observe_common" . | nindent 2 }}

{{- include "config.processors.attributes.pod_metrics" . | nindent 2 }}


# Set up receivers
{{- $podMetricsReceivers := (list "prometheus/pod_metrics") -}}
{{- if eq .Values.application.prometheusScrape.enabled false}}
Expand All @@ -39,8 +41,8 @@ service:
pipelines:
metrics/pod_metrics:
receivers: [{{ join ", " $podMetricsReceivers }}]
processors: [memory_limiter, k8sattributes, batch, resource/observe_common, attributes/debug_source_pod_metrics]
processors: [memory_limiter, k8sattributes, batch, resource/observe_common, resource/drop_container_info, attributes/debug_source_pod_metrics]
exporters: [{{ join ", " $podMetricsExporters }}]
{{- include "config.service.telemetry" . | nindent 2 }}

{{- end }}
{{- end }}