I'm playing with the amqp output plugin, wihch uses util_format_json.c for putting the values in the wire.<div><br></div><div>However, for multi-valued samples the name each value, as well as the type (COUNTER, GUAGE etc) are missing.</div>
<div>For example, for load average the json looks like this:</div><div><div>[</div><div> {"values":[0.0561523,0.188477,0.276855],</div><div> "time":1268776516,</div><div> "interval":10,</div>
<div> "host":"<a href="http://host.domain.com">host.domain.com</a>",</div><div> "plugin":"load",</div><div> "plugin_instance":"",</div><div> "type":"load",</div>
<div> "type_instance":""}</div><div>]</div></div><div><br></div><div>The three values are named 'shortterm', 'midterm' and 'longterm' and are all of type GUAGE.</div><div><br>
</div><div>For systems that are "far away" from collectd without access to the types database, it would be nice to have this info.</div><div><br></div><div>May I suggest a format for the JSON to incorporate this data.</div>
<div>Again, using load as an example:</div><div><div>[</div><div> {"values":{"shortterm:GUAGE":0.0561523, "midterm:GUAGE":0.188477, "longterm:GUAGE":0.276855},</div><div> "time":1268776516,</div>
<div> "interval":10,</div><div> "host":"<a href="http://host.domain.com">host.domain.com</a>",</div><div> "plugin":"load",</div><div> "plugin_instance":"",</div>
<div> "type":"load",</div><div> "type_instance":""}</div><div>]</div></div><div><br></div><div>Basically changing "values" from an array to a hash, keyed by a "name:type". </div>
<div><br></div><div>Thoughts?</div><div><br></div><div>- Bob</div>