From 129daa9d21aeafe904395b310f915524ceb133cc Mon Sep 17 00:00:00 2001 From: Yash Gorana Date: Wed, 4 Sep 2024 11:29:08 +0530 Subject: [PATCH 1/3] [helm] configure otlp endpoint --- packages/grid/backend/grid/start.sh | 9 +-------- packages/grid/devspace.yaml | 5 ++++- packages/grid/helm/examples/dev/base.yaml | 3 ++- .../helm/syft/templates/backend/backend-statefulset.yaml | 6 +++++- packages/grid/helm/syft/values.yaml | 6 +++++- 5 files changed, 17 insertions(+), 12 deletions(-) diff --git a/packages/grid/backend/grid/start.sh b/packages/grid/backend/grid/start.sh index 383e455e408..657e3f41f79 100755 --- a/packages/grid/backend/grid/start.sh +++ b/packages/grid/backend/grid/start.sh @@ -30,18 +30,11 @@ fi if [[ ${TRACING} == "true" ]]; then - echo "OpenTelemetry Enabled" - # TODOs: - # ! Handle case when OTEL_EXPORTER_OTLP_ENDPOINT is not set. - # ! syft-signoz-otel-collector.platform:4317 should be plumbed through helm charts # ? Kubernetes OTel operator is recommended by signoz export OTEL_PYTHON_LOG_CORRELATION=${OTEL_PYTHON_LOG_CORRELATION:-true} - export OTEL_EXPORTER_OTLP_ENDPOINT=${OTEL_EXPORTER_OTLP_ENDPOINT:-"http://syft-signoz-otel-collector.platform:4317"} - export OTEL_EXPORTER_OTLP_PROTOCOL=${OTEL_EXPORTER_OTLP_PROTOCOL:-grpc} - # TODO: uvicorn postfork is not stable with OpenTelemetry - # ROOT_PROC="opentelemetry-instrument" + echo "OpenTelemetry Enabled. Endpoint=$OTEL_EXPORTER_OTLP_ENDPOINT Protocol=$OTEL_EXPORTER_OTLP_PROTOCOL" else echo "OpenTelemetry Disabled" fi diff --git a/packages/grid/devspace.yaml b/packages/grid/devspace.yaml index 2d80cd05eb1..1234ed1e640 100644 --- a/packages/grid/devspace.yaml +++ b/packages/grid/devspace.yaml @@ -130,7 +130,10 @@ profiles: - op: add path: deployments.syft.helm.values.server value: - tracing: true + tracing: + enabled: true + otlpEndpoint: "http://syft-signoz-otel-collector.platform:4317" + otelProtocol: "grpc" - name: bigquery-scenario-tests description: "Deploy a datasite for bigquery scenario testing" diff --git a/packages/grid/helm/examples/dev/base.yaml b/packages/grid/helm/examples/dev/base.yaml index 7ca60412b57..4999ae40aed 100644 --- a/packages/grid/helm/examples/dev/base.yaml +++ b/packages/grid/helm/examples/dev/base.yaml @@ -7,7 +7,8 @@ global: server: rootEmail: info@openmined.org associationRequestAutoApproval: true - tracing: false + tracing: + enabled: false resourcesPreset: null resources: null diff --git a/packages/grid/helm/syft/templates/backend/backend-statefulset.yaml b/packages/grid/helm/syft/templates/backend/backend-statefulset.yaml index 43b67e5557f..67e7f45f2d4 100644 --- a/packages/grid/helm/syft/templates/backend/backend-statefulset.yaml +++ b/packages/grid/helm/syft/templates/backend/backend-statefulset.yaml @@ -143,7 +143,11 @@ spec: value: {{ .Values.seaweedfs.minSizeBlobStorageMB | quote }} # Tracing - name: TRACING - value: {{ .Values.server.tracing | default "False" | quote }} + value: {{ .Values.server.tracing.enabled | default "False" | quote }} + - name: OTEL_EXPORTER_OTLP_ENDPOINT + value: {{ .Values.server.tracing.otlpEndpoint | required "server.tracing.otlpEndpoint is required" | quote }} + - name: OTEL_EXPORTER_OTLP_PROTOCOL + value: {{ .Values.server.tracing.otlpProtocol | default "grpc" | quote }} # Enclave attestation {{- if .Values.attestation.enabled }} - name: ENCLAVE_ATTESTATION_ENABLED diff --git a/packages/grid/helm/syft/values.yaml b/packages/grid/helm/syft/values.yaml index 0f435241e8b..578bc879e69 100644 --- a/packages/grid/helm/syft/values.yaml +++ b/packages/grid/helm/syft/values.yaml @@ -173,7 +173,11 @@ server: debuggerEnabled: false associationRequestAutoApproval: false useInternalRegistry: true - tracing: false + tracing: + enabled: false + # OpenTelemetry Collector endpoint + otlpEndpoint: null + otlpProtocol: grpc # Default Worker pool settings defaultWorkerPool: From 9d04be3e99501f46ca5d003e315f2953e9db909a Mon Sep 17 00:00:00 2001 From: Yash Gorana Date: Wed, 4 Sep 2024 11:43:17 +0530 Subject: [PATCH 2/3] [helm] fix template error --- .../grid/helm/syft/templates/backend/backend-statefulset.yaml | 2 ++ packages/grid/helm/syft/values.yaml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/grid/helm/syft/templates/backend/backend-statefulset.yaml b/packages/grid/helm/syft/templates/backend/backend-statefulset.yaml index 67e7f45f2d4..3293056ba2a 100644 --- a/packages/grid/helm/syft/templates/backend/backend-statefulset.yaml +++ b/packages/grid/helm/syft/templates/backend/backend-statefulset.yaml @@ -141,6 +141,7 @@ spec: {{- end }} - name: MIN_SIZE_BLOB_STORAGE_MB value: {{ .Values.seaweedfs.minSizeBlobStorageMB | quote }} + {{- if .Values.server.tracing.enabled }} # Tracing - name: TRACING value: {{ .Values.server.tracing.enabled | default "False" | quote }} @@ -148,6 +149,7 @@ spec: value: {{ .Values.server.tracing.otlpEndpoint | required "server.tracing.otlpEndpoint is required" | quote }} - name: OTEL_EXPORTER_OTLP_PROTOCOL value: {{ .Values.server.tracing.otlpProtocol | default "grpc" | quote }} + {{- end }} # Enclave attestation {{- if .Values.attestation.enabled }} - name: ENCLAVE_ATTESTATION_ENABLED diff --git a/packages/grid/helm/syft/values.yaml b/packages/grid/helm/syft/values.yaml index 578bc879e69..fe0db497b98 100644 --- a/packages/grid/helm/syft/values.yaml +++ b/packages/grid/helm/syft/values.yaml @@ -176,7 +176,7 @@ server: tracing: enabled: false # OpenTelemetry Collector endpoint - otlpEndpoint: null + otlpEndpoint: "" otlpProtocol: grpc # Default Worker pool settings From e7bbcc7874b4830b6f78d34f867e2f46a372dc02 Mon Sep 17 00:00:00 2001 From: Yash Gorana Date: Wed, 4 Sep 2024 11:45:52 +0530 Subject: [PATCH 3/3] [backend] drop echo --- packages/grid/backend/grid/start.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/grid/backend/grid/start.sh b/packages/grid/backend/grid/start.sh index 657e3f41f79..ace8d76e455 100755 --- a/packages/grid/backend/grid/start.sh +++ b/packages/grid/backend/grid/start.sh @@ -12,8 +12,6 @@ APPDIR=${APPDIR:-$HOME/app} RELOAD="" ROOT_PROC="" -echo "Starting with TRACING=${TRACING}" - if [[ ${DEV_MODE} == "True" ]]; then echo "Hot-reload Enabled" @@ -33,7 +31,6 @@ then # TODOs: # ? Kubernetes OTel operator is recommended by signoz export OTEL_PYTHON_LOG_CORRELATION=${OTEL_PYTHON_LOG_CORRELATION:-true} - echo "OpenTelemetry Enabled. Endpoint=$OTEL_EXPORTER_OTLP_ENDPOINT Protocol=$OTEL_EXPORTER_OTLP_PROTOCOL" else echo "OpenTelemetry Disabled"