I wanted to update the list on what I have been doing with regards to =
an email that I sent out about a week ago ( I have attached the original =
email). Briefly I have been trying to add some additional data to the =
gmond XDR packets so that we can communicate attributes such as an =
alternate TITLE for the metric or which GROUP(s) the metric belongs to (or =
anything else that we dream up in the future). What I have done to solve =
this issue is the following:
Background:
The XDR packets that gmond sends to communicate metric information has =
been based on the fact that every gmond in the system is well aware of =
every metric supported by gmond. In other words, gmond has a built-in set =
of metrics that it supports and every gmond knows what those metrics are. =
Given that fact, it was very easy to assign an identifier to each of those =
metrics and simply send a very small packet that consisted only of the =
metric id and the corresponding value. No additional data about the =
metric had to be communicated between gmonds. However, gmetric was the =
one exception. In the case of gmetric (and I am also including 3.1 module =
based metrics as gmetrics), the entire metric definition had to be passed =
every time a gmetric was collected. This resulted in a significantly =
larger packet that had to carry with it the entire metric definition. =20
Going forward:
I have taken the fact that there are two different kinds of gmond =
packets and based a new packet layout around that. One packet is a data =
packet that carries a metric value and the other is a metadata packet that =
carries the definition of a metric. The new code proposes to first =
identify an XDR packet as either a data packet or a metadata packet. If =
the packet is a data packet, it is then further identified by a metric =
name, host and data type. A metadata packet also carries the metric name =
and host, but it really needs no further identification. Gmond has been =
refactored to send both types of XDR packets. At start up it will always =
send a metadata packet for each metric to announce the set of metrics a =
given gmond supports and the complete definition of each metric. This =
allows all of the receiving gmonds to store the metric definitions rather =
than having to rely on well defined hard coded metric definitions. In =
addition, this also allows any individual metric to include additional =
metadata to better support the web interface or anything else that might =
need more information about what the metric is or how to display it. =
After the initial metadata packet is sent, refresh metadata packets are =
only sent according to a configurable interval. In other words, the =
metadata packet might only be resent after every 10th data packet. Data =
packets are obviously sent whenever a metric value needs to be updated =
thus allowing for the actual metric data to be carried in a much smaller =
packet rather than the larger metadata packet. =20
Metric spoofing in this layout can not be supported in the same way =
that it was before. Bascially because in the old layout there was a =
specific "spoof" packet that all gmonds had to understand. Since the XDR =
packets are no longer identified by metric type (ie. gmetric, spoof, =
cpu_user, mem_free, etc.), and rather identified by data type, there is no =
longer a "spoof" packet. So in my first checkin, spoofing will probably =
be broken. However since one of the identifying elements of every packet =
is the host, I am hoping to support the spoofing functionality by simply =
providing a way to override the host information that is obtained by a =
call to apr_gethostbyname() by either using the host found in the packet =
or providing a way to add a "SPOOF" key as additional metadata for the =
metic and providing the spoof host name as a value.
In addition, this will change the XML output that gmetad reads from =
gmond by adding a new tag called <EXTRA_DATA>. One or more <EXTRA_DATA> =
tags will contain any extra metadata that has been added to the metric =
outside of the standard attributes that are currently defined in the =
<METRIC> tag. For now the extra attributes include TITLE, DESCRIPTION and =
GROUP, but in reality it could contain any new attribute. BTW, this also =
adds two new configuration directives. One called 'send_meta_data_pkt_inte=
rval' that belongs in the 'Globals' block and another called 'title' that =
goes in the 'Metric' block
This new XDR layout also paves the way for moving all of the builtin =
metrics out as metric modules. Once that is done, the XDR structures that =
are defined in protocol.h can be cleaned up significantly. I hope to be =
able to checkin this new XDR layout code by the end of this week or the =
beginning of next week. This may destabilize trunk for a little while =
until the bugs can be worked out. But it shouldn't be too terrible.
Any comments?
Brad
|