mrproliu commented on issue #6118:
URL: https://github.com/apache/skywalking/issues/6118#issuecomment-753486437


   I have installed a simple Zabbix agent and server demo in the local machine, 
and using Wireshark to monitor the network base on `Active Checks Mode`. It 
will help to debug and watch data locally. I uploaded this [pcapng 
file](https://github.com/apache/skywalking/files/5760438/dump.pcapng.zip), you 
can view the specific data by downloading the `Wireshark` software.
   
   The metrics key in Zabbix follow this format: `keyName[params]`, for more 
specifications, please refer to 
https://www.zabbix.com/documentation/current/manual/config/items/item/key
   
   Let's take the key of `system.cpu.load[all,avg15]` as an example, and divide 
it into two parts: `Key Name` and `Parameter`:
   
   #### Key Name
   In the above example, it is `system.cpu.load`.
   The metrics key in Zabbix is not particularly compatible with our MAL. When 
MAL parses, it will consider `system` as a metric and cannot find the `cpu` 
property. Zabbix does not provide a similar formatting key function, such as 
`system.cpu.load -> system_cpu_load`.
   
   So I thought of two ways to solve it:
   1. Users manually replace the "." with the "_" symbol when inputting 
expressions. In the above example, the expression of MAL must be manually 
replaced with `system_cpu_load`. When the backend receives the data and 
prepares to convert the MAL, it will also change the `.` -> `_` of the key in 
the metrics.
   2. The user does not need to change the name of the metrics, it is solved by 
extending the function of MAL. When MAL cannot find `SampleFamily`, a new 
`SampleFamilyFinder` is provided to solve it. In `SampleFamilyFinder`, it can 
be solved by implementing the `propertyMissing` method.
   
   #### Parameter
   In the above example, it is `all,avg15`
   
   We can convert it into the form of multiple tag values, and identify the 
index as a tag key. In the above data, it will become `{0: all, 1: avg15}`.
   At this time, you can filter by `.tagEqual('0','all').tagEqual('1','avg15')` 
in MAL.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to