Skip to content

Commit

Permalink
chore(collector): upgrade to app version 0.37.1 (open-telemetry#89)
Browse files Browse the repository at this point in the history
* fix(collector): wrap tls insecure value inside tls block
* feat(collector): use contrib collector image by default
* fix(collector): adapt file logger configuration to v0.36.0
* fix(collector): add memory_ballast to service.extension list
* chore(collector): upgrade to v0.37.1
* refactor(collector): add memory_ballast to service extensions statically
* Remove ballast_size_mib from memory_limiter

Co-authored-by: Dmitry <[email protected]>
  • Loading branch information
2 people authored and etiennejournet committed Oct 28, 2021
1 parent 21709e3 commit 9846edb
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 13 deletions.
4 changes: 2 additions & 2 deletions charts/opentelemetry-collector/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: opentelemetry-collector
version: 0.6.0
version: 0.7.11
description: OpenTelemetry Collector Helm chart for Kubernetes
type: application
home: https://opentelemetry.io/
Expand All @@ -13,4 +13,4 @@ maintainers:
- name: pjanotti
- name: tigrannajaryan
icon: https://opentelemetry.io/img/logos/opentelemetry-logo-nav.png
appVersion: 0.22.0
appVersion: 0.37.1
25 changes: 18 additions & 7 deletions charts/opentelemetry-collector/templates/_config.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ limit_mib: {{ include "opentelemetry-collector.getMemLimitMib" .Values.resources

# By default spike_limit_mib is set to 25% of ".Values.resources.limits.memory"
spike_limit_mib: {{ include "opentelemetry-collector.getMemSpikeLimitMib" .Values.resources.limits.memory }}

# By default ballast_size_mib is set to 40% of ".Values.resources.limits.memory"
ballast_size_mib: {{ include "opentelemetry-collector.getMemBallastSizeMib" .Values.resources.limits.memory }}
{{- end }}

{{/*
Expand All @@ -26,13 +23,26 @@ Merge user supplied top-level (not particular to standalone or agent) config int
{{- .Values.config | toYaml }}
{{- end }}

{{/*
Merge user supplied top-level (not particular to standalone or agent) config into memory ballast config.
*/}}
{{- define "opentelemetry-collector.ballastConfig" -}}
{{- $memoryBallastConfig := get .Values.config.extensions "memory_ballast" }}
{{- if or (not $memoryBallastConfig) (not $memoryBallastConfig.size_mib) }}
{{- $_ := set $memoryBallastConfig "size_mib" (include "opentelemetry-collector.getMemBallastSizeMib" .Values.resources.limits.memory) }}
{{- end }}
{{- .Values.config | toYaml }}
{{- end }}


{{/*
Build config file for agent OpenTelemetry Collector
*/}}
{{- define "opentelemetry-collector.agentCollectorConfig" -}}
{{- $values := deepCopy .Values.agentCollector | mustMergeOverwrite (deepCopy .Values) }}
{{- $data := dict "Values" $values | mustMergeOverwrite (deepCopy .) }}
{{- $config := include "opentelemetry-collector.baseConfig" $data | fromYaml }}
{{- $config := include "opentelemetry-collector.ballastConfig" $data | fromYaml | mustMergeOverwrite $config }}
{{- $config := include "opentelemetry-collector.agent.containerLogsConfig" $data | fromYaml | mustMergeOverwrite $config }}
{{- $config := include "opentelemetry-collector.agentConfigOverride" $data | fromYaml | mustMergeOverwrite $config }}
{{- .Values.agentCollector.configOverride | mustMergeOverwrite $config | toYaml }}
Expand Down Expand Up @@ -111,7 +121,8 @@ Default config override for agent collector deamonset
exporters:
otlp:
endpoint: {{ include "opentelemetry-collector.fullname" . }}:4317
insecure: true
tls:
insecure: true
{{- end }}

{{- if .Values.standaloneCollector.enabled }}
Expand Down Expand Up @@ -174,11 +185,11 @@ receivers:
# Extract metadata from file path
- type: regex_parser
id: extract_metadata_from_filepath
regex: '^.*\/(?P<namespace>[^_]+)_(?P<pod_name>[^_]+)_(?P<uid>[a-f0-9\-]{36})\/(?P<container_name>[^\._]+)\/(?P<run_id>\d+)\.log$'
parse_from: $$attributes.file_path
regex: '^.*\/(?P<namespace>[^_]+)_(?P<pod_name>[^_]+)_(?P<uid>[a-f0-9\-]+)\/(?P<container_name>[^\._]+)\/(?P<run_id>\d+)\.log$'
parse_from: $$attributes["file.path"]
# Move out attributes to Attributes
- type: metadata
labels:
attributes:
stream: 'EXPR($.stream)'
k8s.container.name: 'EXPR($.container_name)'
k8s.namespace.name: 'EXPR($.namespace)'
Expand Down
1 change: 0 additions & 1 deletion charts/opentelemetry-collector/templates/_pod.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ containers:
- /{{ .Values.command.name }}
- --config=/conf/relay.yaml
- --metrics-addr=0.0.0.0:8888
- --mem-ballast-size-mib={{ template "opentelemetry-collector.getMemBallastSizeMib" .Values.resources.limits.memory }}
{{- range .Values.command.extraArgs }}
- {{ . }}
{{- end }}
Expand Down
8 changes: 5 additions & 3 deletions charts/opentelemetry-collector/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ config:
logging: {}
extensions:
health_check: {}
memory_ballast: {}
processors:
batch: {}
# If set to null, will be overridden with values based on k8s resource limits
Expand Down Expand Up @@ -38,6 +39,7 @@ config:
service:
extensions:
- health_check
- memory_ballast
pipelines:
logs:
exporters:
Expand Down Expand Up @@ -71,16 +73,16 @@ config:
# Can be overridden here or for any component independently using the same keys.

image:
# If you want to use the contrib image `otel/opentelemetry-collector-contrib`, you also need to change `command.name` value to `otelcontribcol`.
repository: otel/opentelemetry-collector
# If you want to use the core image `otel/opentelemetry-collector`, you also need to change `command.name` value to `otelcol`.
repository: otel/opentelemetry-collector-contrib
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: ""
imagePullSecrets: []

# OpenTelemetry Collector executable
command:
name: otelcol
name: otelcontribcol
extraArgs: []

serviceAccount:
Expand Down

0 comments on commit 9846edb

Please sign in to comment.