Monitoring Splunk

SignalFX API to sum metrics

AleksandarT
New Member

We are using SignalFX to publish metrics to it and all looks good so far. We have a client that wants to use the SignalFX API itself in order to query timeseries window data to get some data.
The query that we have written returns the metrics for each HOST (sum per minute). Based on the documentation here (https://dev.splunk.com/observability/reference/api/retrieve_timeserieswindow/latest) i dont see any way of how a sum could be achieved (instead of per host results).
Theoretically i could just iterate over the object keys and sum up the results, but it would be better if this is returned out of the box.
Here is the curl command i am using to retrieve the data
```
curl --request GET \
--url '${DOMAIN}/v1/timeserieswindow?startMS=1623943080000&endMS=1623943140000&query=sf_metric%3Ainsert%20AND%20App%3Aservices-cloud%20AND%20Environment%3Abeta&resolution=60000' \
--header 'X-SF-token: ${TOKEN}'
```
The response that i am getting is
```
{
"data": {
"E4EXtGzAgAA": [
[
1623943140000,
4.0
]
],
"E4E22smAYAA": [
[
1623943140000,
10.0
]
]
},
"errors": [
]
}
```
where `E4EXtGzAgAA` and `E4E22smAYAA` are host ID's. I would like to have only the value 14 in the response.
Any way to achieve this?
Thanks a lot

Labels (1)
0 Karma
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...