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
77 changes: 42 additions & 35 deletions docs/en/installing/installing-distributed-tracing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Jaeger v2 is deployed as an `OpenTelemetryCollector` custom resource managed by

2. Retrieve platform configuration and Jaeger-related container images from the cluster:

```bash
```bash {name=install-tracing:get-platform-config}
export PLATFORM_URL=$(kubectl -nkube-public get configmap global-info -o jsonpath='{.data.platformURL}')
export CLUSTER_NAME=$(kubectl -nkube-public get configmap global-info -o jsonpath='{.data.clusterName}')
export ALB_CLASS_NAME=$(kubectl -nkube-public get configmap global-info -o jsonpath='{.data.systemAlbIngressClassName}')
Expand Down Expand Up @@ -77,7 +77,7 @@ Jaeger v2 is deployed as an `OpenTelemetryCollector` custom resource managed by

3. Set default environment variables. You can adjust these values to match your deployment requirements:

```bash
```bash {name=install-tracing:set-jaeger-defaults}
# Namespace for the Jaeger instance
export JAEGER_NS="jaeger-system"
# Name of the Jaeger instance
Expand All @@ -90,24 +90,25 @@ Jaeger v2 is deployed as an `OpenTelemetryCollector` custom resource managed by

4. Create the Jaeger namespace and Elasticsearch credentials Secret:

```bash
kubectl create namespace ${JAEGER_NS}
```bash {name=install-tracing:create-jaeger-ns-and-es-secret}
kubectl get namespace ${JAEGER_NS} &> /dev/null || kubectl create namespace ${JAEGER_NS}

kubectl create secret generic es-credentials \
--namespace=${JAEGER_NS} \
--from-literal=ES_USER=${ES_USER} \
--from-literal=ES_PASS=${ES_PASS}
--from-literal=ES_PASS=${ES_PASS} \
--dry-run=client -o yaml | kubectl apply -f -
```

Verify that the Secret was created:

```bash
```bash {name=install-tracing:verify-es-secret}
kubectl get secret es-credentials -n ${JAEGER_NS}
```

