Skip to content
Merged
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
4 changes: 2 additions & 2 deletions charts/hdx-oss-v2/templates/otel-collector-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ spec:
- containerPort: {{ .Values.otel.httpPort }}
- containerPort: {{ .Values.otel.healthPort }}
env:
- name: CLICKHOUSE_SERVER_ENDPOINT
value: "{{ include "hdx-oss.fullname" . }}-clickhouse:{{ .Values.clickhouse.nativePort }}"
- name: CLICKHOUSE_ENDPOINT
value: "{{ .Values.otel.clickhouseEndpoint | default (printf "tcp://%s-clickhouse:%v?dial_timeout=10s" (include "hdx-oss.fullname" .) .Values.clickhouse.nativePort) }}"
- name: HYPERDX_LOG_LEVEL
value: {{ .Values.hyperdx.logLevel }}
- name: CLICKHOUSE_USER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ should render OTEL collector with custom ports:
spec:
containers:
- env:
- name: CLICKHOUSE_SERVER_ENDPOINT
- name: CLICKHOUSE_ENDPOINT
value: RELEASE-NAME-hdx-oss-v2-clickhouse:9000
- name: HYPERDX_LOG_LEVEL
value: info
Expand Down
38 changes: 38 additions & 0 deletions charts/hdx-oss-v2/tests/otel-collector-custom-clickhouse_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
suite: test OTEL collector with custom clickhouse endpoint
templates:
- otel-collector-deployment.yaml
tests:
- it: should use default Clickhouse endpoint when not specified
set:
otel:
enabled: true
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
equal:
path: spec.template.spec.containers[0].env[0].name
value: CLICKHOUSE_ENDPOINT
- documentIndex: 0
matchRegex:
path: spec.template.spec.containers[0].env[0].value
pattern: "tcp://.*-clickhouse:[0-9]+\\?dial_timeout=10s"

- it: should use custom Clickhouse endpoint when specified
set:
otel:
enabled: true
clickhouseEndpoint: "my-custom-clickhouse:9000"
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: i know this is just for test. the endpoint needs a protocol specified like tcp://

asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
equal:
path: spec.template.spec.containers[0].env[0].name
value: CLICKHOUSE_ENDPOINT
- documentIndex: 0
equal:
path: spec.template.spec.containers[0].env[0].value
value: "my-custom-clickhouse:9000"
2 changes: 2 additions & 0 deletions charts/hdx-oss-v2/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ otel:
httpPort: 4318
healthPort: 8888
enabled: true
# Clickhouse endpoint - defaults to built-in Clickhouse service
clickhouseEndpoint: ""

persistence:
mongodb:
Expand Down