Gateways Server API: Bulk stats endpoint improvement


I’ve been using the Gateways Server API, specifically the bulk stats endpoint, to retrieve stats from my gateways.
Recently I hit a roadblock which defeats the purpose of the endpoint: when a gateway is not found, because it is offline so there’s no updated stats in the server, the endpoint replies as follows:

 'code': 5,
 'message': 'error:pkg/identityserver:some_gateways_not_found (some gateways not found)',
 'details': [{
  '@type': '',
  'namespace': 'pkg/identityserver',
  'name': 'some_gateways_not_found',
  'message_format': 'some gateways not found',
  'correlation_id': '1689af4e405f428e9059f8b02af7f602',
  'code': 5

This forces me to query the stats one gateway at a time because I don’t know which ones are online or offline upfront. To this, I have 2 suggestions that I believe are well aligned with the endpoint purpose:

  1. List the gateways that were not found, so one can remove them from the list, and retry the request.
  2. Reply with the stats from gateways that were indeed found, and simply leave out those that weren’t.

Any feedback is appreciated. And if I’m missing something that could help working around this issue besides querying each gateways individually, that would be even more appreciated.


Potentially useful suggestion but as TTI Core team dont often frequent the forum fastest route to response and potential enabling is via the Things Network Slack using perhaps #ops or #support channels? The TTN Forumites and volunteers do not have access to the facilities to action this.

BTW IIRC I think there is a TTI Webinar this Thurs (16th)? covering network diagnostics, management, Console/NOC use etc. that might be worth joining…I’m sure they would welcome any suggestions for improvements along the way :wink:

1 Like

Suggestions can also be made as an issue on GitHub and are realistically the only way they will be recorded - Slack is for a more in the moment issue.

1 Like

Indeed :+1: Always forget the GitHub option and pull requests etc…