5. Create an [ILM (Index Lifecycle Management) Policy](../configuration/storage-backends/elasticsearch.mdx#ilm-support) in Elasticsearch. Jaeger uses ILM to manage index rollover and retention:

```bash
```bash {name=install-tracing:create-ilm-policy}
curl -k -u "${ES_USER}:${ES_PASS}" -X PUT \
"${ES_ENDPOINT}/_ilm/policy/jaeger-ilm-policy" \
-H 'Content-Type: application/json' \
Expand Down Expand Up @@ -147,15 +148,15 @@ Jaeger v2 is deployed as an `OpenTelemetryCollector` custom resource managed by

Verify the ILM Policy:

```bash
```bash {name=install-tracing:verify-ilm-policy}
curl -k -u "${ES_USER}:${ES_PASS}" "${ES_ENDPOINT}/_ilm/policy/jaeger-ilm-policy?pretty"
```

The output should display the ILM Policy details, including the `hot` and `delete` phases.

6. [Initialize](../configuration/storage-backends/elasticsearch.mdx#index-rollover) index aliases and templates using the `jaeger-es-rollover` tool. This prepares Elasticsearch for Jaeger data storage:

```bash
```bash {name=install-tracing:create-rollover-init-job}
kubectl apply -n ${JAEGER_NS} -f - <<EOF
apiVersion: batch/v1
kind: Job
Expand Down Expand Up @@ -196,7 +197,7 @@ Jaeger v2 is deployed as an `OpenTelemetryCollector` custom resource managed by

Wait for the Job to complete, then verify that the index templates and aliases were created:

```bash
```bash {name=install-tracing:verify-rollover-init}
kubectl wait --for=condition=complete job/jaeger-es-rollover-init \
-n ${JAEGER_NS} --timeout=120s

Expand All @@ -216,25 +217,26 @@ Jaeger v2 is deployed as an `OpenTelemetryCollector` custom resource managed by

7. Clean up the initialization Job after it completes:

```bash
```bash {name=install-tracing:delete-rollover-init-job}
kubectl delete job jaeger-es-rollover-init -n ${JAEGER_NS}
```

8. Create a Secret for the OAuth2 Proxy, which is used to integrate the Jaeger UI with the Alauda Container Platform authentication:

```bash
```bash {name=install-tracing:create-oauth2-proxy-secret}
# Generate a cookie secret for the OAuth2 Proxy:
OAUTH2_PROXY_COOKIE_SECRET=$(dd if=/dev/urandom bs=32 count=1 2>/dev/null | base64 | tr -d -- '\n' | tr -- '+/' '-_')
# Create the Secret:
kubectl create secret generic ${JAEGER_INSTANCE_NAME}-oauth2-proxy \
--namespace=${JAEGER_NS} \
--from-literal=OAUTH2_PROXY_CLIENT_SECRET=${OIDC_CLIENT_SECRET} \
--from-literal=OAUTH2_PROXY_COOKIE_SECRET=${OAUTH2_PROXY_COOKIE_SECRET}
--from-literal=OAUTH2_PROXY_COOKIE_SECRET=${OAUTH2_PROXY_COOKIE_SECRET} \
--dry-run=client -o yaml | kubectl apply -f -
```

9. Create a file named `jaeger.yaml` with the following content:

```yaml title="jaeger.yaml"
```yaml title="jaeger.yaml" {name=install-tracing:jaeger-yaml}
apiVersion: opentelemetry.io/v1beta1
kind: OpenTelemetryCollector
metadata:
Expand Down Expand Up @@ -430,24 +432,24 @@ Jaeger v2 is deployed as an `OpenTelemetryCollector` custom resource managed by

10. Render the manifest with `envsubst` and apply the configuration:

```bash
```bash {name=install-tracing:apply-jaeger}
envsubst < jaeger.yaml | kubectl apply -f -
```

11. Wait for the Jaeger Pod to be ready:

```bash
```bash {name=install-tracing:wait-jaeger-rollout}
kubectl rollout status deployment/${JAEGER_INSTANCE_NAME}-collector \
-n ${JAEGER_NS} --timeout=180s
```

12. Label the namespace and create an Ingress to expose the Jaeger UI:

```bash
```bash {name=install-tracing:label-jaeger-ns}
kubectl label namespace ${JAEGER_NS} cpaas.io/project=cpaas-system --overwrite
```

```bash
```bash {name=install-tracing:create-jaeger-ingress}
kubectl apply -n ${JAEGER_NS} -f - <<EOF
apiVersion: networking.k8s.io/v1
kind: Ingress
Expand All @@ -472,7 +474,7 @@ Jaeger v2 is deployed as an `OpenTelemetryCollector` custom resource managed by

Wait for the Ingress to be ready:

```bash
```bash {name=install-tracing:wait-jaeger-ingress}
kubectl wait --for=jsonpath='{.status.loadBalancer.ingress}' ingress/${JAEGER_INSTANCE_NAME} \
-n ${JAEGER_NS} --timeout=180s
```
Expand All @@ -483,18 +485,17 @@ Access the Jaeger UI at `<platform-url>/clusters/<cluster-name>/jaeger`, where `

Run the following command to print the Jaeger UI URL:

```bash
```bash {name=install-tracing:print-jaeger-url}
echo "Jaeger UI: ${PLATFORM_URL}${JAEGER_BASEPATH}"
```

## Deploying the OpenTelemetry Collector \{#deploying-the-opentelemetry-collector}

After Jaeger v2 is running, deploy an OpenTelemetry Collector instance to receive trace data from instrumented applications and forward it to Jaeger.

1. Create an `OpenTelemetryCollector` resource:
1. Create a file named `otel-collector.yaml` with the following content:

```yaml
kubectl apply -f - <<EOF
```yaml title="otel-collector.yaml" {name=install-tracing:otel-collector-yaml}
apiVersion: opentelemetry.io/v1beta1
kind: OpenTelemetryCollector
metadata:
Expand Down Expand Up @@ -562,7 +563,6 @@ After Jaeger v2 is running, deploy an OpenTelemetry Collector instance to receiv
without_scope_info: true
without_type_suffix: true
without_units: true
EOF
```

<Callouts>
Expand All @@ -574,9 +574,15 @@ After Jaeger v2 is running, deploy an OpenTelemetry Collector instance to receiv
6. The trace pipeline receives data via OTLP and Zipkin, processes it through `memory_limiter` and `batch`, and exports to both the `debug` exporter (for logging) and `otlp/traces` (for forwarding to Jaeger).
</Callouts>

2. Wait for the Collector pod to be ready:
2. Render the manifest with `envsubst` and apply the configuration:

```bash
```bash {name=install-tracing:apply-otel-collector}
envsubst < otel-collector.yaml | kubectl apply -f -
```

3. Wait for the Collector pod to be ready:

```bash {name=install-tracing:wait-otel-collector-rollout}
kubectl rollout status deployment/otel-collector \
-n ${JAEGER_NS} --timeout=180s
```
Expand All @@ -587,7 +593,7 @@ After installing all components, verify the end-to-end tracing pipeline by gener

1. Deploy `telemetrygen` as a test client to generate sample traces:

```bash
```bash {name=install-tracing:deploy-telemetrygen}
kubectl apply -f - <<EOF
apiVersion: v1
kind: Pod
Expand Down Expand Up @@ -644,7 +650,7 @@ Enabling SPM requires two changes: adding a SpanMetrics Connector to the OpenTel

1. Retrieve monitoring endpoint and credentials from the cluster:

```bash
```bash {name=install-tracing-spm:get-monitoring-config}
export MONITORING_URL=$(kubectl get feature monitoring -o jsonpath='{.spec.accessInfo.database.address}')
MONITORING_SECRET_NAME=$(kubectl get feature monitoring -o jsonpath='{.spec.accessInfo.database.basicAuth.secretName}')

Expand All @@ -654,16 +660,17 @@ Enabling SPM requires two changes: adding a SpanMetrics Connector to the OpenTel

2. Create a Secret for monitoring credentials:

```bash
```bash {name=install-tracing-spm:create-monitoring-secret}
kubectl create secret generic monitoring-credentials \
--namespace=${JAEGER_NS} \
--from-literal=username=${MONITORING_USERNAME} \
--from-literal=password=${MONITORING_PASSWORD}
--from-literal=password=${MONITORING_PASSWORD} \
--dry-run=client -o yaml | kubectl apply -f -
```

3. Patch the OpenTelemetry Collector to enable the SpanMetrics Connector. This adds a `spanmetrics` connector that generates RED metrics from spans and exports them via a Prometheus exporter:

```bash
```bash {name=install-tracing-spm:patch-otel-collector}
kubectl patch opentelemetrycollector otel -n ${JAEGER_NS} --type=merge -p '
spec:
config:
Expand All @@ -681,14 +688,14 @@ Enabling SPM requires two changes: adding a SpanMetrics Connector to the OpenTel

Wait for the Collector to restart:

```bash
```bash {name=install-tracing-spm:wait-otel-collector-rollout}
kubectl rollout status deployment/otel-collector \
-n ${JAEGER_NS} --timeout=180s
```

4. Create a file named `jaeger-spm-patch.yaml` with the following content. This patch adds a PromQL metrics backend to Jaeger and enables the Monitor tab:

```yaml title="jaeger-spm-patch.yaml"
```yaml title="jaeger-spm-patch.yaml" {name=install-tracing-spm:jaeger-spm-patch-yaml}
spec:
volumes:
- name: es-credentials
Expand Down Expand Up @@ -757,14 +764,14 @@ Enabling SPM requires two changes: adding a SpanMetrics Connector to the OpenTel

5. Apply the patch:

```bash
```bash {name=install-tracing-spm:apply-jaeger-patch}
kubectl patch opentelemetrycollector ${JAEGER_INSTANCE_NAME} -n ${JAEGER_NS} \
--type=merge -p "$(envsubst < jaeger-spm-patch.yaml)"
```

Wait for Jaeger to restart:

```bash
```bash {name=install-tracing-spm:wait-jaeger-rollout}
kubectl rollout status deployment/${JAEGER_INSTANCE_NAME}-collector \
-n ${JAEGER_NS} --timeout=180s
```
Expand Down
Loading