TIBCO monitoring on Docker: How to create, instantiate and start a TIBCO BusinessWorks Container Edition (BWCE) Application Monitoring Docker Image?

In the last few blogpost I played around with the product TIBCO BusinessWorks Container Edition (from now on BWCE) on several container platforms like Docker (standalone setup), Kubernetes (Minikube) and OpenShift (Origin). In my honest opinion a move that is inevitable for organisations with the ambition to become cloud-native. However while playing around and trying to break as much as possible the question arose if we would ever going to miss the good old TIBCO Administrator for BW5 or TEA for BW6?

tibco

Well this question was partially answered when I started using Kubernetes (Minikube) and OpenShift (Origin) as a container orchestration platform. Managing, monitoring and controlling distributed containers is exactly the purpose of these container orchestration platforms and they are good at it! But obviously they will not provide the same level of detail as what we had with the TIBCO Administrator for BW5 or TEA for BW6. So to find out how many TIBCO BWCE containers are running or what is exactly in these containers (applications, processes, endpoints, jobs etc.) is basically impossible without abusing and spamming the default log files. Luckily TIBCO saw this also coming and  released a dockerized monitoring solution with version 2.3.1 of TIBCO BWCE. In this blog post we will have a further look at!

1. First download and extract bwce_mon.zip from http://edelivery.tibco.com (account is required).

2. Navigate to the bwce_mon extraction directory and build the docker image by running the following command:

MacBook-Pro:bwce_mon ruben.middeljans$ docker build -t bwce/monitoring:latest .
 Sending build context to Docker daemon 54.92MB
 ...
 Successfully built 799e9a033306
 Successfully tagged bwce/monitoring:latest

3. Verify the creation by running the following command (or use Kitematic):

MacBook-Pro:bwce_mon ruben.middeljans$ docker images
 REPOSITORY TAG IMAGE ID CREATED SIZE
 bwce/monitoring latest 799e9a033306 6 minutes ago 138MB

4. Start a MySQL server instance within a Docker container for the required persistence.

MacBook-Pro:~ ruben.middeljans$ docker run -p 3306:3306 --name mysql -e MYSQL_ROOT_PASSWORD=root -e -d mysql:latest
 Unable to find image 'mysql:latest' locally
 latest: Pulling from library/mysql
 ...
 Status: Downloaded newer image for mysql:latest
 a474d80336769a6abbb07e29ea0d283918a77c80cd247cd1060eb8953b6cc580

5. Verify the instantiation by running the following command (or use Kitematic):

MacBook-Pro:bwce_mon ruben.middeljans$ docker ps
 CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
 a474d8033676 mysql:latest "docker-entrypoint..." 7 seconds ago Up 7 seconds 3306/tcp mysql

6. To retrieve the private IP-address of the mysql container run the following command:

MacBook-Pro:~ ruben.middeljans$ docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' mysql
 172.17.0.2

7. To instantiate and start the bwce-monitoring image (bwce/monitoring:latest) run the following command (no need to mention that the monitoring solutions also runs within a Docker container):

MacBook-Pro:~ ruben.middeljans$ docker run -p 8080:8080 -e persistence_DB="mysql" -e DB_URL="mysql://root:root@172.17.0.2:3306/mysql" --name bwce-monitoring bwce/monitoring:latest
 ...

8. Verify the instantiation by running the following command (or use Kitematic):

MacBook-Pro:~ ruben.middeljans$ docker ps
 CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
 a077b294606c bwce/monitoring:latest "npm start" About a minute ago Up About a minute 0.0.0.0:8080->8080/tcp bwce-monitoring
 8eeb583b20d3 mysql:latest "docker-entrypoint..." 2 minutes ago Up 2 minutes 0.0.0.0:3306->3306/tcp mysql

9. To retrieve the private IP-address of the bwce-monitoring container run the following command:

MacBook-Pro:~ ruben.middeljans$ docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' bwce-monitoring
 172.17.0.3

10. Fire up a browser and head to http://localhost:8080 to open the bwce-monitoring web interface. We see a basic but clean interface with no application instances yet!

bwce-mon-empty-e1507206692377.jpeg

11. Run the following command to instantiate and start the Docker BWCE application image (helloworld:latest) that we created in one of my previous blog posts. Pay attention to the fact that we are now exposing port 8080 on the Docker container as port 8081 to avoid any conflicts (bwce-monitoring container is also using port 8080). We are also setting an environmental variable BW_APP_MONITORING_CONFIG to enable monitoring.

MacBook-Pro:Downloads ruben.middeljans$ docker run --name "helloWorldInstance" -p 8081:8080 -e BW_APP_MONITORING_CONFIG='{"url":"http://172.17.0.3:8080"}' -d helloworld
493a9302943fc1d2d6a42dbc08663f4dbe4b5a3fa6f32ea2699a4b251792b6ac

12. Refresh http://localhost:8080 and now we should see an application instance with the name helloWorld running!

bwce-mon-helloworld.jpeg

13. Click on helloWorld and notice the additional information like instances, version, REST Doc URL and the amount of Jobs (Instance Id = Container Id).

bwce-mon-appinstances.jpeg

14. Click on Endpoints and see the exposed endpoints within the container.

bwce-mon-endpoints.jpeg

15. Click on Processes and see the actual TIBCO process flow (this wasn’t possible with TIBCO Administrator for BW5!). By clicking on Process Instrumentation we can start collecting statistics like amount of times executed, faults but also execution times.

bwce-mon-processes

Conclusion
For me personally this is a very welcome addition and gives just the level of insight needed inside the container that for many will be considered as a black box running TIBCO stuff. It tells the anyone interested what is in there and what is going on. Nothing more (fancy), nothing less.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: