|
| 1 | +## OpenTelemetry with OpenShift Distributed Tracing Platform |
| 2 | + |
| 3 | +Start OpenShift local and create a new project. |
| 4 | + |
| 5 | +``` |
| 6 | +$ crc setup |
| 7 | +$ crc start |
| 8 | +$ eval $(crc oc-env) |
| 9 | +$ oc login -u developer |
| 10 | +$ oc new-project opentelemetry-js-rhosdt |
| 11 | +``` |
| 12 | +### Install the OpenShift Distributed Tracing Platform Operator |
| 13 | + |
| 14 | +1. Login as kubeadmin |
| 15 | +2. Go to OperatorHub |
| 16 | +3. Search for Jaeger |
| 17 | +4. Click on `Red Hat OpenShift distributed tracing platform` and follow the instructions to install. |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | +5. Login as developer, go to Topology and add the Jaeger Operator to the project. |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | +6. Configure the URL for the JaegerExporter endpoint |
| 30 | + |
| 31 | +``` |
| 32 | +❯ oc get svc |
| 33 | +NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE |
| 34 | +jaeger-all-in-one-inmemory-agent ClusterIP None <none> 5775/UDP,5778/TCP,6831/UDP,6832/UDP 2m16s |
| 35 | +jaeger-all-in-one-inmemory-collector ClusterIP 10.217.5.57 <none> 9411/TCP,14250/TCP,14267/TCP,14268/TCP,4317/TCP,4318/TCP 2m16s |
| 36 | +jaeger-all-in-one-inmemory-collector-headless ClusterIP None <none> 9411/TCP,14250/TCP,14267/TCP,14268/TCP,4317/TCP,4318/TCP 2m16s |
| 37 | +jaeger-all-in-one-inmemory-query ClusterIP 10.217.5.219 <none> 443/TCP,16685/TCP 2m16s |
| 38 | +``` |
| 39 | + |
| 40 | +We are going to use `jaeger-all-in-one-inmemory-collector` + |
| 41 | +our namespace service `opentelemetry-js-rhosdt.svc` for the |
| 42 | + `JaegerExporter` endpoint. |
| 43 | + |
| 44 | +Resulting in the following: |
| 45 | + |
| 46 | +(content from the [tracing.js](./tracing.js) file) |
| 47 | +```js |
| 48 | +const exporter = new JaegerExporter({ |
| 49 | + endpoint: 'http://jaeger-all-in-one-inmemory-collector.opentelemetry-js-rhosdt.svc:14268/api/traces' |
| 50 | +}); |
| 51 | +``` |
| 52 | + |
| 53 | +7. Deploy the example to OpenShift local |
| 54 | + |
| 55 | +* Uncomment the `require('./tracing.js');` on `app.js` |
| 56 | + |
| 57 | +``` |
| 58 | +npm install |
| 59 | +npm run openshift |
| 60 | +``` |
| 61 | + |
| 62 | +8. When you login on Jaeger UI you can see the result like this: |
| 63 | + |
| 64 | + |
0 commit comments