TheThingsArchive / ttn

The Things Network Stack V2
https://www.thethingsnetwork.org
MIT License
461 stars 276 forks source link

Add more data monitoring to gateways #244

Closed cambierr closed 7 years ago

cambierr commented 8 years ago

It could be great to add more monitoring fields to gateways. In our case, we are monitoring cpu load, ram % use, bandwidth, packet losses, and two temperatures.

This could be achieved by adding a repeated meta field which is a Key/Value pair for instance, so that custom monitoring is possible by adding fields in different gateways / forwarder implementations

remyleone commented 7 years ago

Would be good to add stats on:

htdvisser commented 7 years ago

We already have the following optional fields in stat messages:

It would be possible to add some system metrics to the packet_forwarder protocol like @cambierr suggests. We'd have to specify a set of "supported" fields (because sending arbitrary data is usually a bad idea):

The other statistics mentioned, can easily be determined on the server-side.


Implementing the system metrics fields is not much work on the server side, and it sounds like @cambierr already implemented this for the packet forwarder. Let's try to formalize a specification for these fields (also the existing ones, because those are not really documented either).

htdvisser commented 7 years ago

The gateway.Status proto now contains the following fields:

float   load_1
float   load_5
float   load_15
float   cpu_percentage
float   memory_percentage
float   temperature

These fields will have to be filled by the gateway. If the gateway uses the ttn-gateway-connector this can be done by simply filling the protocol buffer. The packet_forwarder does not support these fields.