Sign in to follow this  
Purnadi K

Container

Recommended Posts

This might be my last article before leaving my beloved LogicMonitor. It has been a privilege to be part of the Support team but life happens to everyone and I know all things work together for good....

 

Now the Docker monitoring. We know the standard monitoring described and explained here: https://www.logicmonitor.com/support/monitoring/applications-databases/docker/, which takes advantage of Google cAdvisor, a tool, if I may define it, by Google to monitor Docker containers, elaborated nicely in greater details here: https://github.com/axibase/cadvisor-atsdThis tool is equipped with API which LogicMonitor uses to collect some data about the running Docker. There is a readily available datasource for such. 

To make life more exciting as a support team member, about a year ago I received a request from one among ALL our important Clients, by the name of RS (a.k.a Robert), whose request is the following:

We are using cadvisor to provide docker metrics to Logic Monitor. Is there a way to snag a history of the size of each container

that is definitely beyond Support and usually it will go to our excellent Monitoring Engineering team whose responsibility is to develop LogicModules, but I embarked on a challenging journey and within a month, a datasource for that purpose was ready.

This is beside the matter, I am in the midst of gaining knowledge about containers and came across an orchestration system for containers which is boasted to have a 'self-healing' mechanism, Kubernetes. Now I recognize that in the modern cloud infrastructure, self-healing is not uncommon. The indisputable remarkable cloud providers of this generation already have the same kind of feature or products in their offerings, auto/self-scaling, auto/self-replicating, auto-scheduling, etc. This is in-parallel (or even deploying the idea) of the fast-progressing development of Artificial Intelligence in cloud and system infrastructure, a system that has the intelligence to heal itself. 

Taking the benefit of Kubernetes that I have installed, researching container metrics in regards with the size began and the answer lies within this statement: 

Quote

"You want a system to offer and push their own health status to the monitoring layer, because who knows better about status than the system itself?"

 
 

 

Exactly the same goes with cAdvisor for Docker which has API to monitor itself and that is the very method that LogicModules "Docker_Containers_cAdvisor20" is using to collect data from Docker containers. Everything we need for monitoring is already available and provided by the source...the cAdvisor API.

Some sample metrics presented by cAdvisor API in a web-based display:

cadvisor_web.thumb.png.48ab93155f379846b66f313aaa9cd9be.png

cadvisor_docker.thumb.png.ffaeba9ef2372978c1d3eaa4f898e897.png

We just need to find out how to process those outputs and put the numeric data into datasource.

 

Fast forward, this is the final product, the monitoring of virtual size of Docker containers (orchestrated by Kubernetes) in my test and please take note of the instance names and wildvalues:

virtual_size_container.thumb.png.c99a065259cc6cf8b1ad2fb2ee3cd6d9.png

virtual_size_rawdata.thumb.png.a2196ed17ba1e21913a590ea350e00b0.png

Note: it is also seen (in the 2nd screenshot, a datapoint by the name "virtual_size_sum" and "virtual_size_mbyte".

 

Now the next question is: how the data numbers come to be?

Firstly, let us take an example of one container highlighted above as an example for the calculation. The instance (container) has a name of "k8s_carts_carts-794f6cc876-z9d6p_sock-shop_7655a496-d347-11e7-90ef-000c29412e95_0"and has wildvalue of:

8afc5e907b809b9a15884b518fdff1678cad54d2562d6d0b63bd3fb5ce77d5a3

If we trace back, that wildvalue can be found in the data collected from cAdvisor API as well, in a text-based result as below, which are the output of running Docker processes:

wildvalue.thumb.png.e1f1c41accc49f5d58dfaaa7bd8f1b56.png

Note: there are 2 (two) processes for the containers, hence the SUM of the virtual size datapoint ("virtual_size_sum").

When we zoom into only those 2 processes with the same wildvalue of one container, we will see clearer:

pid_zoom.thumb.png.48c2de11dbf9e818816a30dc893d9376.png

It makes the total virtual size as follows:

virtual size sum = 1795608576 + 1560576 = 1797169152 B (= 1797169152/1024/1024 = 1713.9140625 MB)

(note: virtual size PID 5686 = 1560576 , virtual size PID 5810 = 1795608576)

 

The number is precisely what cAdvisor web-based data earlier shows:

cadvisor_data.thumb.png.9160b257eecd0b61a6ec519aba74999d.png

upsize screenshots:

pid5686.thumb.png.b79a35fea94066cf3db859f7999d3448.pngpid5810.thumb.png.3418da29537265acb30f72fd7a3417fb.png

 

 

If you see the total virtual size number, that is what is presented by LogicModule collected from the cAdvisor:

virtual_size_rawdata_zoom.thumb.png.ce8389b49a6839a7a38fb6634cd554a0.png

 

The datasource had actually been submitted, but it is not released yet in the community and is still undergoing a review process by the official team, so it may take a while. (Locator Code:JAGW6D). Therefore there is no way to download it from LM Exchange yet.JAGW6D.thumb.png.79870bf5205d41f277ad1513022fe6cd.pnglmexchange_failed.thumb.png.e30cb802d9995213fbbff235976715eb.png

 

If you wish to have it, you may contact the excellent Support Team and they will search my past case to get hold of the datasource. Alternatively, you may drop an email in my personal address: purnadi.k@gmail.com as I will sadly be leaving soon.

 

Life is too short, so live your lives to the fullest and may we meet again, one way or another. Have a fun day! Cheers.

Edited by Purnadi K

Share this post


Link to post
Share on other sites
Guest Purnadi

Do you need it, Sir Horwath? 

I still remember serving you, one of nicest LogicMonitor customers we have :) & you always make our day better!

-pk

Share this post


Link to post
Share on other sites
Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this