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/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Use `**BREAKING**:` to denote a breaking change

## Unreleased

- Added support for ordering trace processors via `openTelemetry.gateway.config.traces.tracePipelineProcessors`, falling back to processors ordered by name when unset
- Removed the unused executor controller `/data` PersistentVolumeClaim from the Kubernetes-native executor chart (`sourcegraph-executor/k8s`), along with the now-orphaned `storageClass` and `executor.storageSize` values and the vestigial `EXECUTOR_KUBERNETES_PERSISTENCE_VOLUME_NAME` env var. Since single-job-pod became the only k8s execution mode, job pods use their own ephemeral `emptyDir` volume and the controller writes nothing to `/data`.
- Removed the non-functional `executor.replicas` value from the Kubernetes-native executor chart; the controller is a singleton (it pins Job pods to its own node), so `replicas > 1` never worked.
- Added support for overriding `replicaCount` per dedicated `worker` replica via `worker.replicas[].replicaCount`, falling back to `worker.replicaCount` when unset
Expand Down
1 change: 1 addition & 0 deletions charts/sourcegraph/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ In addition to the documented values, all services also support the following va
| 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.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.config.traces.tracePipelineProcessors | list | `[]` | Define the order in which processors are applied in the traces 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.containerSecurityContext.allowPrivilegeEscalation | bool | `false` | |
| openTelemetry.gateway.containerSecurityContext.runAsGroup | int | `101` | |
| openTelemetry.gateway.containerSecurityContext.runAsUser | int | `100` | |
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.tracePipelineProcessors }}
{{- range .Values.openTelemetry.gateway.config.traces.tracePipelineProcessors }}
- {{ . }}
{{- end }}
{{- else }}
{{- range $key, $val := .Values.openTelemetry.gateway.config.traces.processors }}
- {{ $key }}
{{- end }}
{{- end }}
{{- 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 tracePipelineProcessors 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 tracePipelineProcessors when set
set:
openTelemetry:
gateway:
config:
traces:
processors:
memory_limiter:
check_interval: 1s
batch:
timeout: 1s
tracePipelineProcessors:
- 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
tracePipelineProcessors:
- memory_limiter
- batch
asserts:
- matchRegex:
path: data["config.yaml"]
pattern: "check_interval: 1s"
- matchRegex:
path: data["config.yaml"]
pattern: "timeout: 1s"
5 changes: 5 additions & 0 deletions charts/sourcegraph/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,11 @@ 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 processors are applied in the traces 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`.
tracePipelineProcessors: []
# -- 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