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
- Check whether your service account has access to Kubernetes resources. For more information, see Authorizing the data collector to access Kubernetes resources.
- Ensure that Unified Agent is installed. For more information, see Installing and configuring the Unified Agent.
- Check whether you downloaded the Ruby data collector package from Passport Advantage. For more information, see Downloading the Ruby data collector.
About this task
To enable the Ruby data collector, you need to install stacktracer-20.06.00.gem
in Ruby application.
Procedure
- Put
stacktracer-20.06.00.gem
into the Ruby application folder, for example, app_folder/RubyDC
. -
In the Dockerfile, insert the following lines between the section of
bundle package
andbundle 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
-
Rebuild the application docker image.
docker build --network=host -t <image-name>:<version>
-
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>
-
Redeploy the application deployment in Kubernetes environment, or relaunch the docker image into container.
-
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.