Skip to content

Commit

Permalink
chore: upgrade otelcol for otellogs to 0.66.0-sumo-0
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikołaj Świątek committed Dec 14, 2022
1 parent 74fcf72 commit 413d273
Show file tree
Hide file tree
Showing 7 changed files with 134 additions and 194 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- chore: upgrade otelcol to 0.66.0-sumo-0 [#2686] [#2687] [#2693]
- chore: upgrade otelcol to 0.66.0-sumo-0 [#2686] [#2687] [#2692] [#2693]
- chore: upgrade nginx to 1.23.1 [#2544] [#2554]
- feat: enable remote write proxy by default [#2483]
- chore: update kubernetes-tools to 2.13.0 [#2515]
Expand Down Expand Up @@ -165,6 +165,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[#2686]: https://github.com/SumoLogic/sumologic-kubernetes-collection/pull/2686
[#2687]: https://github.com/SumoLogic/sumologic-kubernetes-collection/pull/2687
[#2693]: https://github.com/SumoLogic/sumologic-kubernetes-collection/pull/2693
[#2692]: https://github.com/SumoLogic/sumologic-kubernetes-collection/pull/2692
[v3.0.0-beta.0]: https://github.com/SumoLogic/sumologic-kubernetes-collection/compare/v2.17.0...v3.0.0-beta.0
[telegraf_operator_comapare_1.3.5_and_1.3.10]: https://github.com/influxdata/helm-charts/compare/telegraf-operator-1.3.5...telegraf-operator-1.3.10
[cert-manager-1.4]: https://github.com/cert-manager/cert-manager/releases/tag/v1.4.0
Expand Down
2 changes: 1 addition & 1 deletion deploy/helm/sumologic/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4145,7 +4145,7 @@ otellogs:
## Configure image for Opentelemetry Collector
image:
repository: "public.ecr.aws/sumologic/sumologic-otel-collector"
tag: "0.54.0-sumo-0"
tag: "0.66.0-sumo-0"
pullPolicy: IfNotPresent

logLevel: info
Expand Down
16 changes: 0 additions & 16 deletions tests/helm/logs_otc/static/merge.input.yaml

This file was deleted.

174 changes: 0 additions & 174 deletions tests/helm/logs_otc/static/merge.output.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion tests/helm/logs_otc_daemonset/static/basic.output.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ spec:
containers:
- args:
- --config=/etc/otelcol/config.yaml
image: public.ecr.aws/sumologic/sumologic-otel-collector:0.54.0-sumo-0
image: public.ecr.aws/sumologic/sumologic-otel-collector:0.66.0-sumo-0
imagePullPolicy: IfNotPresent
name: otelcol
livenessProbe:
Expand Down
2 changes: 1 addition & 1 deletion tests/helm/logs_otc_daemonset/static/complex.output.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ spec:
containers:
- args:
- --config=/etc/otelcol/config.yaml
image: public.ecr.aws/sumologic/sumologic-otel-collector:0.54.0-sumo-0
image: public.ecr.aws/sumologic/sumologic-otel-collector:0.66.0-sumo-0
imagePullPolicy: IfNotPresent
name: otelcol
livenessProbe:
Expand Down
129 changes: 129 additions & 0 deletions tests/helm/logs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,132 @@ sumologic:
require.NotContains(t, processorName, "kubelet")
}
}

func TestCollectorOtelConfigMerge(t *testing.T) {
t.Parallel()
templatePath := "templates/logs/collector/otelcol/configmap.yaml"
valuesYaml := `
otellogs:
config:
merge:
processors:
batch:
send_batch_size: 7
`
otelConfigYaml := GetOtelConfigYaml(t, valuesYaml, templatePath)

var otelConfig struct {
Processors struct {
Batch struct {
SendBatchSize int `yaml:"send_batch_size"`
}
}
}
err := yaml.Unmarshal([]byte(otelConfigYaml), &otelConfig)
require.NoError(t, err)

require.Equal(t, 7, otelConfig.Processors.Batch.SendBatchSize)
}

func TestCollectorOtelConfigOverride(t *testing.T) {
t.Parallel()
templatePath := "templates/logs/collector/otelcol/configmap.yaml"
valuesYaml := `
otellogs:
config:
override:
key: value
`
otelConfigYaml := GetOtelConfigYaml(t, valuesYaml, templatePath)

var otelConfig map[string]string
err := yaml.Unmarshal([]byte(otelConfigYaml), &otelConfig)
require.NoError(t, err)

expected := map[string]string{"key": "value"}
require.Equal(t, expected, otelConfig)
}

func TestCollectorOtelConfigSystemdDisabled(t *testing.T) {
t.Parallel()
templatePath := "templates/logs/collector/otelcol/configmap.yaml"
valuesYaml := `
sumologic:
logs:
systemd:
enabled: false
`
otelConfigYaml := GetOtelConfigYaml(t, valuesYaml, templatePath)

var otelConfig struct {
Receivers map[string]interface{}
Processors map[string]interface{}
Service struct {
Pipelines map[string]interface{}
}
}
err := yaml.Unmarshal([]byte(otelConfigYaml), &otelConfig)
require.NoError(t, err)

require.ElementsMatch(t, []string{"filelog/containers"}, keys(otelConfig.Receivers))
require.ElementsMatch(t, []string{"logs/containers"}, keys(otelConfig.Service.Pipelines))
for processorName := range otelConfig.Processors {
require.NotContains(t, processorName, "systemd")
require.NotContains(t, processorName, "kubelet")
}
}

func TestCollectorOtelConfigMultilineDisabled(t *testing.T) {
t.Parallel()
templatePath := "templates/logs/collector/otelcol/configmap.yaml"
valuesYaml := `
sumologic:
logs:
multiline:
enabled: false
`
otelConfigYaml := GetOtelConfigYaml(t, valuesYaml, templatePath)

var otelConfig struct {
Receivers struct {
Filelog struct {
Operators []struct {
Id string
Type string
Output string
}
} `yaml:"filelog/containers"`
}
}
err := yaml.Unmarshal([]byte(otelConfigYaml), &otelConfig)
require.NoError(t, err)

for _, operator := range otelConfig.Receivers.Filelog.Operators {
require.NotEqual(t, "merge-multiline-logs", operator.Id)
}
}

func TestCollectorOtelConfigSystemdUnits(t *testing.T) {
t.Parallel()
templatePath := "templates/logs/collector/otelcol/configmap.yaml"
valuesYaml := `
sumologic:
logs:
systemd:
units:
- test
`
otelConfigYaml := GetOtelConfigYaml(t, valuesYaml, templatePath)

var otelConfig struct {
Receivers struct {
Journald struct {
Units []string
}
}
}
err := yaml.Unmarshal([]byte(otelConfigYaml), &otelConfig)
require.NoError(t, err)

require.Equal(t, []string{"test"}, otelConfig.Receivers.Journald.Units)
}

0 comments on commit 413d273

Please sign in to comment.