sessions.json 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. {
  2. "get": {
  3. "tags": ["Releases"],
  4. "description": "Returns a time series of release health session statistics for projects bound to an organization.\n\nThe interval and date range are subject to certain restrictions and rounding rules.\n\nThe date range is rounded to align with the interval, and is rounded to at least one hour. The interval can at most be one day and at least one hour currently. It has to cleanly divide one day, for rounding reasons.",
  5. "operationId": "Retrieve Release Health Session Statistics",
  6. "parameters": [
  7. {
  8. "name": "organization_slug",
  9. "in": "path",
  10. "description": "The slug of the organization.",
  11. "required": true,
  12. "schema": {
  13. "type": "string"
  14. }
  15. },
  16. {
  17. "name": "project",
  18. "in": "query",
  19. "description": "The ID of the projects to filter by.\n\nUse `-1` to include all accessible projects.",
  20. "required": true,
  21. "schema": {
  22. "type": "array",
  23. "items": {
  24. "type": "integer"
  25. }
  26. },
  27. "style": "form",
  28. "explode": true
  29. },
  30. {
  31. "name": "field",
  32. "in": "query",
  33. "description": "The list of fields to query.\n\nThe available fields are `sum(session)`, `count_unique(user)`, and the following functions applied to the `session.duration` metric: `avg`, `p50`, `p75`, `p90`, `p95`, `p99` and `max`.\n\nFor example, `p99(session.duration)`.",
  34. "required": true,
  35. "schema": {
  36. "type": "array",
  37. "items": {
  38. "type": "string"
  39. }
  40. },
  41. "style": "form",
  42. "explode": true
  43. },
  44. {
  45. "name": "environment",
  46. "in": "query",
  47. "description": "The name of environments to filter by.",
  48. "required": false,
  49. "schema": {
  50. "type": "array",
  51. "items": {
  52. "type": "string"
  53. }
  54. },
  55. "style": "form",
  56. "explode": true
  57. },
  58. {
  59. "name": "groupBy",
  60. "in": "query",
  61. "description": "The list of properties to group by.\n\nThe available groupBy conditions are `project`, `release`, `environment` and `session.status`.",
  62. "required": false,
  63. "schema": {
  64. "type": "array",
  65. "items": {
  66. "type": "string"
  67. }
  68. },
  69. "style": "form",
  70. "explode": true
  71. },
  72. {
  73. "name": "query",
  74. "in": "query",
  75. "description": "A free-form query that is applied as a filter.\n\nAn example query could be `release:\"1.1.0\" or release:\"1.2.0\"`.",
  76. "required": false,
  77. "schema": {
  78. "type": "string"
  79. }
  80. },
  81. {
  82. "name": "statsPeriod",
  83. "in": "query",
  84. "description": "This defines the range of the time series, relative to now.\n\nThe range is given in a `\"<number><unit>\"` format.\n\nFor example `1d` for a one day range. Possible units are `m` for minutes, `h` for hours, `d` for days and `w` for weeks.\n\nIt defaults to `90d`.",
  85. "required": false,
  86. "schema": {"type": "string"}
  87. },
  88. {
  89. "name": "interval",
  90. "in": "query",
  91. "description": "This is the resolution of the time series, given in the same format as `statsPeriod`.\n\nThe default resolution is `1h` and the minimum resolution is currently restricted to `1h` as well.\n\nIntervals larger than `1d` are not supported, and the interval has to cleanly divide one day.",
  92. "required": false,
  93. "schema": {"type": "string"}
  94. },
  95. {
  96. "name": "statsPeriodStart",
  97. "in": "query",
  98. "description": "This defines the start of the time series range, in the same format as the `interval`, relative to now.",
  99. "required": false,
  100. "schema": {"type": "string"}
  101. },
  102. {
  103. "name": "statsPeriodEnd",
  104. "in": "query",
  105. "description": "This defines the end of the time series range, in the same format as the `interval`, relative to now.",
  106. "required": false,
  107. "schema": {"type": "string"}
  108. },
  109. {
  110. "name": "start",
  111. "in": "query",
  112. "description": "This defines the start of the time series range as an explicit datetime.",
  113. "required": false,
  114. "schema": {"type": "string", "format": "date-time"}
  115. },
  116. {
  117. "name": "end",
  118. "in": "query",
  119. "description": "This defines the inclusive end of the time series range as an explicit datetime.",
  120. "required": false,
  121. "schema": {"type": "string", "format": "date-time"}
  122. }
  123. ],
  124. "responses": {
  125. "200": {
  126. "description": "Time-series Session Statistics.",
  127. "content": {
  128. "application/json": {
  129. "schema": {
  130. "$ref": "../../components/schemas/sessions.json#/Sessions"
  131. },
  132. "example": {
  133. "start": "2021-02-01T00:00:00Z",
  134. "end": "2021-02-04T00:00:00Z",
  135. "intervals": [
  136. "2021-02-01T00:00:00Z",
  137. "2021-02-02T00:00:00Z",
  138. "2021-02-03T00:00:00Z"
  139. ],
  140. "groups": [
  141. {
  142. "by": {"session.status": "healthy"},
  143. "totals": {"sum(session)": 1715553},
  144. "series": {"sum(session)": [683772, 677788, 353993]}
  145. },
  146. {
  147. "by": {"session.status": "abnormal"},
  148. "totals": {"sum(session)": 0},
  149. "series": {"sum(session)": [0, 0, 0]}
  150. },
  151. {
  152. "by": {"session.status": "crashed"},
  153. "totals": {"sum(session)": 383},
  154. "series": {"sum(session)": [33, 26, 324]}
  155. },
  156. {
  157. "by": {"session.status": "errored"},
  158. "totals": {"sum(session)": 1565},
  159. "series": {"sum(session)": [163, 201, 1201]}
  160. }
  161. ]
  162. }
  163. }
  164. }
  165. },
  166. "400": {
  167. "description": "Wrong Parameters",
  168. "content": {
  169. "application/json": {
  170. "schema": {
  171. "$ref": "../../components/schemas/error.json#/ApiError"
  172. }
  173. }
  174. }
  175. },
  176. "401": {
  177. "description": "Unauthorized"
  178. },
  179. "403": {
  180. "description": "Forbidden"
  181. }
  182. },
  183. "security": [
  184. {
  185. "auth_token": ["org: read"]
  186. }
  187. ]
  188. }
  189. }