Introducing the all-new TIBCO Community site!

For current users, please click "Sign In" to reset your password and access the enhanced features. If you're a first-time visitor, we extend a warm welcome—click "Sign Up" to become a part of the TIBCO Community!

If you're seeking alternative community sites, explore ibi, Jaspersoft, and Spotfire.

Jump to content
  • Configuring TIBCO BusinessWorks Container Edition Application Monitor on RedHat OpenShift


    Manoj Chaurasia

    Table of Contents

    Overview

    This tutorial assumes you have a working knowledge of BusinessWorks Container Edition (BWCE) and RedHat OpenShift.

    The BWCE Application Monitor allows administrators to get detailed process-level monitoring and metrics of each BWCE application that has been deployed in your container management environment. Whilst the documentation at https://docs.tibco.com provide detailed setup and usage instructions they only cover Pivotal Cloud Foundry and Docker.

    This tutorial expands on that documentation to show how the BWCE Application Monitor can be deployed on RedHat OpenShift.

    Pre-Requisites

    Docker installed and configured on your machine

    Access to RedHat OpenShift (Origin or MiniShift). For this tutorial, I am using Minishift on my local MacBook, so if you have a full OpenShift environment you may have to make changes as required.

    BusinessWorks Container Edition Application. I already have a very basic BWCE Service - a greeting service that provides a REST based interface to return a greeting to the user. The source can be found on my GitHub: https://github.com/davewins/bwce_greeting.git

    BWrh1.png.84daff783258b82460f8582a311d40a3.png

    Docker Image of your application. I?ve built my docker image, and pushed it to my Docker Hub, which you can find at https://hub.docker.com/r/davewins/bwce_monitoring if you want to use this as an example. If you want to use your application, make sure you host the docker image in a registry that is accessible to OpenShift.

    BusinessWorks Container Edition Application Monitor. Download bwce_mon-<version>.zip from https://edelivery.tibco.com. You can follow the instructions in the BWCE Application Monitoring and Troubleshooting Guide at https://docs.tibco.com/pub/bwce/2.4.1/doc/pdf/TIB_bwce_2.4.1_application... to download and build the BWCE Application Monitoring container, but I will take you through this in the next section for completeness.

    Finally, I?m going to create a new empty project in OpenShift for this tutorial:

    Configure Postgresql in Openshift

    For this tutorial, I?m going to configure Postgresql for use as the database behind BWCE Application Monitor. From the initial project screen, I?m going to ?Browse Catalog? and then choose Postgresql.

    openshift_project.png.ff6d472f42f53d2146ade2da5e84dc0c.png

    Screenshot2022-11-02at2_06_48PM.thumb.png.4fb539b0ec88b470a9c56783ba9b6cd6.png

    I?ll follow the wizard to import the Postgresql image, but make sure you remember the settings you configure the database with. The important ones are the database Service Name, Username, Password and of course the database name. You will need these when configuring the BWCE Application Monitor. For now, I?ve chosen postgresql, admin/admin and the database name is bwcemon.

     

    unnamed_3.png.512b4a5a783462c6adfafae5666f3a80.png

    When the wizard is completed it shows you the complete configuration details as below:

    unnamed-2.png.e681d8a7edd67521972c3e2912306758.png

    It?s important to remember these - pay attention to the Connection URL too.

    Build the BWCE Application Monitor

    As per the instructions in the Application Monitoring and Troubleshooting Guide, download the bwce_mon-<version>.zip file from https://edelivery.tibco.com.

    Unzip this file in a directory of your choosing, and then from a command line within that directory execute the following Docker command:

     docker build -t bwce/monitoring:latest .

    After this step has completed, you need to push your image to an image registry that OpenShift can access. I pushed mine to docker hub by tagging it first, then pushing it as follows:

     

    unnamed-3.png.96c091061ae1ad9a04b19a9ce589d2c4.png

    Tagging:

     docker tag bwce/monitoring:latest davewins/bwce_monitoring:latest

    Pushing to docker hub:

     

    pasted_image_0-2.png.95ba08b48d5357596766062c9f3a54b5.png

    Deploy BWCE Application Monitor to OpenShift

    The next stage is to deploy the BWCE Application Monitor on OpenShift - this is where we will need our Postgresql settings we wrote down earlier ;-)

    In our OpenShift Project, under Application -> Deployments we will see our postgresql database deployed. If we click on ?Add to Project?, followed by ?Deploy Image? we can then fill out the details required to deploy the application monitor.

     

    unnamed-4.png.2736e047c88cbe4ab56721310b63666d.png

    Click on the Image Name radio button and fill out the name of the image you want to deploy. In my case it?s davewins/bwce_monitoring. Remember to press Enter or the magnifying glass to get OpenShift to go and read the details from the registry.

     

    pasted_image_0-3.png.5a557abd2eecbd06e7d9a9779c8bbdb4.png

    Scroll down the wizard page as there are going to be a couple of Environment Variables that we need to configure: PERSISTENCE_TYPE and DB_URL

    In our case, because we are using postgresql, then our PERSISTENCE_TYPE will be postgres (NOT postgresql), and our DB_URL will be: postgresql://admin:admin@postgresql:5432/bwcemon. The DB_URL is made up of the username/password and the Service Name:Port/database name, so make sure you get this correct, otherwise the BWCE Application Monitor will not start.

    Note: You may need to change the Name of the image as underscores etc. are not allowed.

    When ready, click Deploy.

     

    unnamed-5.png.a72b4334d294197f33c9569fe1879ed4.png

    To check that the BWCE Application Monitor has started correctly, we can go and check its logs. Click on Applications, choose Deployments, Click on our BWCEMonitoring application and then choose Logs, and you?ll see something like the screenshot below - any errors will be on the logs for you to sort out (most likely the DB_URL is incorrect)

     

    pasted_image_0-4.thumb.png.2db1193509041ca8311e4f13b6d25100.png

    Expose a Route to the BWCE Application Monitor

    At this stage, the monitor application is running - but it is not yet available to the ?outside world?. To do this, you need to create a Route to the container port (which is 8080).

    To create the Route, click on Applications, Choose Service, then our BWCE monitor to get to this screen:

     

    pasted_image_0-5.thumb.png.74beabf37f279d47d81d4e70c298cd58.png

    Click on Create Route and you?ll see the following screen. All of the defaults will be correct for this application, unless you want to enable TLS etc. The wizard will automatically create a hostname etc.

     

    unnamed-6.png.8b5508f4417966b6f0a7cbb80114bcb5.png

    When the Route is created, it will take you back to the previous screen where you will see the URL that you can use to access the monitor application:

     

    unnamed-7.png.43f7bbae1e99d0024b07bc07d371b7bc.png

     

     

    When you click on the link - you?ll see the application monitor - but it?s empty as we haven?t told the applications how to send their data to it. You must make a note of the Service HostName (in my case: bwcemonitoring.bwce-monitoring-tutorial.svc), as this will be used as part of the environment variables in the next step.

     

    unnamed-8.png.7cbe6069450b50bc24e5abe174c48e30.png

    Deploy a BWCE Service and Bind it to the Application Monitor

    So, we?re nearly done - this final step allows us to deploy a service that can be monitored, or you could take an existing service and adjust the environment variables required as needed. We?ll deploy my simple greeting service for now.

    Go back to ?Deploy Image?

    Fill out the image name, in my case I?m using davewins/greeting:latest, press enter to make OpenShift read the image so we can go and fill out the environment variables.

     

    unnamed-9.png.43c770b8bd5aaf834734c6abcd1e515d.png

    We need to create an Environment Variable called BW_APP_MONITORING_CONFIG.

    The value is a JSON string that has URL and a Value, with the value being made up of the Service Name and the port. So in our example, the value is: {"url": "http://bwcemonitoring.bwce-monitoring-tutorial.svc:8080"}

    When the application has started - it registers itself with the Application Monitor and so we can refresh the Application Monitor screen to see something like this:

     

    unnamed-10.png.da40ca7fe0dd9a84d77eea80a368945f.png

    We can then drill into the application itself and see further details such as the process, timings and so on. We can also turn on Process Instrumentation for much more detailed statistics etc.

     

    pasted_image_0-6.thumb.png.22b8ea7e0a771574e54dccf9a4fcee72.png

    Note that the REST URL in this case is an internal URL and cannot be accessed externally. To do this, you?ll have to expose the BW Service through a Route and use that URL instead.

    Creating a Route for our application

    To create the Route so that we can access the Swagger spec. And test our application, go to the Applications and click on Services. Click on our application (greeting in this case), and click on Create Route. Most things can be left as default - but we do want to change the Target Port from 7777 to 8081. This is because in my Docker image, I exposed both ports - but actually only 8081 is used. Once created, the service is created with a URL that you can now open, and put /swagger after the hostname to get the swagger UI.

     

    unnamed-11.png.b89ab472b14a57be92eabd187bee6ef8.png

    Screenshot2022-11-02at2_16_18PM.thumb.png.893ca50e21a3aab43a22932ff475b817.png

    If you push a few requests through - we can go and take a look at the BWCE Application Monitor and see the stats that get collected.

     

    unnamed-13.png.9668cb48decf7480413118e9c0653a82.png

    By default, you can see the number of jobs completed/faulted, etc. and by turning on Instrumentation - you can get much more detailed data.

    See the Application Monitoring and Troubleshooting guide for more details on how the Application Monitor should be used.


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...