From e21b8096030fb2fb7dda95a402bf56f797c4cfeb Mon Sep 17 00:00:00 2001 From: "Jack (T.) Jia" Date: Thu, 12 May 2022 11:56:00 -0400 Subject: [PATCH 1/6] use tracing test code Signed-off-by: Jack (T.) Jia --- manifest.json.template | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.json.template b/manifest.json.template index 4e5503c9e2..ed8070edae 100644 --- a/manifest.json.template +++ b/manifest.json.template @@ -12,8 +12,8 @@ }, "binaryDependencies": { "org.zowe.zlux.zlux-core": { - "version": "~1.28.0-v1.x-staging", - "artifact": "*.pax" + "version": "1.28.0-114-v1.x-staging-zlux-build", + "artifact": "zlux-core-1.28.0-20220512.145208.pax" }, "org.zowe.zlux.zss-auth": { "version": "~1.28.0-V1.X-STAGING", From 3baa3a7b0e8357f3a174cdbe6d52e546f41199cb Mon Sep 17 00:00:00 2001 From: "Jack (T.) Jia" Date: Thu, 12 May 2022 12:31:46 -0400 Subject: [PATCH 2/6] put java agent into zowe-launch-scripts image Signed-off-by: Jack (T.) Jia --- containers/zowe-launch-scripts/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/containers/zowe-launch-scripts/Dockerfile b/containers/zowe-launch-scripts/Dockerfile index 0c37676194..ed035ee2e0 100644 --- a/containers/zowe-launch-scripts/Dockerfile +++ b/containers/zowe-launch-scripts/Dockerfile @@ -33,6 +33,7 @@ WORKDIR /component # copy files COPY --chown=zowe:zowe zowe . COPY --chown=zowe:zowe zowe/LICENSE /licenses +RUN curl https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v1.12.0/opentelemetry-javaagent.jar --output /component/bin/opentelemetry-javaagent.jar ################################## # start command From fe270f00ad7de9482564abca4c6b0c2fdc37465d Mon Sep 17 00:00:00 2001 From: "Jack (T.) Jia" Date: Thu, 12 May 2022 12:37:02 -0400 Subject: [PATCH 3/6] specify jfrog repo Signed-off-by: Jack (T.) Jia --- manifest.json.template | 1 + 1 file changed, 1 insertion(+) diff --git a/manifest.json.template b/manifest.json.template index ed8070edae..a7576720a5 100644 --- a/manifest.json.template +++ b/manifest.json.template @@ -12,6 +12,7 @@ }, "binaryDependencies": { "org.zowe.zlux.zlux-core": { + "repository": "libs-snapshot-local", "version": "1.28.0-114-v1.x-staging-zlux-build", "artifact": "zlux-core-1.28.0-20220512.145208.pax" }, From af064c2ad2f8a975d01f8c762de2afddf6546888 Mon Sep 17 00:00:00 2001 From: "Jack (T.) Jia" Date: Thu, 12 May 2022 12:48:20 -0400 Subject: [PATCH 4/6] download agent in prepare.sh Signed-off-by: Jack (T.) Jia --- containers/zowe-launch-scripts/Dockerfile | 1 - containers/zowe-launch-scripts/prepare.sh | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/containers/zowe-launch-scripts/Dockerfile b/containers/zowe-launch-scripts/Dockerfile index ed035ee2e0..0c37676194 100644 --- a/containers/zowe-launch-scripts/Dockerfile +++ b/containers/zowe-launch-scripts/Dockerfile @@ -33,7 +33,6 @@ WORKDIR /component # copy files COPY --chown=zowe:zowe zowe . COPY --chown=zowe:zowe zowe/LICENSE /licenses -RUN curl https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v1.12.0/opentelemetry-javaagent.jar --output /component/bin/opentelemetry-javaagent.jar ################################## # start command diff --git a/containers/zowe-launch-scripts/prepare.sh b/containers/zowe-launch-scripts/prepare.sh index be98437256..aa798c28ad 100755 --- a/containers/zowe-launch-scripts/prepare.sh +++ b/containers/zowe-launch-scripts/prepare.sh @@ -226,6 +226,11 @@ rm -fr zlux-app-manager zlux-build zlux-platform cd "${REPO_ROOT_DIR}" rm -f zlux-core.tar +############################### +# add otel java agent +echo ">>>>> copy opentelemetry-javaagent.jar" +curl https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v1.12.0/opentelemetry-javaagent.jar --output "${BASE_DIR}/${WORK_DIR}/bin/opentelemetry-javaagent.jar" + ############################### # copy to target context echo ">>>>> copy to target build context" From f6c42c8864917d039e54f522c5fb6520c5c15277 Mon Sep 17 00:00:00 2001 From: "Jack (T.) Jia" Date: Thu, 12 May 2022 13:49:18 -0400 Subject: [PATCH 5/6] otel setup and enabling Signed-off-by: Jack (T.) Jia --- .../samples/opentelemetry/README.md | 69 +++++++++ .../samples/opentelemetry/collector.yaml | 132 ++++++++++++++++++ .../samples/opentelemetry/jaeger.yaml | 5 + .../instance-env/api-catalog-deployment.yaml | 12 +- .../instance-env/app-server-deployment.yaml | 4 +- .../instance-env/caching-deployment.yaml | 12 +- .../cleanup-static-definitions-cronjob.yaml | 2 +- .../instance-env/discovery-statefulset.yaml | 12 +- .../instance-env/explorer-ip-job.yaml | 2 +- .../instance-env/explorer-jes-deployment.yaml | 2 +- .../instance-env/explorer-mvs-deployment.yaml | 2 +- .../instance-env/explorer-uss-deployment.yaml | 2 +- .../instance-env/files-api-deployment.yaml | 12 +- .../instance-env/gateway-deployment.yaml | 12 +- .../instance-env/jobs-api-deployment.yaml | 12 +- containers/zowe-launch-scripts/prepare.sh | 2 +- 16 files changed, 280 insertions(+), 14 deletions(-) create mode 100644 containers/kubernetes/samples/opentelemetry/README.md create mode 100644 containers/kubernetes/samples/opentelemetry/collector.yaml create mode 100644 containers/kubernetes/samples/opentelemetry/jaeger.yaml diff --git a/containers/kubernetes/samples/opentelemetry/README.md b/containers/kubernetes/samples/opentelemetry/README.md new file mode 100644 index 0000000000..38ef536529 --- /dev/null +++ b/containers/kubernetes/samples/opentelemetry/README.md @@ -0,0 +1,69 @@ +# README + +## Install OpenTelemetry Collector + +We will be using the OpenTelemetry Operator for Kubernetes to setup OTEL collector. To install the operator in an existing cluster, `cert-manager` is required. + +Use the following commands to install `cert-manager` and the operator: + +``` +# cert-manager +kubectl apply -f https://github.com/jetstack/cert-manager/releases/latest/download/cert-manager.yaml + +# open telemetry operator +kubectl apply -f https://github.com/open-telemetry/opentelemetry-operator/releases/latest/download/opentelemetry-operator.yaml +``` + +Once the `opentelemetry-operator` deployment is ready, we need to create an OpenTelemetry Collector instance. + +The `samples/opentelemetry/collector.yaml` configuration provides a good starting point, however, you may change as per your requirement. To apply, use this command: + +``` +kubectl apply -f samples/opentelemetry/collector.yaml +``` + +## Install Jaeger + +We will using the Jaeger Operator for Kubernetes to deploy Jaeger. To install the operator, run: + +``` +kubectl create namespace observability +kubectl create -n observability -f https://github.com/jaegertracing/jaeger-operator/releases/download/v1.29.1/jaeger-operator.yaml +``` + +Note that you’ll need to download and customize the Role Bindings if you are using a namespace other than observability. + +Once the `jaeger-operator` deployment in the namespace observability is ready, create a Jaeger instance, like: + +``` +kubectl apply -n observability -f samples/opentelemetry/jaeger.yaml +``` + +## Verify and port forwarding + +Check if the `otel-collector` and `jaeger-query` service has been created: + +``` +kubectl get svc --all-namespaces + +NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE +cert-manager cert-manager ClusterIP 10.96.164.235 9402/TCP 9m52s +cert-manager cert-manager-webhook ClusterIP 10.111.113.88 443/TCP 9m52s +observability jaeger-agent ClusterIP None 5775/UDP,5778/TCP,6831/UDP,6832/UDP 99s +observability jaeger-collector ClusterIP 10.102.255.8 9411/TCP,14250/TCP,14267/TCP,14268/TCP 99s +observability jaeger-collector-headless ClusterIP None 9411/TCP,14250/TCP,14267/TCP,14268/TCP 99s +observability jaeger-operator-metrics ClusterIP 10.101.196.203 8443/TCP 6m44s +observability jaeger-query ClusterIP 10.108.235.50 16686/TCP,16685/TCP 99s +opentelemetry-operator-system opentelemetry-operator-controller-manager-metrics-service ClusterIP 10.98.217.60 8443/TCP 9m33s +opentelemetry-operator-system opentelemetry-operator-webhook-service ClusterIP 10.108.3.106 443/TCP 9m33s +opentelemetry-operator-system otel-collector NodePort 10.105.160.200 4317:30080/TCP,8889:31809/TCP 7m39s +< ... other services > +``` + +Now, setup a port forward to the `jaeger-query` service: + +``` +kubectl port-forward service/jaeger-query -n observability 8080:16686 +``` + +You should now be able to access Jaeger at http://localhost:8080/. diff --git a/containers/kubernetes/samples/opentelemetry/collector.yaml b/containers/kubernetes/samples/opentelemetry/collector.yaml new file mode 100644 index 0000000000..b534f59811 --- /dev/null +++ b/containers/kubernetes/samples/opentelemetry/collector.yaml @@ -0,0 +1,132 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: otel-collector-conf + namespace: opentelemetry-operator-system + labels: + app: opentelemetry + component: otel-collector-conf +data: + otel-collector-config: | + receivers: + # Make sure to add the otlp receiver. + # This will open up the receiver on port 4317 + otlp: + protocols: + grpc: + endpoint: "0.0.0.0:4317" + processors: + extensions: + health_check: {} + exporters: + jaeger: + endpoint: "jaeger-collector.observability.svc.cluster.local:14250" + insecure: true + prometheus: + endpoint: 0.0.0.0:8889 + namespace: "testapp" + logging: + + service: + extensions: [health_check] + pipelines: + traces: + receivers: [otlp] + processors: [] + exporters: [jaeger] + + metrics: + receivers: [otlp] + processors: [] + exporters: [prometheus, logging] +--- +apiVersion: v1 +kind: Service +metadata: + name: otel-collector + namespace: opentelemetry-operator-system + labels: + app: opentelemetry + component: otel-collector +spec: + ports: + - name: otlp # Default endpoint for otlp receiver. + port: 4317 + protocol: TCP + targetPort: 4317 + nodePort: 30080 + - name: metrics # Default endpoint for metrics. + port: 8889 + protocol: TCP + targetPort: 8889 + selector: + component: otel-collector + type: NodePort +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: otel-collector + namespace: opentelemetry-operator-system + labels: + app: opentelemetry + component: otel-collector +spec: + selector: + matchLabels: + app: opentelemetry + component: otel-collector + minReadySeconds: 5 + progressDeadlineSeconds: 120 + replicas: 1 #TODO - adjust this to your own requirements + template: + metadata: + annotations: + prometheus.io/path: "/metrics" + prometheus.io/port: "8889" + prometheus.io/scrape: "true" + labels: + app: opentelemetry + component: otel-collector + spec: + containers: + - command: + - "/otelcol" + - "--config=/conf/otel-collector-config.yaml" + # Memory Ballast size should be max 1/3 to 1/2 of memory. + - "--mem-ballast-size-mib=683" + env: + - name: GOGC + value: "80" + image: otel/opentelemetry-collector:0.6.0 + name: otel-collector + resources: + limits: + cpu: 1 + memory: 2Gi + requests: + cpu: 200m + memory: 400Mi + ports: + - containerPort: 4317 # Default endpoint for otlp receiver. + - containerPort: 8889 # Default endpoint for querying metrics. + volumeMounts: + - name: otel-collector-config-vol + mountPath: /conf + # - name: otel-collector-secrets + # mountPath: /secrets + livenessProbe: + httpGet: + path: / + port: 13133 # Health Check extension default port. + readinessProbe: + httpGet: + path: / + port: 13133 # Health Check extension default port. + volumes: + - configMap: + name: otel-collector-conf + items: + - key: otel-collector-config + path: otel-collector-config.yaml + name: otel-collector-config-vol diff --git a/containers/kubernetes/samples/opentelemetry/jaeger.yaml b/containers/kubernetes/samples/opentelemetry/jaeger.yaml new file mode 100644 index 0000000000..c2e48c5351 --- /dev/null +++ b/containers/kubernetes/samples/opentelemetry/jaeger.yaml @@ -0,0 +1,5 @@ +--- +apiVersion: jaegertracing.io/v1 +kind: Jaeger +metadata: + name: jaeger diff --git a/containers/kubernetes/workloads/instance-env/api-catalog-deployment.yaml b/containers/kubernetes/workloads/instance-env/api-catalog-deployment.yaml index 09f0321ef6..febcf371cd 100644 --- a/containers/kubernetes/workloads/instance-env/api-catalog-deployment.yaml +++ b/containers/kubernetes/workloads/instance-env/api-catalog-deployment.yaml @@ -85,6 +85,16 @@ spec: fieldPath: metadata.namespace - name: CMMN_LB value: apiml-common-lib/bin/api-layer-lite-lib-all.jar + + - name: JAVA_OPTS + value: "-javaagent:/home/zowe/runtime/bin/opentelemetry-javaagent.jar" + - name: OTEL_TRACES_EXPORTER + value: otlp + - name: OTEL_RESOURCE_ATTRIBUTES + value: "service.name=api-catalog" + - name: OTEL_EXPORTER_OTLP_TRACES_ENDPOINT + value: "http://34.71.61.249:4317" + lifecycle: preStop: exec: @@ -114,7 +124,7 @@ spec: initContainers: - name: init-zowe # image: zowe-docker-release.jfrog.io/ompzowe/zowe-launch-scripts:latest - image: zowe-docker-snapshot.jfrog.io/ompzowe/zowe-launch-scripts:1.25.0-ubuntu.staging + image: zowe-docker-snapshot.jfrog.io/ompzowe/zowe-launch-scripts:1.28.0-ubuntu.users-jack-test-zlux-tracing imagePullPolicy: Always resources: requests: diff --git a/containers/kubernetes/workloads/instance-env/app-server-deployment.yaml b/containers/kubernetes/workloads/instance-env/app-server-deployment.yaml index a62dc42016..425d782d6c 100644 --- a/containers/kubernetes/workloads/instance-env/app-server-deployment.yaml +++ b/containers/kubernetes/workloads/instance-env/app-server-deployment.yaml @@ -48,7 +48,7 @@ spec: claimName: zowe-workspace-pvc containers: - name: app-server - image: zowe-docker-release.jfrog.io/ompzowe/app-server:1-ubuntu + image: zowe-docker-snapshot.jfrog.io/ompzowe/app-server:1.28.0-ubuntu.users-jack-trace imagePullPolicy: Always resources: requests: @@ -108,7 +108,7 @@ spec: initContainers: - name: init-zowe # image: zowe-docker-release.jfrog.io/ompzowe/zowe-launch-scripts:latest - image: zowe-docker-snapshot.jfrog.io/ompzowe/zowe-launch-scripts:1.25.0-ubuntu.staging + image: zowe-docker-snapshot.jfrog.io/ompzowe/zowe-launch-scripts:1.28.0-ubuntu.users-jack-test-zlux-tracing imagePullPolicy: Always resources: requests: diff --git a/containers/kubernetes/workloads/instance-env/caching-deployment.yaml b/containers/kubernetes/workloads/instance-env/caching-deployment.yaml index 283b4404f8..c077f1fbad 100644 --- a/containers/kubernetes/workloads/instance-env/caching-deployment.yaml +++ b/containers/kubernetes/workloads/instance-env/caching-deployment.yaml @@ -85,6 +85,16 @@ spec: fieldPath: metadata.namespace - name: CMMN_LB value: apiml-common-lib/bin/api-layer-lite-lib-all.jar + + - name: JAVA_OPTS + value: "-javaagent:/home/zowe/runtime/bin/opentelemetry-javaagent.jar" + - name: OTEL_TRACES_EXPORTER + value: otlp + - name: OTEL_RESOURCE_ATTRIBUTES + value: "service.name=caching-service" + - name: OTEL_EXPORTER_OTLP_TRACES_ENDPOINT + value: "http://34.71.61.249:4317" + lifecycle: preStop: exec: @@ -114,7 +124,7 @@ spec: initContainers: - name: init-zowe # image: zowe-docker-release.jfrog.io/ompzowe/zowe-launch-scripts:latest - image: zowe-docker-snapshot.jfrog.io/ompzowe/zowe-launch-scripts:1.25.0-ubuntu.staging + image: zowe-docker-snapshot.jfrog.io/ompzowe/zowe-launch-scripts:1.28.0-ubuntu.users-jack-test-zlux-tracing imagePullPolicy: Always resources: requests: diff --git a/containers/kubernetes/workloads/instance-env/cleanup-static-definitions-cronjob.yaml b/containers/kubernetes/workloads/instance-env/cleanup-static-definitions-cronjob.yaml index d470f8f00e..0871757fbf 100644 --- a/containers/kubernetes/workloads/instance-env/cleanup-static-definitions-cronjob.yaml +++ b/containers/kubernetes/workloads/instance-env/cleanup-static-definitions-cronjob.yaml @@ -45,7 +45,7 @@ spec: containers: - name: cleanup-static-definitions # image: zowe-docker-release.jfrog.io/ompzowe/zowe-launch-scripts:latest - image: zowe-docker-snapshot.jfrog.io/ompzowe/zowe-launch-scripts:1.25.0-ubuntu.staging + image: zowe-docker-snapshot.jfrog.io/ompzowe/zowe-launch-scripts:1.28.0-ubuntu.users-jack-test-zlux-tracing imagePullPolicy: Always resources: requests: diff --git a/containers/kubernetes/workloads/instance-env/discovery-statefulset.yaml b/containers/kubernetes/workloads/instance-env/discovery-statefulset.yaml index 6e0fe60fc6..c516aa2534 100644 --- a/containers/kubernetes/workloads/instance-env/discovery-statefulset.yaml +++ b/containers/kubernetes/workloads/instance-env/discovery-statefulset.yaml @@ -88,6 +88,16 @@ spec: fieldPath: metadata.namespace - name: CMMN_LB value: apiml-common-lib/bin/api-layer-lite-lib-all.jar + + - name: JAVA_OPTS + value: "-javaagent:/home/zowe/runtime/bin/opentelemetry-javaagent.jar" + - name: OTEL_TRACES_EXPORTER + value: otlp + - name: OTEL_RESOURCE_ATTRIBUTES + value: "service.name=discovery" + - name: OTEL_EXPORTER_OTLP_TRACES_ENDPOINT + value: "http://34.71.61.249:4317" + lifecycle: preStop: exec: @@ -117,7 +127,7 @@ spec: initContainers: - name: init-zowe # image: zowe-docker-release.jfrog.io/ompzowe/zowe-launch-scripts:latest - image: zowe-docker-snapshot.jfrog.io/ompzowe/zowe-launch-scripts:1.25.0-ubuntu.staging + image: zowe-docker-snapshot.jfrog.io/ompzowe/zowe-launch-scripts:1.28.0-ubuntu.users-jack-test-zlux-tracing imagePullPolicy: Always resources: requests: diff --git a/containers/kubernetes/workloads/instance-env/explorer-ip-job.yaml b/containers/kubernetes/workloads/instance-env/explorer-ip-job.yaml index 6a5364b660..54d8332d4f 100644 --- a/containers/kubernetes/workloads/instance-env/explorer-ip-job.yaml +++ b/containers/kubernetes/workloads/instance-env/explorer-ip-job.yaml @@ -78,7 +78,7 @@ spec: initContainers: - name: init-zowe # image: zowe-docker-release.jfrog.io/ompzowe/zowe-launch-scripts:latest - image: zowe-docker-snapshot.jfrog.io/ompzowe/zowe-launch-scripts:1.25.0-ubuntu.staging + image: zowe-docker-snapshot.jfrog.io/ompzowe/zowe-launch-scripts:1.28.0-ubuntu.users-jack-test-zlux-tracing imagePullPolicy: Always resources: requests: diff --git a/containers/kubernetes/workloads/instance-env/explorer-jes-deployment.yaml b/containers/kubernetes/workloads/instance-env/explorer-jes-deployment.yaml index ff07cc2a04..4d4febd5b5 100644 --- a/containers/kubernetes/workloads/instance-env/explorer-jes-deployment.yaml +++ b/containers/kubernetes/workloads/instance-env/explorer-jes-deployment.yaml @@ -108,7 +108,7 @@ spec: initContainers: - name: init-zowe # image: zowe-docker-release.jfrog.io/ompzowe/zowe-launch-scripts:latest - image: zowe-docker-snapshot.jfrog.io/ompzowe/zowe-launch-scripts:1.25.0-ubuntu.staging + image: zowe-docker-snapshot.jfrog.io/ompzowe/zowe-launch-scripts:1.28.0-ubuntu.users-jack-test-zlux-tracing imagePullPolicy: Always resources: requests: diff --git a/containers/kubernetes/workloads/instance-env/explorer-mvs-deployment.yaml b/containers/kubernetes/workloads/instance-env/explorer-mvs-deployment.yaml index 6e4488b518..07dd00e754 100644 --- a/containers/kubernetes/workloads/instance-env/explorer-mvs-deployment.yaml +++ b/containers/kubernetes/workloads/instance-env/explorer-mvs-deployment.yaml @@ -108,7 +108,7 @@ spec: initContainers: - name: init-zowe # image: zowe-docker-release.jfrog.io/ompzowe/zowe-launch-scripts:latest - image: zowe-docker-snapshot.jfrog.io/ompzowe/zowe-launch-scripts:1.25.0-ubuntu.staging + image: zowe-docker-snapshot.jfrog.io/ompzowe/zowe-launch-scripts:1.28.0-ubuntu.users-jack-test-zlux-tracing imagePullPolicy: Always resources: requests: diff --git a/containers/kubernetes/workloads/instance-env/explorer-uss-deployment.yaml b/containers/kubernetes/workloads/instance-env/explorer-uss-deployment.yaml index 7663034ee5..5037972a71 100644 --- a/containers/kubernetes/workloads/instance-env/explorer-uss-deployment.yaml +++ b/containers/kubernetes/workloads/instance-env/explorer-uss-deployment.yaml @@ -108,7 +108,7 @@ spec: initContainers: - name: init-zowe # image: zowe-docker-release.jfrog.io/ompzowe/zowe-launch-scripts:latest - image: zowe-docker-snapshot.jfrog.io/ompzowe/zowe-launch-scripts:1.25.0-ubuntu.staging + image: zowe-docker-snapshot.jfrog.io/ompzowe/zowe-launch-scripts:1.28.0-ubuntu.users-jack-test-zlux-tracing imagePullPolicy: Always resources: requests: diff --git a/containers/kubernetes/workloads/instance-env/files-api-deployment.yaml b/containers/kubernetes/workloads/instance-env/files-api-deployment.yaml index 0b80bcb553..9a0279025c 100644 --- a/containers/kubernetes/workloads/instance-env/files-api-deployment.yaml +++ b/containers/kubernetes/workloads/instance-env/files-api-deployment.yaml @@ -81,6 +81,16 @@ spec: valueFrom: fieldRef: fieldPath: metadata.namespace + + - name: JAVA_OPTS + value: "-javaagent:/home/zowe/runtime/bin/opentelemetry-javaagent.jar" + - name: OTEL_TRACES_EXPORTER + value: otlp + - name: OTEL_RESOURCE_ATTRIBUTES + value: "service.name=files-api" + - name: OTEL_EXPORTER_OTLP_TRACES_ENDPOINT + value: "http://34.71.61.249:4317" + lifecycle: preStop: exec: @@ -108,7 +118,7 @@ spec: initContainers: - name: init-zowe # image: zowe-docker-release.jfrog.io/ompzowe/zowe-launch-scripts:latest - image: zowe-docker-snapshot.jfrog.io/ompzowe/zowe-launch-scripts:1.25.0-ubuntu.staging + image: zowe-docker-snapshot.jfrog.io/ompzowe/zowe-launch-scripts:1.28.0-ubuntu.users-jack-test-zlux-tracing imagePullPolicy: Always resources: requests: diff --git a/containers/kubernetes/workloads/instance-env/gateway-deployment.yaml b/containers/kubernetes/workloads/instance-env/gateway-deployment.yaml index 44fe1ab83d..df0dd7b99a 100644 --- a/containers/kubernetes/workloads/instance-env/gateway-deployment.yaml +++ b/containers/kubernetes/workloads/instance-env/gateway-deployment.yaml @@ -85,6 +85,16 @@ spec: fieldPath: metadata.namespace - name: CMMN_LB value: apiml-common-lib/bin/api-layer-lite-lib-all.jar + + - name: JAVA_OPTS + value: "-javaagent:/home/zowe/runtime/bin/opentelemetry-javaagent.jar" + - name: OTEL_TRACES_EXPORTER + value: otlp + - name: OTEL_RESOURCE_ATTRIBUTES + value: "service.name=gateway" + - name: OTEL_EXPORTER_OTLP_TRACES_ENDPOINT + value: "http://34.71.61.249:4317" + lifecycle: preStop: exec: @@ -114,7 +124,7 @@ spec: initContainers: - name: init-zowe # image: zowe-docker-release.jfrog.io/ompzowe/zowe-launch-scripts:latest - image: zowe-docker-snapshot.jfrog.io/ompzowe/zowe-launch-scripts:1.25.0-ubuntu.staging + image: zowe-docker-snapshot.jfrog.io/ompzowe/zowe-launch-scripts:1.28.0-ubuntu.users-jack-test-zlux-tracing imagePullPolicy: Always resources: requests: diff --git a/containers/kubernetes/workloads/instance-env/jobs-api-deployment.yaml b/containers/kubernetes/workloads/instance-env/jobs-api-deployment.yaml index 8ba890fd27..b063c4aa91 100644 --- a/containers/kubernetes/workloads/instance-env/jobs-api-deployment.yaml +++ b/containers/kubernetes/workloads/instance-env/jobs-api-deployment.yaml @@ -81,6 +81,16 @@ spec: valueFrom: fieldRef: fieldPath: metadata.namespace + + - name: JAVA_OPTS + value: "-javaagent:/home/zowe/runtime/bin/opentelemetry-javaagent.jar" + - name: OTEL_TRACES_EXPORTER + value: otlp + - name: OTEL_RESOURCE_ATTRIBUTES + value: "service.name=jobs-api" + - name: OTEL_EXPORTER_OTLP_TRACES_ENDPOINT + value: "http://34.71.61.249:4317" + lifecycle: preStop: exec: @@ -108,7 +118,7 @@ spec: initContainers: - name: init-zowe # image: zowe-docker-release.jfrog.io/ompzowe/zowe-launch-scripts:latest - image: zowe-docker-snapshot.jfrog.io/ompzowe/zowe-launch-scripts:1.25.0-ubuntu.staging + image: zowe-docker-snapshot.jfrog.io/ompzowe/zowe-launch-scripts:1.28.0-ubuntu.users-jack-test-zlux-tracing imagePullPolicy: Always resources: requests: diff --git a/containers/zowe-launch-scripts/prepare.sh b/containers/zowe-launch-scripts/prepare.sh index aa798c28ad..58e85a8ff8 100755 --- a/containers/zowe-launch-scripts/prepare.sh +++ b/containers/zowe-launch-scripts/prepare.sh @@ -229,7 +229,7 @@ rm -f zlux-core.tar ############################### # add otel java agent echo ">>>>> copy opentelemetry-javaagent.jar" -curl https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v1.12.0/opentelemetry-javaagent.jar --output "${BASE_DIR}/${WORK_DIR}/bin/opentelemetry-javaagent.jar" +curl --location https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v1.12.0/opentelemetry-javaagent.jar --output "${BASE_DIR}/${WORK_DIR}/bin/opentelemetry-javaagent.jar" ############################### # copy to target context From 293dab7f13e78ecfa657e5e49efbac2bd3ab1bce Mon Sep 17 00:00:00 2001 From: "Jack (T.) Jia" Date: Thu, 12 May 2022 17:03:59 -0400 Subject: [PATCH 6/6] tweak env vars to enable tracing Signed-off-by: Jack (T.) Jia --- .../instance-env/api-catalog-deployment.yaml | 12 ++---------- .../workloads/instance-env/caching-deployment.yaml | 12 ++---------- .../instance-env/discovery-statefulset.yaml | 12 ++---------- .../workloads/instance-env/files-api-deployment.yaml | 12 +----------- .../workloads/instance-env/gateway-deployment.yaml | 12 ++---------- .../workloads/instance-env/jobs-api-deployment.yaml | 12 +----------- 6 files changed, 10 insertions(+), 62 deletions(-) diff --git a/containers/kubernetes/workloads/instance-env/api-catalog-deployment.yaml b/containers/kubernetes/workloads/instance-env/api-catalog-deployment.yaml index febcf371cd..20d48f337b 100644 --- a/containers/kubernetes/workloads/instance-env/api-catalog-deployment.yaml +++ b/containers/kubernetes/workloads/instance-env/api-catalog-deployment.yaml @@ -85,16 +85,8 @@ spec: fieldPath: metadata.namespace - name: CMMN_LB value: apiml-common-lib/bin/api-layer-lite-lib-all.jar - - - name: JAVA_OPTS - value: "-javaagent:/home/zowe/runtime/bin/opentelemetry-javaagent.jar" - - name: OTEL_TRACES_EXPORTER - value: otlp - - name: OTEL_RESOURCE_ATTRIBUTES - value: "service.name=api-catalog" - - name: OTEL_EXPORTER_OTLP_TRACES_ENDPOINT - value: "http://34.71.61.249:4317" - + - name: QUICK_START + value: "-javaagent:/home/zowe/runtime/bin/opentelemetry-javaagent.jar -Dotel.traces.exporter=otlp -Dotel.resource.attributes=service.name=api-catalog -Dotel.exporter.otlp.traces.endpoint=http://34.71.61.249:4317" lifecycle: preStop: exec: diff --git a/containers/kubernetes/workloads/instance-env/caching-deployment.yaml b/containers/kubernetes/workloads/instance-env/caching-deployment.yaml index c077f1fbad..e98b71f1da 100644 --- a/containers/kubernetes/workloads/instance-env/caching-deployment.yaml +++ b/containers/kubernetes/workloads/instance-env/caching-deployment.yaml @@ -85,16 +85,8 @@ spec: fieldPath: metadata.namespace - name: CMMN_LB value: apiml-common-lib/bin/api-layer-lite-lib-all.jar - - - name: JAVA_OPTS - value: "-javaagent:/home/zowe/runtime/bin/opentelemetry-javaagent.jar" - - name: OTEL_TRACES_EXPORTER - value: otlp - - name: OTEL_RESOURCE_ATTRIBUTES - value: "service.name=caching-service" - - name: OTEL_EXPORTER_OTLP_TRACES_ENDPOINT - value: "http://34.71.61.249:4317" - + - name: QUICK_START + value: "-javaagent:/home/zowe/runtime/bin/opentelemetry-javaagent.jar -Dotel.traces.exporter=otlp -Dotel.resource.attributes=service.name=caching-service -Dotel.exporter.otlp.traces.endpoint=http://34.71.61.249:4317" lifecycle: preStop: exec: diff --git a/containers/kubernetes/workloads/instance-env/discovery-statefulset.yaml b/containers/kubernetes/workloads/instance-env/discovery-statefulset.yaml index c516aa2534..7781f5a100 100644 --- a/containers/kubernetes/workloads/instance-env/discovery-statefulset.yaml +++ b/containers/kubernetes/workloads/instance-env/discovery-statefulset.yaml @@ -88,16 +88,8 @@ spec: fieldPath: metadata.namespace - name: CMMN_LB value: apiml-common-lib/bin/api-layer-lite-lib-all.jar - - - name: JAVA_OPTS - value: "-javaagent:/home/zowe/runtime/bin/opentelemetry-javaagent.jar" - - name: OTEL_TRACES_EXPORTER - value: otlp - - name: OTEL_RESOURCE_ATTRIBUTES - value: "service.name=discovery" - - name: OTEL_EXPORTER_OTLP_TRACES_ENDPOINT - value: "http://34.71.61.249:4317" - + - name: QUICK_START + value: "-javaagent:/home/zowe/runtime/bin/opentelemetry-javaagent.jar -Dotel.traces.exporter=otlp -Dotel.resource.attributes=service.name=discovery -Dotel.exporter.otlp.traces.endpoint=http://34.71.61.249:4317" lifecycle: preStop: exec: diff --git a/containers/kubernetes/workloads/instance-env/files-api-deployment.yaml b/containers/kubernetes/workloads/instance-env/files-api-deployment.yaml index 9a0279025c..fbc36dfe16 100644 --- a/containers/kubernetes/workloads/instance-env/files-api-deployment.yaml +++ b/containers/kubernetes/workloads/instance-env/files-api-deployment.yaml @@ -48,7 +48,7 @@ spec: claimName: zowe-workspace-pvc containers: - name: files-api - image: zowe-docker-release.jfrog.io/ompzowe/files-api:1-ubuntu + image: zowe-docker-snapshot.jfrog.io/ompzowe/files-api:1.0.17-SNAPSHOT-ubuntu.users-jack-trace imagePullPolicy: Always resources: requests: @@ -81,16 +81,6 @@ spec: valueFrom: fieldRef: fieldPath: metadata.namespace - - - name: JAVA_OPTS - value: "-javaagent:/home/zowe/runtime/bin/opentelemetry-javaagent.jar" - - name: OTEL_TRACES_EXPORTER - value: otlp - - name: OTEL_RESOURCE_ATTRIBUTES - value: "service.name=files-api" - - name: OTEL_EXPORTER_OTLP_TRACES_ENDPOINT - value: "http://34.71.61.249:4317" - lifecycle: preStop: exec: diff --git a/containers/kubernetes/workloads/instance-env/gateway-deployment.yaml b/containers/kubernetes/workloads/instance-env/gateway-deployment.yaml index df0dd7b99a..0c4c48b497 100644 --- a/containers/kubernetes/workloads/instance-env/gateway-deployment.yaml +++ b/containers/kubernetes/workloads/instance-env/gateway-deployment.yaml @@ -85,16 +85,8 @@ spec: fieldPath: metadata.namespace - name: CMMN_LB value: apiml-common-lib/bin/api-layer-lite-lib-all.jar - - - name: JAVA_OPTS - value: "-javaagent:/home/zowe/runtime/bin/opentelemetry-javaagent.jar" - - name: OTEL_TRACES_EXPORTER - value: otlp - - name: OTEL_RESOURCE_ATTRIBUTES - value: "service.name=gateway" - - name: OTEL_EXPORTER_OTLP_TRACES_ENDPOINT - value: "http://34.71.61.249:4317" - + - name: QUICK_START + value: "-javaagent:/home/zowe/runtime/bin/opentelemetry-javaagent.jar -Dotel.traces.exporter=otlp -Dotel.resource.attributes=service.name=gateway -Dotel.exporter.otlp.traces.endpoint=http://34.71.61.249:4317" lifecycle: preStop: exec: diff --git a/containers/kubernetes/workloads/instance-env/jobs-api-deployment.yaml b/containers/kubernetes/workloads/instance-env/jobs-api-deployment.yaml index b063c4aa91..b5189fafff 100644 --- a/containers/kubernetes/workloads/instance-env/jobs-api-deployment.yaml +++ b/containers/kubernetes/workloads/instance-env/jobs-api-deployment.yaml @@ -48,7 +48,7 @@ spec: claimName: zowe-workspace-pvc containers: - name: jobs-api - image: zowe-docker-release.jfrog.io/ompzowe/jobs-api:1-ubuntu + image: zowe-docker-snapshot.jfrog.io/ompzowe/jobs-api:1.0.15-SNAPSHOT-ubuntu.users-jack-trace imagePullPolicy: Always resources: requests: @@ -81,16 +81,6 @@ spec: valueFrom: fieldRef: fieldPath: metadata.namespace - - - name: JAVA_OPTS - value: "-javaagent:/home/zowe/runtime/bin/opentelemetry-javaagent.jar" - - name: OTEL_TRACES_EXPORTER - value: otlp - - name: OTEL_RESOURCE_ATTRIBUTES - value: "service.name=jobs-api" - - name: OTEL_EXPORTER_OTLP_TRACES_ENDPOINT - value: "http://34.71.61.249:4317" - lifecycle: preStop: exec: