1

I am currently experimenting with the Azure TSI Gen2 ApiVersion = "2020-07-31" and I am wondering the effect of the GetSeries and GetEvents endpoints Take-parameter.

If I query TSI data for a wide searchSpan that contains more events than I define on my Take-parameter, what happens? Is the data returned in some order? What is the expected form of the response data?

Documentation definition for the Take

take - integer - Maximum number of property values in the whole response set, not the maximum number of property values per page. Defaults to 10,000 when not set. Maximum value of take can be 250,000.

ajr
  • 874
  • 2
  • 13
  • 29

2 Answers2

1

As documented here: https://learn.microsoft.com/en-us/azure/time-series-insights/concepts-query-overview#time-series-query-tsq-apis

Get Events and Get Series API supports pagination to retrieve the complete response dataset for the selected input.

asergaz
  • 996
  • 5
  • 17
  • 1
    I understand paging, however, the take parameter has the following description: `Maximum number of property values in the whole response set, not the maximum number of property values per page. Defaults to 10,000 when not set. Maximum value of take can be 250,000.` – ajr Feb 25 '21 at 15:11
  • Source available here: https://github.com/Azure-Samples/Azure-Time-Series-Insights/blob/master/gen2-sample/csharp-tsi-gen2-sample/DataPlaneClient/Generated/TimeSeriesInsights/DataPlane.TimeSeriesInsights/Generated/Models/GetEvents.cs – ajr Feb 25 '21 at 15:16
1

The take parameter specifies the number of events returned by the query (across pages). So if your search span has more events than your "take", TSI randomly selects, or 'takes', that set of records from storage. E.g. if you have 20k events in your search span, and a take of 10k, you'd get a random 10k events from the 20k in that timeframe.

In the TSI explorer, when you "Explore Events" to see the raw data, the explorer calls GetEvents. TSI explorer will always try to show the max (250k) events and will notify you if there more than 250k in the search span.

Data isn't returned in any order by the APIs. Adding sorting capabilities is something we have on our roadmap. Here's a feedback item where you can upvote the request to add this functionality, as well.

Here's some examples showing the request/response of GetEvents and other APIs.

Dharman
  • 30,962
  • 25
  • 85
  • 135
Shreya Sharma
  • 306
  • 1
  • 3
  • How does the explorer know there are more events? How can we find that out through the API? Also that feedback link doesn't work. – andrej351 Sep 20 '21 at 03:34