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
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,43 @@ ingress:
pathType: ImplementationSpecific
```

## Post-Installation: Configuring Telemetry API Key

After successfully deploying HyperDX, you'll need to configure the API key to enable the app's telemetry data collection:

1. **Access your HyperDX instance** via the configured ingress or service endpoint
2. **Log into the HyperDX dashboard** and navigate to Team settings to generate or retrieve your API key
3. **Update your deployment** with the API key using one of the following methods:

### Method 1: Update via Helm upgrade with values file

Add the API key to your `values.yaml`:

```yaml
hyperdx:
apiKey: "your-api-key-here"
```

Then upgrade your deployment:

```sh
helm upgrade my-hyperdx hyperdx/hdx-oss-v2 -f values.yaml
```

### Method 2: Update via Helm upgrade with --set flag

```sh
helm upgrade my-hyperdx hyperdx/hdx-oss-v2 --set hyperdx.apiKey="your-api-key-here"
```

**Important:** After updating the API key, you need to restart the pods to pick up the new configuration:

```sh
kubectl rollout restart deployment my-hyperdx-hdx-oss-v2-app my-hyperdx-hdx-oss-v2-otel-collector
```

**Note:** The chart automatically creates a Kubernetes secret (`<release-name>-app-secrets`) with your API key. No additional secret configuration is needed unless you want to use an external secret.

## Using Secrets

For handling sensitive data such as API keys or database credentials, use Kubernetes secrets. The HyperDX Helm charts provide default secret files that you can modify and apply to your cluster.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ metadata:
spec:
accessModes:
- ReadWriteOnce
{{- if .Values.global.storageClass }}
storageClassName: {{ .Values.global.storageClass }}
{{- end }}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this prevented chart upgrades

resources:
requests:
storage: {{ .Values.persistence.mongodb.size }}
Expand Down
4 changes: 4 additions & 0 deletions charts/hdx-oss-v2/templates/clickhouse-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ metadata:
spec:
accessModes:
- ReadWriteOnce
{{- if .Values.global.storageClass }}
storageClassName: {{ .Values.global.storageClass }}
{{- end }}
resources:
requests:
storage: {{ .Values.clickhouse.persistence.dataSize }}
Expand All @@ -119,7 +121,9 @@ metadata:
spec:
accessModes:
- ReadWriteOnce
{{- if .Values.global.storageClass }}
storageClassName: {{ .Values.global.storageClass }}
{{- end }}
resources:
requests:
storage: {{ .Values.clickhouse.persistence.logSize }}
Expand Down
2 changes: 2 additions & 0 deletions charts/hdx-oss-v2/templates/hyperdx-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ spec:
containerPort: {{ .Values.hyperdx.appPort }}
- name: api-port
containerPort: {{ .Values.hyperdx.apiPort }}
- name: opamp-port
containerPort: {{ .Values.hyperdx.opampPort }}
envFrom:
- configMapRef:
name: {{ include "hdx-oss.fullname" . }}-app-config
Expand Down
3 changes: 3 additions & 0 deletions charts/hdx-oss-v2/templates/hyperdx-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ spec:
- port: {{ .Values.hyperdx.appPort }}
targetPort: {{ .Values.hyperdx.appPort }}
name: app
- port: {{ .Values.hyperdx.opampPort }}
targetPort: {{ .Values.hyperdx.opampPort }}
name: opamp
selector:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

expose opamp port in the service

{{- include "hdx-oss.selectorLabels" . | nindent 4 }}
app: {{ include "hdx-oss.fullname" . }}
4 changes: 3 additions & 1 deletion charts/hdx-oss-v2/templates/otel-collector-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ spec:
value: "{{ .Values.otel.clickhousePrometheusEndpoint | default (printf "%s-clickhouse:%v" (include "hdx-oss.fullname" .) .Values.clickhouse.prometheus.port ) }}"
{{- end }}
- name: OPAMP_SERVER_URL
value: {{ .Values.otel.opampServerUrl | default (printf "%s-app:%v" (include "hdx-oss.fullname" .) .Values.hyperdx.opampPort ) }}
value: {{ .Values.otel.opampServerUrl | default (printf "http://%s-app:%v" (include "hdx-oss.fullname" .) .Values.hyperdx.opampPort ) }}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

value was missing http protocol in default value

- name: HYPERDX_LOG_LEVEL
value: {{ .Values.hyperdx.logLevel }}
- name: HYPERDX_OTEL_EXPORTER_CLICKHOUSE_DATABASE
value: {{ .Values.hyperdx.clickhouseDatabase | default "default" }}
- name: HYPERDX_API_KEY
valueFrom:
secretKeyRef:
Expand Down
40 changes: 39 additions & 1 deletion charts/hdx-oss-v2/tests/clickhouse-deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,42 @@ tests:
of: PersistentVolumeClaim
- documentIndex: 5
isKind:
of: PersistentVolumeClaim
of: PersistentVolumeClaim

- it: should include storageClassName when global.storageClass is set
set:
global:
storageClass: "fast-ssd"
clickhouse:
enabled: true
persistence:
enabled: true
dataSize: 10Gi
logSize: 5Gi
asserts:
- documentIndex: 4
equal:
path: spec.storageClassName
value: "fast-ssd"
- documentIndex: 5
equal:
path: spec.storageClassName
value: "fast-ssd"

- it: should omit storageClassName when global.storageClass is empty
set:
global:
storageClass: ""
clickhouse:
enabled: true
persistence:
enabled: true
dataSize: 10Gi
logSize: 5Gi
asserts:
- documentIndex: 4
isNull:
path: spec.storageClassName
- documentIndex: 5
isNull:
path: spec.storageClassName
23 changes: 22 additions & 1 deletion charts/hdx-oss-v2/tests/hyperdx-deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ tests:
- equal:
path: spec.template.spec.containers[0].ports[1].containerPort
value: 8000
- equal:
path: spec.template.spec.containers[0].ports[2].containerPort
value: 4320
- isSubset:
path: spec.template.spec.containers[0].envFrom[0]
content:
Expand Down Expand Up @@ -85,4 +88,22 @@ tests:
path: spec.template.spec.containers[0].env
content:
name: ANOTHER_ENV
value: "another-value"
value: "another-value"

- it: should expose OpAMP container port with default values
asserts:
- equal:
path: spec.template.spec.containers[0].ports[2].containerPort
value: 4320
- equal:
path: spec.template.spec.containers[0].ports[2].name
value: opamp-port

- it: should use custom OpAMP port when provided
set:
hyperdx:
opampPort: 5320
asserts:
- equal:
path: spec.template.spec.containers[0].ports[2].containerPort
value: 5320
26 changes: 25 additions & 1 deletion charts/hdx-oss-v2/tests/hyperdx-service_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,28 @@ tests:
asserts:
- matchRegex:
path: spec.selector.app
pattern: ^RELEASE-NAME-hdx-oss-v2$
pattern: ^RELEASE-NAME-hdx-oss-v2$

- it: should expose OpAMP port with default values
asserts:
- equal:
path: spec.ports[1].port
value: 4320
- equal:
path: spec.ports[1].targetPort
value: 4320
- equal:
path: spec.ports[1].name
value: opamp

- it: should use custom OpAMP port when provided
set:
hyperdx:
opampPort: 5320
asserts:
- equal:
path: spec.ports[1].port
value: 5320
- equal:
path: spec.ports[1].targetPort
value: 5320
82 changes: 81 additions & 1 deletion charts/hdx-oss-v2/tests/otel-collector_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ tests:
content:
name: CLICKHOUSE_PASSWORD
value: test-password
- documentIndex: 0
contains:
path: spec.template.spec.containers[0].env
content:
name: OPAMP_SERVER_URL
value: http://test-release-hdx-oss-v2-app:4320

- it: should render environment variables correctly with custom clickhouse endpoint
set:
Expand Down Expand Up @@ -276,4 +282,78 @@ tests:
notContains:
path: spec.template.spec.containers[0].env
content:
name: CLICKHOUSE_PROMETHEUS_METRICS_ENDPOINT
name: CLICKHOUSE_PROMETHEUS_METRICS_ENDPOINT

- it: should render OPAMP_SERVER_URL with custom value when specified
set:
otel:
enabled: true
image: hyperdx/hyperdx-otel-collector:2-beta
opampServerUrl: "https://custom-opamp-server:8080"
hyperdx:
logLevel: info
clickhouse:
config:
users:
otelUserPassword: test-password
release:
name: test-release
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
contains:
path: spec.template.spec.containers[0].env
content:
name: OPAMP_SERVER_URL
value: "https://custom-opamp-server:8080"

- it: should use default clickhouse database when not specified
set:
otel:
enabled: true
image: hyperdx/hyperdx-otel-collector:2-beta
hyperdx:
logLevel: info
clickhouse:
config:
users:
otelUserPassword: test-password
release:
name: test-release
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
contains:
path: spec.template.spec.containers[0].env
content:
name: HYPERDX_OTEL_EXPORTER_CLICKHOUSE_DATABASE
value: "default"

- it: should use custom clickhouse database when specified
set:
otel:
enabled: true
image: hyperdx/hyperdx-otel-collector:2-beta
hyperdx:
logLevel: info
clickhouseDatabase: "custom_db"
clickhouse:
config:
users:
otelUserPassword: test-password
release:
name: test-release
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
contains:
path: spec.template.spec.containers[0].env
content:
name: HYPERDX_OTEL_EXPORTER_CLICKHOUSE_DATABASE
value: "custom_db"
16 changes: 15 additions & 1 deletion charts/hdx-oss-v2/tests/persistence_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,18 @@ tests:
enabled: false
asserts:
- hasDocuments:
count: 0
count: 0

- it: should omit storageClassName when global.storageClass is empty string
set:
global:
storageClass: ""
persistence:
mongodb:
enabled: true
size: 10Gi
asserts:
- isKind:
of: PersistentVolumeClaim
- isNull:
path: spec.storageClassName
28 changes: 27 additions & 1 deletion charts/hdx-oss-v2/tests/pvc_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,30 @@ tests:
enabled: false
asserts:
- hasDocuments:
count: 0
count: 0

- it: should not include storageClassName when global.storageClass is empty
set:
persistence:
mongodb:
enabled: true
size: 10Gi
global:
storageClass: ""
asserts:
- isKind:
of: PersistentVolumeClaim
- isNull:
path: spec.storageClassName

- it: should not include storageClassName when global.storageClass is not set
set:
persistence:
mongodb:
enabled: true
size: 10Gi
asserts:
- isKind:
of: PersistentVolumeClaim
- isNull:
path: spec.storageClassName
4 changes: 3 additions & 1 deletion charts/hdx-oss-v2/values.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
global:
imageRegistry: ""
imagePullSecrets: []
storageClassName: []
storageClassName: "local-path"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

bad default value...should be a string. industry standard is "local-path" as a default


hyperdx:
image: "hyperdx/hyperdx:2-beta"
Expand All @@ -14,6 +14,8 @@ hyperdx:
usageStatsEnabled: true
# Endpoint to send hyperdx logs/traces/metrics to.Defaults to the chart's otel collector endpoint.
otelExporterEndpoint: http://{{ include "hdx-oss.fullname" . }}-otel-collector:{{ .Values.otel.httpPort }}
# Clickhouse database to send logs/traces/metrics to. Defaults to "default"
clickhouseDatabase: "default"
annotations: {}
# myAnnotation: "myValue"
labels: {}
Expand Down