From a3c20417406d63d3e3a3123a6bf74aff3018ba71 Mon Sep 17 00:00:00 2001 From: Helio Frota <00hf11@gmail.com> Date: Wed, 18 Dec 2024 17:35:21 -0300 Subject: [PATCH] fix: (partial) now it connects at least --- README.md | 15 +++++++++++++++ .../templates/helpers/_infrastructure.tpl | 2 ++ charts/trustify/values.schema.json | 4 ++++ charts/trustify/values.schema.yaml | 4 ++++ charts/trustify/values.yaml | 1 + values-importers.yaml | 1 + values-minikube.yaml | 1 + 7 files changed, 28 insertions(+) diff --git a/README.md b/README.md index 66abb4b..8d3888f 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,21 @@ Then deploy the application: helm upgrade --install -n $NAMESPACE trustify charts/trustify --values values-minikube.yaml --set-string appDomain=$APP_DOMAIN ``` +Install the infrastructure services **with traces enabled**: + +```bash +helm upgrade --install --dependency-update -n $NAMESPACE infrastructure charts/trustify-infrastructure --values values-minikube.yaml --set-string keycloak.ingress.hostname=sso$APP_DOMAIN --set-string appDomain=$APP_DOMAIN --set jaeger.enabled=true --set-string jaeger.allInOne.ingress.hosts[0]=jaeger$APP_DOMAIN --set tracing.enabled=true --timeout 10m +``` + +Then deploy the application **with traces enabled**: + +```bash +# Get the collector service name +kubectl get svc +# Install the application +helm upgrade --install -n $NAMESPACE trustify charts/trustify --values values-minikube.yaml --set-string appDomain=$APP_DOMAIN --set tracing.enabled=true --set-string otelCollector="http://infrastructure-jaeger-collector:4317" +``` + ### Kind Create a new cluster: diff --git a/charts/trustify/templates/helpers/_infrastructure.tpl b/charts/trustify/templates/helpers/_infrastructure.tpl index 4dbe009..be510f6 100644 --- a/charts/trustify/templates/helpers/_infrastructure.tpl +++ b/charts/trustify/templates/helpers/_infrastructure.tpl @@ -44,6 +44,8 @@ Arguments (dict): value: parentbased_traceidratio - name: OTEL_TRACES_SAMPLER_ARG value: "0.1" +- name: OTEL_EXPORTER_OTLP_ENDPOINT + value: {{ .root.Values.otelCollector }} {{- end }} {{- end }} diff --git a/charts/trustify/values.schema.json b/charts/trustify/values.schema.json index 7dfab59..0dea2d1 100644 --- a/charts/trustify/values.schema.json +++ b/charts/trustify/values.schema.json @@ -18,6 +18,10 @@ "type": "string", "description": "The base part of the URLs being generated by the chart.\n\nWhen using OpenShift, this should be the application domain, when can be evaluated by running the following\ncommand: `oc -n openshift-ingress-operator get ingresscontrollers.operator.openshift.io default -o jsonpath='{.status.domain}'`.\n" }, + "otelCollector": { + "type": "string", + "description": "OTEL Collector back-end URL. Example: http://localhost:4317\n" + }, "partOf": { "type": "string", "default": "trustify", diff --git a/charts/trustify/values.schema.yaml b/charts/trustify/values.schema.yaml index 2b6c4e6..4a719f3 100644 --- a/charts/trustify/values.schema.yaml +++ b/charts/trustify/values.schema.yaml @@ -20,6 +20,10 @@ properties: When using OpenShift, this should be the application domain, when can be evaluated by running the following command: `oc -n openshift-ingress-operator get ingresscontrollers.operator.openshift.io default -o jsonpath='{.status.domain}'`. + otelCollector: + type: string + description: | + OTEL Collector back-end URL. Example: http://localhost:4317 partOf: type: string diff --git a/charts/trustify/values.yaml b/charts/trustify/values.yaml index a897d41..4afd079 100644 --- a/charts/trustify/values.yaml +++ b/charts/trustify/values.yaml @@ -1,4 +1,5 @@ appDomain: change-me +otelCollector: "http://localhost:4317" partOf: trustify replicas: 1 diff --git a/values-importers.yaml b/values-importers.yaml index 9b478b6..2a9f6ed 100644 --- a/values-importers.yaml +++ b/values-importers.yaml @@ -1,6 +1,7 @@ $schema: "charts/trustify/values.schema.json" appDomain: asdf +otelCollector: "http://localhost:4317" tracing: {} modules: diff --git a/values-minikube.yaml b/values-minikube.yaml index 4a2a822..95b4bdf 100644 --- a/values-minikube.yaml +++ b/values-minikube.yaml @@ -1,4 +1,5 @@ appDomain: change-me +otelCollector: "http://localhost:4317" tracing: {}