Skip to content
Open
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
1 change: 1 addition & 0 deletions charts/sourcegraph/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ In addition to the documented values, all services also support the following va
| openTelemetry.enabled | bool | `true` | |
| openTelemetry.gateway.config.traces.exporters | object | `{}` | Define where traces should be exported to. Read how to configure different backends in the [OpenTelemetry documentation](https://opentelemetry.io/docs/collector/configuration/#exporters) |
| openTelemetry.gateway.config.traces.exportersTlsSecretName | string | `""` | Define the name of a preexisting secret containing TLS certificates for exporters, which will be mounted under "/tls". Read more about TLS configuration of exporters in the [OpenTelemetry Collector documentation](https://github.com/open-telemetry/opentelemetry-collector/blob/main/config/configtls/README.md) |
| openTelemetry.gateway.config.traces.processorOrderedList | list | `[]` | Define the order in which trace processors run in the pipeline. When set, this takes precedence over the iteration order of `processors` (which cannot be relied on to preserve insertion order). Must contain exactly the same processor names as the keys of `processors`. |
| openTelemetry.gateway.config.traces.processors | object | `{}` | Define trace processors. Read how to configure sampling in the [OpenTelemetry documentation](https://docs.sourcegraph.com/admin/observability/opentelemetry#sampling-traces) |
| openTelemetry.gateway.containerSecurityContext.allowPrivilegeEscalation | bool | `false` | |
| openTelemetry.gateway.containerSecurityContext.runAsGroup | int | `101` | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,15 @@ data:
- otlp
{{- if .Values.openTelemetry.gateway.config.traces.processors }}
processors:
{{- if .Values.openTelemetry.gateway.config.traces.processorOrderedList }}
Comment on lines 45 to +47

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

doesn't this mean without processors, processorOrderedList does not work?

{{- range .Values.openTelemetry.gateway.config.traces.processorOrderedList }}
- {{ . }}
{{- end }}
{{- else }}
{{- range $key, $val := .Values.openTelemetry.gateway.config.traces.processors }}
- {{ $key }}
{{- end }}
{{- end }}
Comment on lines +47 to +55

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should processors and processorOrderedList be mutually exclusive? Curious why we shouldn't deprecate processors or simply change its shape as processors is effectively buggy it seems

{{- end }}
exporters:
{{- range $key, $val := .Values.openTelemetry.gateway.config.traces.exporters }}
Expand Down
72 changes: 72 additions & 0 deletions charts/sourcegraph/tests/otelCollectorProcessors_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
suite: otelCollectorProcessors
templates:
- otel-collector/otel-collector.ConfigMap.yaml
set:
openTelemetry:
gateway:
config:
traces:
exporters:
otlp:
endpoint: "otlp.service.com:443"
tests:
- it: should not render a processors section when none are configured
asserts:
- notMatchRegex:
path: data["config.yaml"]
pattern: "processors:"
- it: should order pipeline processors by map key when processorOrderedList is not set
set:
openTelemetry:
gateway:
config:
traces:
processors:
memory_limiter:
check_interval: 1s
batch:
timeout: 1s
asserts:
- matchRegex:
path: data["config.yaml"]
pattern: "processors:\\s*\\n\\s*- batch\\s*\\n\\s*- memory_limiter"
- it: should order pipeline processors using processorOrderedList when set
set:
openTelemetry:
gateway:
config:
traces:
processors:
memory_limiter:
check_interval: 1s
batch:
timeout: 1s
processorOrderedList:
- memory_limiter
- batch
asserts:
- matchRegex:
path: data["config.yaml"]
pattern: "processors:\\s*\\n\\s*- memory_limiter\\s*\\n\\s*- batch"
- it: should still define processor configs regardless of ordering source
set:
openTelemetry:
gateway:
config:
traces:
processors:
memory_limiter:
check_interval: 1s
batch:
timeout: 1s
processorOrderedList:
- memory_limiter
- batch
asserts:
- matchRegex:
path: data["config.yaml"]
pattern: "check_interval: 1s"
- matchRegex:
path: data["config.yaml"]
pattern: "timeout: 1s"
4 changes: 4 additions & 0 deletions charts/sourcegraph/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,10 @@ openTelemetry:
# -- Define trace processors.
# Read how to configure sampling in the [OpenTelemetry documentation](https://docs.sourcegraph.com/admin/observability/opentelemetry#sampling-traces)
processors: {}
# -- Define the order in which trace processors run in the pipeline. When set, this takes
# precedence over the iteration order of `processors` (which cannot be relied on to preserve
# insertion order). Must contain exactly the same processor names as the keys of `processors`.
processorOrderedList: []
# -- Define where traces should be exported to.
# Read how to configure different backends in the [OpenTelemetry documentation](https://opentelemetry.io/docs/collector/configuration/#exporters)
exporters: {}
Expand Down
Loading