Skip to content

Commit

Permalink
fix: default.metrics source is not imported when metrics are disabled…
Browse files Browse the repository at this point in the history
… and traces are enabled
  • Loading branch information
Przemek Delewski committed Oct 5, 2022
1 parent bdd4e85 commit 5815fcb
Show file tree
Hide file tree
Showing 6 changed files with 646 additions and 2 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- fix(logs): prevent Fluent Bit from doing metadata enrichment [#2512]
- chore(kube-prometheus-stack): update kube-prometheus-stack chart to 39.11.0 [#2446]

### Added

### Changed

- chore: upgrade nginx to 1.23 [#2544]
- feat: enable remote write proxy by default [#2483]
- chore: update kubernetes-tools to 2.13.0 [#2515]
- feat(metadata): upgrade otelcol to v0.57.2-sumo-1 [#2526]

### Fixed

- fix(openshift): fix remote write proxy - use unprivileged NGINX [#2510][#2510]
- fix: default.metrics source is not imported when metrics are disabled and traces are enabled

[#2483]: https://github.com/SumoLogic/sumologic-kubernetes-collection/pull/2483
[#2512]: https://github.com/SumoLogic/sumologic-kubernetes-collection/pull/2512
[#2446]: https://github.com/SumoLogic/sumologic-kubernetes-collection/pull/2446
[#2515]: https://github.com/SumoLogic/sumologic-kubernetes-collection/pull/2515
[#2510]: https://github.com/SumoLogic/sumologic-kubernetes-collection/pull/2510
[#2526]: https://github.com/SumoLogic/sumologic-kubernetes-collection/pull/2526
[#2544]: https://github.com/SumoLogic/sumologic-kubernetes-collection/pull/2544
[#2547]: https://github.com/SumoLogic/sumologic-kubernetes-collection/pull/2547
[Unreleased]: https://github.com/SumoLogic/sumologic-kubernetes-collection/compare/v2.17.0...main

## [v2.17.0]
Expand Down
7 changes: 7 additions & 0 deletions deploy/helm/sumologic/conf/setup/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,13 @@ true # prevent to render empty if; then
terraform import sumologic_http_source.{{ template "terraform.sources.name" (dict "Name" $key "Type" $type) }} "${COLLECTOR_NAME}/{{ $source.name }}"
{{- end }}
{{- end }}
{{- else if and (eq $type "metrics") $ctx.sumologic.traces.enabled }}
{{- /*
If traces are enabled and metrics are disabled, create default metrics source anyway
*/}}
{{- if hasKey $sources "default" }}
terraform import sumologic_http_source.{{ template "terraform.sources.name" (dict "Name" "default" "Type" $type) }} "${COLLECTOR_NAME}/{{ $sources.default.name }}"
{{- end }}
{{- end }}
{{- end }}
fi
Expand Down
1 change: 1 addition & 0 deletions tests/helm/terraform/static/traces.output.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,7 @@ data:
# Only import sources when collector exists.
if terraform import sumologic_collector.collector "${COLLECTOR_NAME}"; then
true # prevent to render empty if; then
terraform import sumologic_http_source.default_metrics_source "${COLLECTOR_NAME}/(default-metrics)"
terraform import sumologic_http_source.default_traces_source "${COLLECTOR_NAME}/traces"
fi
Expand Down
3 changes: 3 additions & 0 deletions tests/helm/tracing-metrics-disabled/config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

export TEST_TEMPLATE="templates/setup/configmap.yaml"
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
metrics:
enabled: false
traces:
enabled: true
Loading

0 comments on commit 5815fcb

Please sign in to comment.