OpenTracing with BWCE

This document contains a ‘howto’ to test OpenTracing in conjunction with BWCE.

Background information:

Opentracing API (in order to implement other tracers):

https://github.com/TIBCOSoftware/bw-samples/wiki/OpenTracing

or

opentracing-bwce.mp4

This document contains two test scenarios.

Scenario 1: Standalone application. In this scenario, the use of one BWCE application is tested (in conjunction with Jaeger).

Scenario 2: Two applications. In this scenario two BWCE applications are used. Application 1 call application 2.

In both cases tests were carried out with BWCE 2.4 using restful applications. 

 

Prerequisites

It is assumed that the following software is installed:

a) BWCE studio 2.4 (on Windows).

b) A standalone docker server.

c) A base BWCE 2.4 image is created on that server.

Scenario 1

In scenario 1 the following application is used:

Gadgetmen (stand alone tests):

gadgetman_1.0.0.eargadgetman0.zip

The following steps are used to carry out the test:

Step 1.1) Login to the docker server and create a directory named ‘gadgetman’. 

Step 1.2) Create a file named Dockerfile with the following content:

FROM tibco/bwce:2.4.0

MAINTAINER tibco

ADD gadgetman_1.0.0.ear /

Step 1.3) Copy the file gadgetman_1.0.0.ear to this same directory.

Step 1.4) Make an image named ‘gadgetman1img’ by running the command ‘docker build -t gadgetman1img .’ from this directory.

Step 1.5) Startup the Jaeger image using the following command:

docker run -d –name jaeger \

  -e COLLECTOR_ZIPKIN_HTTP_PORT=9411 \

  -p 5775:5775/udp \

  -p 6831:6831/udp \

  -p 6832:6832/udp \

  -p 5778:5778 \

  -p 16686:16686 \

  -p 14268:14268 \

  -p 9411:9411 \

  jaegertracing/all-in-one:1.7

Step 1.6) Startup the container ‘gadgetman1’ by running the command: 

docker run –name “gadgetman1″ -d –link jaeger -p 8181:8181 –env BW_JAVA_OPTS=”-Dbw.engine.opentracing.enable=true” –env JAEGER_AGENT_HOST=jaeger –env JAEGER_AGENT_PORT=6831 –env JAEGER_SAMPLER_MANAGER_HOST_PORT=jaeger:5778 gadgetman1img

Step 1.7) Check to see that the BWCE container started with the command ‘docker logs gadgetman1’.

Step 1.8) Once the container started successfully open a browser and open:

a) The jaeger UI: http://127.0.0.1:16686/

b) The swagger UI of the application: localhost:8181/swagger/

Step 1.9) Invoke a number of rest calls via the Swagger UI (content of the requests is irrelevant). 

Step 1.10) Verify in the Jaeger UI that a trace is visible. Please mind (it may take a few seconds, up to a minute, before the trace is visible).  

Scenario 2

In scenario 2 the following applications are used:

Opentracing1 (invoker):

opentracing1.earopentracing1.zip

Opentracing2 (target API)

opentracing2.zipopentracing2.ear

The following steps are used to carry out the test:

Step 1.1) Login to the docker server and create the following directories:

a) opentracing1

b) opentracing2

Step 1.2) Create a file named Dockerfile in each of the directories: 

a) in opentracing1:

FROM tibco/bwce:2.4.0

MAINTAINER tibco

ADD opentracing1.ear /

b) in opentracing2:

FROM tibco/bwce:2.4.0

MAINTAINER tibco

ADD opentracing2.ear /

Step 1.3) Copy the files opentracing1.ear to directory opentracing1 and opentracing2.ear to directorie opentracing2.

Step 1.4) Create an image for both applications:

a) From the directory opentracing1 run the command: docker build -t opentracing1img .

b) From the directory opentracing2 run the command: docker build -t opentracing2img .

Step 1.5) Startup the Jaeger image using the following command:

docker run -d –name jaeger \

  -e COLLECTOR_ZIPKIN_HTTP_PORT=9411 \

  -p 5775:5775/udp \

  -p 6831:6831/udp \

  -p 6832:6832/udp \

  -p 5778:5778 \

  -p 16686:16686 \

  -p 14268:14268 \

  -p 9411:9411 \

  jaegertracing/all-in-one:1.7

Step 1.6) Startup the containers for both applications by running the commands: 

docker run –name “opentracing1″ -d –link jaeger –link opentracing2 -p 8181:8181 –env BW_JAVA_OPTS=”-Dbw.engine.opentracing.enable=true” –env JAEGER_AGENT_HOST=jaeger –env JAEGER_AGENT_PORT=6831 –env JAEGER_SAMPLER_MANAGER_HOST_PORT=jaeger:5778 opentracing1img

docker run –name “opentracing2″ -d –link jaeger  -p 8282:8282 –env BW_JAVA_OPTS=”-Dbw.engine.opentracing.enable=true” –env JAEGER_AGENT_HOST=jaeger –env JAEGER_AGENT_PORT=6831 –env JAEGER_SAMPLER_MANAGER_HOST_PORT=jaeger:5778 opentracing2img

Step 1.7) Check to see if both BWCE container started with the command ‘docker logs opentracing1’ and ‘docker logs opentracing2’

Step 1.8) Once the container started successfully open a browser and open:

a) The jaeger UI: http://127.0.0.1:16686/

b) The swagger UI for the opentracing1 application: localhost:8181/swagger/

Step 1.9) Invoke a number of rest calls via the Swagger UI (content of the requests is irrelevant). 

Step 1.10) Verify in the Jaeger UI that a trace is visible. Please mind (it may take a few seconds, up to a minute, before the trace is visible).  

 

Leave a Reply