Skip to content

Commit 46702b2

Browse files
authored
logzio-apm-collector version 1.2.2
[Feature] add dynamic resource detection
2 parents 7daf2a1 + d0904ab commit 46702b2

File tree

5 files changed

+70
-6
lines changed

5 files changed

+70
-6
lines changed

charts/logzio-apm-collector/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# Changes by Version
22

33
<!-- next version -->
4+
## 1.2.2
5+
- Add support for auto resource detection with `distribution` and `resourceDetection.enabled` flags.
6+
- The old `resourcedetection/all` configuration now serves as fallback if `distribution` is empty or with unknown value.
7+
- **Note:** If you use a custom `resourcedetection` configurations, you can disable the new behavior by setting `resourceDetection.enabled=false` and manually adding the required configuration under `traceConfig`.
8+
- Upgrade OpenTelemetry Collector from `0.119.0` to `0.123.0`
9+
410
## 1.2.1
511
- Add support for global tolerations
612

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
apiVersion: v2
22
name: logzio-apm-collector
3-
version: 1.2.1
3+
version: 1.2.2
44
description: Kubernetes APM agent for Logz.io based on OpenTelemetry Collector
55
type: application
66
home: https://logz.io/
77
icon: https://logzbucket.s3.eu-west-1.amazonaws.com/logz-io-img/logo400x400.png
88
maintainers:
99
- name: Naama Bendalak
1010
11-
appVersion: 0.119.0
11+
appVersion: 0.123.0

charts/logzio-apm-collector/templates/_config.tpl

+35
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,18 @@
7272
{{- if not (or .Values.spm.enabled .Values.serviceGraph.enabled) }}
7373
{{- $_ := unset $tracesConfig.service.pipelines "traces/spm" }}
7474
{{- end -}}
75+
76+
{{- if (eq (include "apm-collector.resourceDetectionEnabled" .) "true") }}
77+
{{- $resDetectionConfig := (include "apm-collector.resourceDetectionConfig" .Values.global.distribution | fromYaml) }}
78+
{{- if $resDetectionConfig }}
79+
{{- range $key, $value := $resDetectionConfig }}
80+
{{- $_ := set $tracesConfig "processors" (merge (index $tracesConfig "processors") (dict $key $value)) }}
81+
{{- $_ := set (index $tracesConfig "service" "pipelines" "traces") "processors" (prepend (index $tracesConfig "service" "pipelines" "traces" "processors") $key) }}
82+
{{- $_ := set (index $tracesConfig "service" "pipelines" "traces/spm") "processors" (prepend (index $tracesConfig "service" "pipelines" "traces/spm" "processors") $key) }}
83+
{{- end }}
84+
{{- end }}
85+
{{- end }}
86+
7587
{{- tpl ($tracesConfig | toYaml) . }}
7688
{{- end -}}
7789

@@ -88,3 +100,26 @@
88100
{{- end }}
89101
{{- tpl ($spmConfig | toYaml) . }}
90102
{{- end }}
103+
104+
{{/* Build config for Resource Detection according to distribution */}}
105+
{{- define "apm-collector.resourceDetectionConfig" -}}
106+
{{- if . }}
107+
{{- if eq . "eks" }}
108+
resourcedetection/distribution:
109+
timeout: 15s
110+
detectors: ["eks", "ec2"]
111+
{{- else if eq . "aks" }}
112+
resourcedetection/distribution:
113+
detectors: ["aks", "azure"]
114+
{{- else if eq . "gke" }}
115+
resourcedetection/distribution:
116+
detectors: ["gcp"]
117+
{{- else }}
118+
resourcedetection/all:
119+
detectors: [ec2, azure, gcp]
120+
{{- end }}
121+
{{- else }}
122+
resourcedetection/all:
123+
detectors: [ec2, azure, gcp]
124+
{{- end }}
125+
{{- end }}

charts/logzio-apm-collector/templates/_helpers.tpl

+15
Original file line numberDiff line numberDiff line change
@@ -146,3 +146,18 @@ The APM service address
146146
{{- $serviceName := include "apm-collector.fullname" .}}
147147
{{- printf "http://%s.%s.svc.cluster.local" $serviceName .Release.Namespace }}
148148
{{- end }}
149+
150+
{{/*
151+
Returns the value of resource detection enablement state
152+
*/}}
153+
{{- define "apm-collector.resourceDetectionEnabled" -}}
154+
{{- if (hasKey .Values "resourceDetection") }}
155+
{{- if (hasKey .Values.resourceDetection "enabled") }}
156+
{{- .Values.resourceDetection.enabled }}
157+
{{- else }}
158+
{{- .Values.global.resourceDetection.enabled }}
159+
{{- end }}
160+
{{- else }}
161+
{{- .Values.global.resourceDetection.enabled }}
162+
{{- end }}
163+
{{- end }}

charts/logzio-apm-collector/values.yaml

+12-4
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,16 @@ global:
3333
# Optional - Overrides global.LogzioRegion listener address with a custom endpoint. For example: http://endpoint:8080
3434
customTracesEndpoint: ""
3535
customSpmEndpoint: ""
36+
# Optional - Identifier for the Kubernetes distribution used. One of "eks", "aks" or "gke".
37+
distribution: ""
38+
# Optional - Control enabling of the OpenTelemetry Collector's resource detection feature. Dependent on `distribution` value.
39+
resourceDetection:
40+
enabled: false
41+
42+
# Optional - Overrides `global.resourceDetection.enabled`.
43+
# Control whether the OpenTelemetry Collector's resource detection feature is enabled. Dependent on `distribution` value.
44+
resourceDetection:
45+
enabled: true
3646

3747
# Allows changing the OpenTelemetry Collector log level
3848
otelLogLevel: "info"
@@ -78,8 +88,6 @@ traceConfig:
7888
zipkin:
7989
endpoint: "0.0.0.0:9411"
8090
processors:
81-
resourcedetection/all:
82-
detectors: [ec2, azure, gcp]
8391
tail_sampling:
8492
policies:
8593
[
@@ -177,12 +185,12 @@ traceConfig:
177185
pipelines:
178186
traces:
179187
receivers: [zipkin, otlp]
180-
processors: [resourcedetection/all,attributes/env_id, k8sattributes, resource/k8s, tail_sampling, batch]
188+
processors: [attributes/env_id, k8sattributes, resource/k8s, tail_sampling, batch]
181189
exporters: [logzio]
182190
# Removed if spm.enabled is false
183191
traces/spm:
184192
receivers: [zipkin, otlp]
185-
processors: [resourcedetection/all, attributes/env_id, k8sattributes, batch]
193+
processors: [attributes/env_id, k8sattributes, batch]
186194
exporters: [otlp/spm_forwarder]
187195
telemetry:
188196
logs:

0 commit comments

Comments
 (0)