Monitoring Ruby applications in Kubernetes environment

Before you monitor Ruby applications in Kubernetes environment, you must install the Unified Agent. Then, you update your application deployment to monitor the Ruby applications.

Before you begin

About this task

To enable the Ruby data collector, you need to install stacktracer-20.06.00.gem in Ruby application.

Procedure

  1. Put stacktracer-20.06.00.gem into the Ruby application folder, for example, app_folder/RubyDC.
  2. In the Dockerfile, insert the following lines between the section of bundle package and bundle install.

    RUN cp <app_folder>/RubyDC/stacktracer-20.06.00.gem <app_folder>/vendor/cache/
    RUN echo "gem 'zipkin-tracer','>=0.32'" >> Gemfile
    RUN echo "gem 'stacktracer','=20.06.00'" >> Gemfile
    
  3. Rebuild the application docker image.

    docker build --network=host -t <image-name>:<version>
    
  4. Repush it to a docker repository.

    docker tag <image-name>:<version> <docker-repository>/<namespace>/<image-name>:<version>
    docker push <docker-repository>/<namespace>//<image-name>:<version>
    
  5. Redeploy the application deployment in Kubernetes environment, or relaunch the docker image into container.

  6. If your Unified Agent is not installed in the default namespace of cp4mcm-cloud-native-monitoring, you need to add the following lines to the yaml file:

    UA_LWDC_LISTENER_URL=http://lwdc.<NAMESPACE>:8848
    UA_JAEGER_ENDPOINT_ZIPKIN_V2=http://zipkin.<NAMESPACE>:9411/api/v2/spans
    

    Replace <NAMESPACE> with the namespace where you install Unified Agent.