|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * /serverless/serverless-tracing.adoc |
| 4 | +// */jaeger/jaeger_config/serverless-jaeger-integration.adoc |
| 5 | + |
| 6 | +[id="serverless-jaeger-config_{context}"] |
| 7 | += Configuring Jaeger for use with {ServerlessProductName} |
| 8 | + |
| 9 | +.Prerequisites |
| 10 | + |
| 11 | +To configure Jaeger for use with {ServerlessProductName}, you will need: |
| 12 | + |
| 13 | +* Cluster administrator permissions on an {product-title} cluster. |
| 14 | +* A current installation of {ServerlessOperatorName} and Knative Serving. |
| 15 | +* A current installation of the Jaeger Operator. |
| 16 | + |
| 17 | +.Procedure |
| 18 | + |
| 19 | +. Create and apply the Jaeger custom resource: |
| 20 | ++ |
| 21 | +---- |
| 22 | +$ cat <<EOF | oc apply -f - |
| 23 | +apiVersion: jaegertracing.io/v1 |
| 24 | +kind: Jaeger |
| 25 | +metadata: |
| 26 | + name: jaeger |
| 27 | + namespace: default |
| 28 | +EOF |
| 29 | +---- |
| 30 | + |
| 31 | +. Enable tracing for Knative Serving, by editing the `KnativeServing` resource and adding a YAML configuration for tracing. |
| 32 | ++ |
| 33 | +.Tracing YAML example |
| 34 | +---- |
| 35 | +apiVersion: operator.knative.dev/v1alpha1 |
| 36 | +kind: KnativeServing |
| 37 | +metadata: |
| 38 | + name: knative-serving |
| 39 | + namespace: knative-serving |
| 40 | +spec: |
| 41 | + config: |
| 42 | + tracing: |
| 43 | + sample-rate: "0.1" <1> |
| 44 | + backend: zipkin <2> |
| 45 | + zipkin-endpoint: http://jaeger-collector.default.svc.cluster.local:9411/api/v2/spans <3> |
| 46 | + debug: "false" <4> |
| 47 | +---- |
| 48 | ++ |
| 49 | +<1> The `sample-rate` defines sampling probability. Using `sample-rate: "0.1"`` means that 1 in 10 traces will be sampled. |
| 50 | +<2> `backend` must be set to `zipkin`. |
| 51 | +<3> The `zipkin-endpoint` must point to your `jaeger-collector` service endpoint. To get this endpoint, substitute the namespace where the Jaeger custom resource is applied. |
| 52 | +<4> Debugging should be set to `false`. Enabling debug mode by setting `debug: "true"` allows all spans to be sent to the server, bypassing sampling. |
| 53 | + |
| 54 | +.Verification steps |
| 55 | + |
| 56 | +Access the Jaeger web console to see tracing data. You can access the Jaeger web console by using the `jaeger` route. |
| 57 | + |
| 58 | +. Get the `jaeger` route's hostname: |
| 59 | ++ |
| 60 | +---- |
| 61 | +$ oc get route jaeger |
| 62 | +NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD |
| 63 | +jaeger jaeger-default.apps.example.com jaeger-query <all> reencrypt None |
| 64 | +---- |
| 65 | +. Open the endpoint address in your browser to view the console. |
0 commit comments