iotagent-node-lib
iotagent-node-lib copied to clipboard
Metrics API: Common Metrics
This issue is about implementing the basic API metrics operations, along with the first batch of counters (the common ones for all the IoTP components).
Operations to implement:
GET <host:port>/admin/metrics
DELETE <host:port>/admin/metrics
GET <host:port>/admin/metrics?reset=true (maybe, yet under discussion)
Syntax:
{
"service": {
"service1": {
"subservs": {
"subserv1": {},
"subserv2": {},
"subserv3": {}
},
"sum": {}
},
"service2": {
"subservs": {
"subserv1": {},
"subserv2": {},
"subserv3": {}
},
"sum": {}
},
"service3": {
"subservs": {
"subserv1": {},
"subserv2": {},
"subserv3": {}
},
"sum": {}
}
},
"sum": {
"subservs": {
"subserv1": {},
"subserv2": {},
"subserv3": {}
},
"sum": {}
}
}
Metrics to implement:
- incomingTransactions: number of requests consumed by the component.
- incomingTransactionRequestSize: total size (bytes) in requests associated to incoming transactions (“in” from the point of view of the component).
- incomingTransactionResponseSize: total size (bytes) in responses associated to incoming transactions (“out” from the point of view of the component).
- incomingTransacionError: number of incoming transactions resulting in error.
- serviceTime: average time to serve a transaction.
- outgoingTransactions: number of requests sent by the component.
- outgoingTransactionRequestSize: total size (bytes) in requests associated to outgoing transactions (“out” from the point of view of the component).
- outgoingTransactionResponseSize: total size (bytes) in responses associated to outgoing transactions (“in” from the point of view of the component).
- outgoingTransacionError: number of outgoing transactions resulting in error.
Note: all incoming/outgoing channels count for the above metrics.