Array support in http/json metricset doesn't handle simple String Arrays

We are currently trying to pull data from an application that exposes a list of connected systems as a REST endpoint, returning a simple String array. So when I call http://example.com/rest/connectedSystems/ it returns

["systemA", "systemB", "anotherOne", "theLastOne"]

This doesn't work with the standard http/json metricset, even with json.is_array: true

The problem seems to be that pull request #6480 added support for JSON arrays containing JSON objects (type []common.MapStr) but not for simple String arrays (which are still valid JSON I believe).

Is there a way to get this scenario supported easily?

Hi @BennyInc,

As you are seeing, at the moment this metricset only supports parsing objects, or lists of objects, but not lists of simple values. We could consider to open an enhacement request to support this, but I wonder how would you expect to store and consume a list of systems like this one.

Basically I'd like to be able to track which systems are connected at any given point in time. This can be done by storing one doc for each system and timestamp, allowing me to aggregate later on.
So I could later query for systemA, and see at what times it was or was not connected. Also, I'd be able to use a cardinality query to see how many systems were connected at any given time (having a trend graph on Kibana for it).

Ok, I guess that an option could be to parse the array when json.is_array is set to true, and store the single values, one per doc, in the namespace. Could you please open an enhancement request for this?

Done, thanks. #9743 is opened.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.