@tailglow/cli 0.6.5 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -247,6 +247,17 @@ export const CLI_COMMANDS = [
247
247
  ],
248
248
  "query_params": [],
249
249
  "body_fields": [
250
+ {
251
+ "name": "tgl_authoring_mode",
252
+ "type": "TglAuthoringMode",
253
+ "required": false,
254
+ "description": "Project-wide authoring behavior. Aggressive chooses a defensible mapping; normal requests clarification for competing meanings. Defaults to aggressive. Existing scripts are unchanged. Optional.",
255
+ "allowed_values": [
256
+ "normal",
257
+ "aggressive"
258
+ ],
259
+ "deprecated": null
260
+ },
250
261
  {
251
262
  "name": "name",
252
263
  "type": "string",
@@ -3323,6 +3334,7 @@ export const CLI_COMMANDS = [
3323
3334
  "`transform_script` is TGL and must compile. A script that does not parse is rejected rather than stored, because an unparseable script would fail on every record it later touched.",
3324
3335
  "The script must write every field the view's output schema declares.",
3325
3336
  "Omitting the script queues the transform for generation instead of rejecting it.",
3337
+ "`collection_schema_version` must be settled. A candidate stays out of views until it settles, so naming one is refused with a 409; settle it with Update Collection Schema first.",
3326
3338
  "A transform on a collection-backed view must name the `collection_schema_version` it covers. View-to-view transforms pass null, because they read another view's output rather than a collection schema.",
3327
3339
  "`transform_script` cannot be whitespace-only. Omit it to have TGL generated instead."
3328
3340
  ],
@@ -3815,13 +3827,24 @@ export const CLI_COMMANDS = [
3815
3827
  ],
3816
3828
  "notes": [
3817
3829
  "`last` returns the latest reading in each time bucket within the requested range.",
3818
- "`coverage_mode=observed` returns partial observed rows beyond the strict boundary without filling missing buckets. `coverage_reasons` names unresolved view scopes; `excluded` is informational.",
3819
- "Record keys are UTC bucket starts. A bucket is final only when its UTC calendar end (start plus one `interval`) is at or before `complete_through_at`; strict omits all other buckets. A null cutoff means unknown completeness. Observed may include populated partial buckets even when the requested end lies inside one, and does not synthesize empty partial buckets.",
3830
+ "Record keys are UTC bucket starts. Buckets still filling come back with the data counted so far: every key at or after `first_incomplete_bucket_at` is incomplete and can still grow, so report it as \"so far\" and never compare it with a complete bucket. Incomplete buckets with no data yet are left out rather than returned as zero.",
3831
+ "`complete_through_at` is the instant before which every number is final. Null means completeness is unknown, and then every bucket is incomplete.",
3832
+ "For complete buckets only, leave out every key at or after `first_incomplete_bucket_at`.",
3833
+ "`coverage_reasons` names unresolved view scopes; `excluded` is informational.",
3834
+ "Series are ranked by their total over the range (the count for a `count` metric, the sum of Last readings for `last`, the sum otherwise), ties broken by series hash, and `limit` of them come back per page, the metric's `ui_chart_max_series` by default. Walk the pages with `pagination.next_cursor` and `pagination.prev_cursor`; `pagination.total` counts every series.",
3835
+ "`__other__` folds in every series that is not on the current page, so the page plus Other always adds up to the range total and a share is right on every page.",
3836
+ "When the metric has pinned series, they make up the whole first page and later pages walk the other series by rank.",
3837
+ "`series` returns exactly the listed series on one page, unranked and without `__other__`.",
3838
+ "A metric with a `time_dimension` returns its range folded instead of as a timeline: every hour merges into its hour of the day, weekday or hour of the week. Record keys are then the category as a decimal string (`\"0\"` to `\"23\"`, `\"1\"` for Monday to `\"7\"` for Sunday, `\"0\"` to `\"167\"`), every category is present whatever `normalize` says, and `time_dimension` echoes it.",
3839
+ "Data is stored by UTC hour. A fold places each hour in its category in the request `timezone` (echoed as `timezone`), one hour at a time, so a daylight saving change moves only the hours after it.",
3840
+ "A fold reads hourly data whatever `interval` says, covers at most 400 days (a longer range is refused), and includes the current hour's data so far.",
3841
+ "In a fold an empty category is `0` when `empty_bucket_handling` is `zero` and `null` when it is `gaps`, cumulative values are `null`, and there is no trend line.",
3820
3842
  "The aggregation window is resolved in order: an explicit `start_at` plus `end_at` wins; otherwise `time_range` is used; otherwise the metric's saved chart range is used.",
3821
3843
  "`start_at` and `end_at` only take effect when sent together. Sending one without the other has no effect on the window.",
3822
3844
  "When both are provided, `start_at` must be earlier than `end_at`.",
3823
3845
  "`time_range=custom` without explicit dates falls back to the saved custom range of `page_id`, then the metric, then the project.",
3824
- "`timezone` must be a valid IANA timezone name, or `UTC`."
3846
+ "`timezone` must be a valid IANA timezone name, or `UTC`.",
3847
+ "`after` and `before` are mutually exclusive."
3825
3848
  ],
3826
3849
  "path_params": [
3827
3850
  {
@@ -3842,17 +3865,6 @@ export const CLI_COMMANDS = [
3842
3865
  }
3843
3866
  ],
3844
3867
  "query_params": [
3845
- {
3846
- "name": "coverage_mode",
3847
- "type": "string",
3848
- "required": false,
3849
- "description": "Strict returns only final data. Observed includes partial data beyond complete_through_at without filling missing buckets. Optional. Defaults to `\"strict\"`.",
3850
- "allowed_values": [
3851
- "strict",
3852
- "observed"
3853
- ],
3854
- "deprecated": null
3855
- },
3856
3868
  {
3857
3869
  "name": "start_at",
3858
3870
  "type": "ISODateString",
@@ -3873,7 +3885,7 @@ export const CLI_COMMANDS = [
3873
3885
  "name": "interval",
3874
3886
  "type": "ChartInterval",
3875
3887
  "required": false,
3876
- "description": "Requested aggregation bucket interval. Optional.",
3888
+ "description": "Requested aggregation bucket interval. A metric with a time dimension ignores it and always folds hourly data. Optional.",
3877
3889
  "allowed_values": [
3878
3890
  "minute",
3879
3891
  "hour",
@@ -3918,7 +3930,7 @@ export const CLI_COMMANDS = [
3918
3930
  "name": "timezone",
3919
3931
  "type": "string",
3920
3932
  "required": false,
3921
- "description": "IANA timezone used to calculate date boundaries. Optional.",
3933
+ "description": "IANA timezone used to calculate date boundaries and to place each hour in a time dimension's categories. Optional.",
3922
3934
  "allowed_values": [],
3923
3935
  "deprecated": null
3924
3936
  },
@@ -3947,20 +3959,47 @@ export const CLI_COMMANDS = [
3947
3959
  "deprecated": null
3948
3960
  },
3949
3961
  {
3950
- "name": "max_series",
3962
+ "name": "series",
3963
+ "type": "string",
3964
+ "required": false,
3965
+ "description": "Comma-separated series hashes to return. Optional.",
3966
+ "allowed_values": [],
3967
+ "deprecated": null
3968
+ },
3969
+ {
3970
+ "name": "limit",
3951
3971
  "type": "integer",
3952
3972
  "required": false,
3953
- "description": "Maximum number of individual series to return. Optional. Minimum: `1`. Maximum: `50`.",
3973
+ "description": "Number of series to return per page. Defaults to the metric's `ui_chart_max_series`. Optional. Minimum: `1`. Maximum: `200`.",
3954
3974
  "allowed_values": [],
3955
3975
  "deprecated": null
3956
3976
  },
3957
3977
  {
3958
- "name": "series",
3978
+ "name": "after",
3959
3979
  "type": "string",
3960
3980
  "required": false,
3961
- "description": "Comma-separated series hashes to return. Optional.",
3981
+ "description": "Cursor from `pagination.next_cursor` of a previous response. Returns the resources after that page. Optional.",
3982
+ "allowed_values": [],
3983
+ "deprecated": null
3984
+ },
3985
+ {
3986
+ "name": "before",
3987
+ "type": "string",
3988
+ "required": false,
3989
+ "description": "Cursor from `pagination.prev_cursor` of a previous response. Returns the resources before that page. Optional.",
3962
3990
  "allowed_values": [],
3963
3991
  "deprecated": null
3992
+ },
3993
+ {
3994
+ "name": "sort",
3995
+ "type": "string",
3996
+ "required": false,
3997
+ "description": "Ranking direction of the series. `desc` returns the largest first. Optional. Defaults to `\"desc\"`.",
3998
+ "allowed_values": [
3999
+ "asc",
4000
+ "desc"
4001
+ ],
4002
+ "deprecated": null
3964
4003
  }
3965
4004
  ],
3966
4005
  "body_fields": []
@@ -3982,6 +4021,11 @@ export const CLI_COMMANDS = [
3982
4021
  "Field references and filters must be compatible with the selected view.",
3983
4022
  "Custom chart ranges require both dates, with an interval of at least 30 minutes.",
3984
4023
  "Color-mode configuration must match the selected chart color mode.",
4024
+ "`ui_chart_color_mode` must be a mode the chart type supports. A metric created without a `ui_chart_type` is a `bar` chart and is checked as one.",
4025
+ "`time_dimension` must be one the chart type supports: `breakdown` takes `hour_of_day` or `weekday`, `heatmap` takes `hour_of_week`, `hour_of_day` or `weekday`, and every other chart type takes none.",
4026
+ "A `heatmap` chart requires a `time_dimension`.",
4027
+ "A `time_dimension` cannot be combined with a cumulative `ui_chart_value` (`cumulative_sum` or `cumulative_count`).",
4028
+ "`ui_chart_order` is read by `breakdown` charts only; other chart types ignore it.",
3985
4029
  "`filters` must be a valid filter expression.",
3986
4030
  "`timestamp_field` cannot reference `__meta__` metadata.",
3987
4031
  "`group_by_display_fields` is set at create and cannot be changed afterwards, because each series takes its label from the first record it sees. Map a `group_by` field to a view field that carries a readable value for the same record."
@@ -4099,7 +4143,10 @@ export const CLI_COMMANDS = [
4099
4143
  "stat",
4100
4144
  "gauge",
4101
4145
  "calendar",
4102
- "uptime"
4146
+ "uptime",
4147
+ "breakdown",
4148
+ "heatmap",
4149
+ "table"
4103
4150
  ],
4104
4151
  "deprecated": null
4105
4152
  },
@@ -4147,14 +4194,6 @@ export const CLI_COMMANDS = [
4147
4194
  "allowed_values": [],
4148
4195
  "deprecated": null
4149
4196
  },
4150
- {
4151
- "name": "ui_chart_show_monitors",
4152
- "type": "boolean",
4153
- "required": false,
4154
- "description": "Whether the chart displays monitor thresholds. Optional.",
4155
- "allowed_values": [],
4156
- "deprecated": null
4157
- },
4158
4197
  {
4159
4198
  "name": "ui_chart_show_trends",
4160
4199
  "type": "boolean",
@@ -4311,6 +4350,29 @@ export const CLI_COMMANDS = [
4311
4350
  ],
4312
4351
  "deprecated": null
4313
4352
  },
4353
+ {
4354
+ "name": "time_dimension",
4355
+ "type": "TimeDimension",
4356
+ "required": false,
4357
+ "description": "Calendar position the chart folds the metric's hourly data into, such as the hour of the day. Null charts the data over time. Optional.",
4358
+ "allowed_values": [
4359
+ "hour_of_day",
4360
+ "weekday",
4361
+ "hour_of_week"
4362
+ ],
4363
+ "deprecated": null
4364
+ },
4365
+ {
4366
+ "name": "ui_chart_order",
4367
+ "type": "ChartOrder",
4368
+ "required": false,
4369
+ "description": "Order a breakdown chart shows its groups in. Null keeps a time dimension in its natural order and ranks field groups by value. Optional.",
4370
+ "allowed_values": [
4371
+ "natural",
4372
+ "value"
4373
+ ],
4374
+ "deprecated": null
4375
+ },
4314
4376
  {
4315
4377
  "name": "ui_chart_custom_range_start_at",
4316
4378
  "type": "ISODateString",
@@ -4331,7 +4393,7 @@ export const CLI_COMMANDS = [
4331
4393
  "name": "ui_chart_max_series",
4332
4394
  "type": "integer",
4333
4395
  "required": false,
4334
- "description": "Maximum number of individual series displayed by default. Optional. Minimum: `1`. Maximum: `50`.",
4396
+ "description": "Number of series an aggregation returns per page when the request sends no `limit`. Optional. Minimum: `1`. Maximum: `50`.",
4335
4397
  "allowed_values": [],
4336
4398
  "deprecated": null
4337
4399
  },
@@ -4365,6 +4427,11 @@ export const CLI_COMMANDS = [
4365
4427
  "Changing the metric's data feed rebuilds its historical rollups.",
4366
4428
  "Custom chart ranges require both dates, with an interval of at least 30 minutes.",
4367
4429
  "Color-mode configuration must match the selected chart color mode.",
4430
+ "`ui_chart_color_mode` must be a mode the chart type supports. Changing `ui_chart_type` keeps the current mode, so send a supported one with it.",
4431
+ "`time_dimension` must be one the chart type supports: `breakdown` takes `hour_of_day` or `weekday`, `heatmap` takes `hour_of_week`, `hour_of_day` or `weekday`, and every other chart type takes none. Send `time_dimension: null` when changing to a type that takes none.",
4432
+ "A `heatmap` chart requires a `time_dimension`.",
4433
+ "A `time_dimension` cannot be combined with a cumulative `ui_chart_value` (`cumulative_sum` or `cumulative_count`).",
4434
+ "`ui_chart_order` is read by `breakdown` charts only; other chart types ignore it.",
4368
4435
  "`filters` must be a valid filter expression.",
4369
4436
  "`timestamp_field` cannot reference `__meta__` metadata."
4370
4437
  ],
@@ -4481,7 +4548,10 @@ export const CLI_COMMANDS = [
4481
4548
  "stat",
4482
4549
  "gauge",
4483
4550
  "calendar",
4484
- "uptime"
4551
+ "uptime",
4552
+ "breakdown",
4553
+ "heatmap",
4554
+ "table"
4485
4555
  ],
4486
4556
  "deprecated": null
4487
4557
  },
@@ -4529,14 +4599,6 @@ export const CLI_COMMANDS = [
4529
4599
  "allowed_values": [],
4530
4600
  "deprecated": null
4531
4601
  },
4532
- {
4533
- "name": "ui_chart_show_monitors",
4534
- "type": "boolean",
4535
- "required": false,
4536
- "description": "Whether the chart displays monitor thresholds. Optional.",
4537
- "allowed_values": [],
4538
- "deprecated": null
4539
- },
4540
4602
  {
4541
4603
  "name": "ui_chart_show_trends",
4542
4604
  "type": "boolean",
@@ -4693,6 +4755,29 @@ export const CLI_COMMANDS = [
4693
4755
  ],
4694
4756
  "deprecated": null
4695
4757
  },
4758
+ {
4759
+ "name": "time_dimension",
4760
+ "type": "TimeDimension",
4761
+ "required": false,
4762
+ "description": "Calendar position the chart folds the metric's hourly data into, such as the hour of the day. Null charts the data over time. Optional.",
4763
+ "allowed_values": [
4764
+ "hour_of_day",
4765
+ "weekday",
4766
+ "hour_of_week"
4767
+ ],
4768
+ "deprecated": null
4769
+ },
4770
+ {
4771
+ "name": "ui_chart_order",
4772
+ "type": "ChartOrder",
4773
+ "required": false,
4774
+ "description": "Order a breakdown chart shows its groups in. Null keeps a time dimension in its natural order and ranks field groups by value. Optional.",
4775
+ "allowed_values": [
4776
+ "natural",
4777
+ "value"
4778
+ ],
4779
+ "deprecated": null
4780
+ },
4696
4781
  {
4697
4782
  "name": "ui_chart_custom_range_start_at",
4698
4783
  "type": "ISODateString",
@@ -4713,7 +4798,7 @@ export const CLI_COMMANDS = [
4713
4798
  "name": "ui_chart_max_series",
4714
4799
  "type": "integer",
4715
4800
  "required": false,
4716
- "description": "Maximum number of individual series displayed by default. Optional. Minimum: `1`. Maximum: `50`.",
4801
+ "description": "Number of series an aggregation returns per page when the request sends no `limit`. Optional. Minimum: `1`. Maximum: `50`.",
4717
4802
  "allowed_values": [],
4718
4803
  "deprecated": null
4719
4804
  },
@@ -5177,12 +5262,13 @@ export const CLI_COMMANDS = [
5177
5262
  "monitors:write"
5178
5263
  ],
5179
5264
  "notes": [
5180
- "The monitor starts evaluating on its schedule as soon as it is created, unless it is created with `status` set to `paused`.",
5181
- "`scope` decides how many alerts a monitor can raise at once: `any_series` fires once for the metric as a whole, `each_series` tracks every series separately.",
5182
- "No-data (`absence`) conditions require `chart_value=count` and a finite `time_window_minutes`.",
5183
- "`sustained_minutes` is required when `condition_type` is `sustained`, and `threshold_value` is required when it is `threshold`.",
5184
- "`min_occurrences` and `occurrence_window_minutes` must both be set or both be null, and occurrence-based triggering cannot be combined with a sustained condition.",
5185
- "`schedule_cron` must be a valid cron expression. It is evaluated in UTC, and the finest granularity is one minute.",
5265
+ "The monitor starts checking on its schedule as soon as it is created, unless it is created with `status` set to `paused`. Its first check is the first scheduled time after it is created.",
5266
+ "`scope` decides how many alerts a monitor can raise at once: `any_series` raises one for the metric as a whole, `each_series` tracks every series separately.",
5267
+ "A `rolling` window needs `window_minutes`. An `all_time` window takes `window_minutes: null`.",
5268
+ "`count`, `sum` and `count_unique` require `empty_window_handling: \"zero\"`. Omitted, it is `zero` for those statistics and `no_value` for the others.",
5269
+ "An `immediate` trigger takes no trigger fields. `sustained` needs `sustained_minutes` and no repeat fields. `repeated` needs `repeat_count` and `repeat_window_minutes` and no `sustained_minutes`.",
5270
+ "A trigger the schedule can never satisfy is rejected. A gap between checks longer than `sustained_minutes` restarts the hold, so a `sustained` trigger needs checks that run for `sustained_minutes` without such a gap. A `repeated` trigger needs a `repeat_window_minutes` that can hold `repeat_count` checks. A schedule that only might satisfy the trigger is allowed.",
5271
+ "`schedule_cron` must be a valid five-field cron expression. It is evaluated in UTC, and the finest granularity is one minute.",
5186
5272
  "A monitor cannot be created active with an `expires_at` already in the past."
5187
5273
  ],
5188
5274
  "path_params": [
@@ -5225,7 +5311,7 @@ export const CLI_COMMANDS = [
5225
5311
  "name": "status",
5226
5312
  "type": "string",
5227
5313
  "required": false,
5228
- "description": "Whether the monitor starts evaluating immediately or switched off. `disabled` is not accepted: the system uses it to record that it stopped the monitor itself. Optional. Defaults to `\"active\"`.",
5314
+ "description": "Whether the monitor starts checking immediately or switched off. `disabled` is not accepted: the system uses it to record that it stopped the monitor itself. Optional. Defaults to `\"active\"`.",
5229
5315
  "allowed_values": [
5230
5316
  "active",
5231
5317
  "paused"
@@ -5233,19 +5319,25 @@ export const CLI_COMMANDS = [
5233
5319
  "deprecated": null
5234
5320
  },
5235
5321
  {
5236
- "name": "chart_value",
5237
- "type": "MetricChartValue",
5322
+ "name": "expires_at",
5323
+ "type": "ISODateString | null",
5238
5324
  "required": false,
5239
- "description": "Which value of the metric is compared against the threshold. Optional. Defaults to `\"sum\"`.",
5325
+ "description": "When the monitor stops checking. Leave null for no expiry. Optional.",
5326
+ "allowed_values": [],
5327
+ "deprecated": null
5328
+ },
5329
+ {
5330
+ "name": "statistic",
5331
+ "type": "MonitorStatistic",
5332
+ "required": true,
5333
+ "description": "What is computed over each window. `count`, `sum` and `count_unique` measure how much happened; the others read a value from the window's observations.",
5240
5334
  "allowed_values": [
5241
5335
  "count",
5242
- "average",
5243
5336
  "sum",
5337
+ "average",
5244
5338
  "min",
5245
5339
  "max",
5246
5340
  "last",
5247
- "cumulative_sum",
5248
- "cumulative_count",
5249
5341
  "p50",
5250
5342
  "p95",
5251
5343
  "p99",
@@ -5254,120 +5346,151 @@ export const CLI_COMMANDS = [
5254
5346
  "deprecated": null
5255
5347
  },
5256
5348
  {
5257
- "name": "scope",
5258
- "type": "MonitorScope",
5259
- "required": false,
5260
- "description": "Whether the monitor fires once for the metric as a whole, or tracks each series separately. Optional. Defaults to `\"total\"`.",
5349
+ "name": "operator",
5350
+ "type": "MonitorOperator",
5351
+ "required": true,
5352
+ "description": "How the statistic is compared with `threshold_value`.",
5261
5353
  "allowed_values": [
5262
- "total",
5263
- "any_series",
5264
- "each_series"
5354
+ "gt",
5355
+ "gte",
5356
+ "lt",
5357
+ "lte",
5358
+ "eq",
5359
+ "neq"
5265
5360
  ],
5266
5361
  "deprecated": null
5267
5362
  },
5268
5363
  {
5269
- "name": "time_window_minutes",
5270
- "type": "integer | null",
5271
- "required": false,
5272
- "description": "Evaluation lookback in whole minutes (1 to 525600). Null means since the metric was created. No-data conditions require a finite window. Optional.",
5364
+ "name": "threshold_value",
5365
+ "type": "number",
5366
+ "required": true,
5367
+ "description": "The value the statistic is compared with. `count` equal to 0 alerts when no data arrives.",
5273
5368
  "allowed_values": [],
5274
5369
  "deprecated": null
5275
5370
  },
5276
5371
  {
5277
- "name": "condition_type",
5278
- "type": "MonitorConditionType",
5372
+ "name": "empty_window_handling",
5373
+ "type": "MonitorEmptyWindowHandling",
5279
5374
  "required": false,
5280
- "description": "threshold compares a value, sustained requires that comparison to hold, existence fires when the selected value is greater than zero, and absence fires when no observations exist in the complete evaluation window, regardless of chart gap handling. Optional. Defaults to `\"threshold\"`.",
5375
+ "description": "What the statistic reads when the window holds no data. `zero` reads 0. `no_value` reads nothing, so that check neither opens nor closes an alert. Optional.",
5281
5376
  "allowed_values": [
5282
- "threshold",
5283
- "sustained",
5284
- "existence",
5285
- "absence"
5377
+ "no_value",
5378
+ "zero"
5286
5379
  ],
5287
5380
  "deprecated": null
5288
5381
  },
5289
5382
  {
5290
- "name": "operator",
5291
- "type": "MonitorOperator",
5383
+ "name": "window_type",
5384
+ "type": "MonitorWindowType",
5292
5385
  "required": false,
5293
- "description": "How the metric value is compared against the threshold. Optional. Defaults to `\"gt\"`.",
5386
+ "description": "`rolling` reads the `window_minutes` before each check. `all_time` reads everything from the start of the project. Optional. Defaults to `\"rolling\"`.",
5294
5387
  "allowed_values": [
5295
- "gt",
5296
- "gte",
5297
- "lt",
5298
- "lte",
5299
- "eq",
5300
- "neq"
5388
+ "rolling",
5389
+ "all_time"
5301
5390
  ],
5302
5391
  "deprecated": null
5303
5392
  },
5304
5393
  {
5305
- "name": "threshold_value",
5306
- "type": "number | null",
5394
+ "name": "window_minutes",
5395
+ "type": "integer | null",
5307
5396
  "required": false,
5308
- "description": "The value the metric is compared against. Optional.",
5397
+ "description": "Length of a rolling window in whole minutes (1 to 525600). Null for `all_time`. Optional.",
5309
5398
  "allowed_values": [],
5310
5399
  "deprecated": null
5311
5400
  },
5312
5401
  {
5313
- "name": "sustained_minutes",
5314
- "type": "number | null",
5402
+ "name": "scope",
5403
+ "type": "MonitorScope",
5315
5404
  "required": false,
5316
- "description": "How long the condition must hold before the monitor fires. Optional.",
5317
- "allowed_values": [],
5405
+ "description": "`total` checks the whole feed as one value. `any_series` keeps one alert open while any series matches. `each_series` checks every series separately. Optional. Defaults to `\"total\"`.",
5406
+ "allowed_values": [
5407
+ "total",
5408
+ "any_series",
5409
+ "each_series"
5410
+ ],
5318
5411
  "deprecated": null
5319
5412
  },
5320
5413
  {
5321
- "name": "schedule_cron",
5322
- "type": "string",
5414
+ "name": "series_filters",
5415
+ "type": "object",
5323
5416
  "required": false,
5324
- "description": "Cron expression, in UTC, setting how often the monitor evaluates. Optional. Defaults to `\"* * * * *\"`. Minimum length: `1`. Maximum length: `128`.",
5417
+ "description": "Narrows which of the metric's series this monitor watches. Property values may use `*` wildcards. Empty watches every series. Optional.",
5325
5418
  "allowed_values": [],
5326
- "deprecated": null
5419
+ "deprecated": null,
5420
+ "fields": [
5421
+ {
5422
+ "name": "include",
5423
+ "type": "object[]",
5424
+ "required": false,
5425
+ "description": "Only series matching one of these property sets are watched. Optional.",
5426
+ "allowed_values": [],
5427
+ "deprecated": null
5428
+ },
5429
+ {
5430
+ "name": "exclude",
5431
+ "type": "object[]",
5432
+ "required": false,
5433
+ "description": "Series matching one of these property sets are ignored. Optional.",
5434
+ "allowed_values": [],
5435
+ "deprecated": null
5436
+ }
5437
+ ]
5327
5438
  },
5328
5439
  {
5329
- "name": "alert_mode",
5330
- "type": "MonitorAlertMode",
5440
+ "name": "trigger_type",
5441
+ "type": "MonitorTriggerType",
5331
5442
  "required": false,
5332
- "description": "Whether an alert stays open until the condition clears, or opens and ends in one moment. Optional. Defaults to `\"spanning\"`.",
5443
+ "description": "When a match opens an alert. `immediate` on the first matching check, `sustained` once matches have held for `sustained_minutes`, `repeated` after `repeat_count` matching checks within `repeat_window_minutes`. Optional. Defaults to `\"immediate\"`.",
5333
5444
  "allowed_values": [
5334
- "spanning",
5335
- "instant"
5445
+ "immediate",
5446
+ "sustained",
5447
+ "repeated"
5336
5448
  ],
5337
5449
  "deprecated": null
5338
5450
  },
5339
5451
  {
5340
- "name": "expires_at",
5341
- "type": "ISODateString | null",
5452
+ "name": "sustained_minutes",
5453
+ "type": "integer | null",
5342
5454
  "required": false,
5343
- "description": "When the monitor stops evaluating. Leave null for no expiry. Optional.",
5455
+ "description": "How long matches must hold before an alert opens, in whole minutes. Only for `sustained`. Optional.",
5344
5456
  "allowed_values": [],
5345
5457
  "deprecated": null
5346
5458
  },
5347
5459
  {
5348
- "name": "series_filters",
5349
- "type": "object | null",
5460
+ "name": "repeat_count",
5461
+ "type": "integer | null",
5350
5462
  "required": false,
5351
- "description": "Narrows which of the metric's series this monitor watches. Optional.",
5463
+ "description": "How many matching checks open an alert. Only for `repeated`. Optional.",
5352
5464
  "allowed_values": [],
5353
5465
  "deprecated": null
5354
5466
  },
5355
5467
  {
5356
- "name": "min_occurrences",
5468
+ "name": "repeat_window_minutes",
5357
5469
  "type": "integer | null",
5358
5470
  "required": false,
5359
- "description": "How many times the condition must be met before the monitor fires. Optional.",
5471
+ "description": "The window, in whole minutes, those matching checks must fall within. Only for `repeated`. Optional.",
5360
5472
  "allowed_values": [],
5361
5473
  "deprecated": null
5362
5474
  },
5363
5475
  {
5364
- "name": "occurrence_window_minutes",
5365
- "type": "integer | null",
5476
+ "name": "schedule_cron",
5477
+ "type": "string",
5366
5478
  "required": false,
5367
- "description": "The window those occurrences have to fall within. Optional.",
5479
+ "description": "Five-field cron expression, in UTC, setting when the monitor checks. Optional. Defaults to `\"* * * * *\"`. Minimum length: `1`. Maximum length: `128`.",
5368
5480
  "allowed_values": [],
5369
5481
  "deprecated": null
5370
5482
  },
5483
+ {
5484
+ "name": "alert_mode",
5485
+ "type": "MonitorAlertMode",
5486
+ "required": false,
5487
+ "description": "`spanning` keeps an alert open until the condition clears. `instant` opens and ends it at once. Optional. Defaults to `\"spanning\"`.",
5488
+ "allowed_values": [
5489
+ "spanning",
5490
+ "instant"
5491
+ ],
5492
+ "deprecated": null
5493
+ },
5371
5494
  {
5372
5495
  "name": "metric_id",
5373
5496
  "type": "string",
@@ -5378,12 +5501,59 @@ export const CLI_COMMANDS = [
5378
5501
  }
5379
5502
  ]
5380
5503
  },
5504
+ {
5505
+ "resource": "monitors",
5506
+ "command": "draft",
5507
+ "operation_id": "draftMonitor",
5508
+ "summary": "Draft Monitor",
5509
+ "description": "Draft a monitor rule from a description in your own words.",
5510
+ "method": "POST",
5511
+ "path": "/v1/projects/:project_id/metrics/:metric_id/monitors/draft",
5512
+ "alternate_paths": [],
5513
+ "scopes": [
5514
+ "monitors:write"
5515
+ ],
5516
+ "notes": [
5517
+ "Nothing is saved. Review the draft and its `assumptions`, then create the monitor with the draft as the body.",
5518
+ "When the description is not enough for a rule (no threshold, no measurable condition), the outcome is `clarification` with a `question` to answer in a new description.",
5519
+ "Drafts count against a per-team hourly budget (50 on Pro, 500 on Enterprise). Over budget the request is refused with `resource_limit_reached` and says when the budget resets."
5520
+ ],
5521
+ "path_params": [
5522
+ {
5523
+ "name": "project_id",
5524
+ "type": "string",
5525
+ "required": true,
5526
+ "description": "Unique identifier of the project.",
5527
+ "allowed_values": [],
5528
+ "deprecated": null
5529
+ },
5530
+ {
5531
+ "name": "metric_id",
5532
+ "type": "string",
5533
+ "required": true,
5534
+ "description": "Unique identifier of the metric.",
5535
+ "allowed_values": [],
5536
+ "deprecated": null
5537
+ }
5538
+ ],
5539
+ "query_params": [],
5540
+ "body_fields": [
5541
+ {
5542
+ "name": "description",
5543
+ "type": "string",
5544
+ "required": true,
5545
+ "description": "The alert in your own words, for example `Alert me if no data arrives for 10 minutes.`. Minimum length: `1`. Maximum length: `1000`.",
5546
+ "allowed_values": [],
5547
+ "deprecated": null
5548
+ }
5549
+ ]
5550
+ },
5381
5551
  {
5382
5552
  "resource": "monitors",
5383
5553
  "command": "preview",
5384
5554
  "operation_id": "previewMonitor",
5385
5555
  "summary": "Preview Monitor",
5386
- "description": "Preview a monitor condition over its current evaluation window without saving or raising alerts.",
5556
+ "description": "Preview a monitor's rule on its most recent scheduled check, without saving or raising alerts.",
5387
5557
  "method": "POST",
5388
5558
  "path": "/v1/projects/:project_id/metrics/:metric_id/monitors/preview",
5389
5559
  "alternate_paths": [],
@@ -5391,12 +5561,13 @@ export const CLI_COMMANDS = [
5391
5561
  "monitors:read"
5392
5562
  ],
5393
5563
  "notes": [
5394
- "Uses the same series filtering and condition evaluation as scheduled monitors. This is a condition preview, not a simulation of cron timing, sustained duration, or occurrence counting.",
5395
- "An incomplete window returns ready=false with no verdicts. No-data conditions count observations across the whole window, including when the chart displays missing buckets as gaps.",
5396
- "No-data (`absence`) conditions require `chart_value=count` and a finite `time_window_minutes`.",
5397
- "`sustained_minutes` is required when `condition_type` is `sustained`, and `threshold_value` is required when it is `threshold`.",
5398
- "`min_occurrences` and `occurrence_window_minutes` must both be set or both be null, and occurrence-based triggering cannot be combined with a sustained condition.",
5399
- "`schedule_cron` must be a valid cron expression. It is evaluated in UTC, and the finest granularity is one minute.",
5564
+ "Reads the same window and computes the same statistic and verdict per target as a scheduled check of the most recent time on the rule's schedule. It shows one check: `trigger_note` explains when a `sustained` or `repeated` trigger would open an alert.",
5565
+ "A window whose data is not complete yet returns `is_ready: false` with no verdicts.",
5566
+ "A `rolling` window needs `window_minutes`. An `all_time` window takes `window_minutes: null`.",
5567
+ "`count`, `sum` and `count_unique` require `empty_window_handling: \"zero\"`. Omitted, it is `zero` for those statistics and `no_value` for the others.",
5568
+ "An `immediate` trigger takes no trigger fields. `sustained` needs `sustained_minutes` and no repeat fields. `repeated` needs `repeat_count` and `repeat_window_minutes` and no `sustained_minutes`.",
5569
+ "A trigger the schedule can never satisfy is rejected. A gap between checks longer than `sustained_minutes` restarts the hold, so a `sustained` trigger needs checks that run for `sustained_minutes` without such a gap. A `repeated` trigger needs a `repeat_window_minutes` that can hold `repeat_count` checks. A schedule that only might satisfy the trigger is allowed.",
5570
+ "`schedule_cron` must be a valid five-field cron expression. It is evaluated in UTC, and the finest granularity is one minute.",
5400
5571
  "A monitor cannot be created active with an `expires_at` already in the past."
5401
5572
  ],
5402
5573
  "path_params": [
@@ -5439,7 +5610,7 @@ export const CLI_COMMANDS = [
5439
5610
  "name": "status",
5440
5611
  "type": "string",
5441
5612
  "required": false,
5442
- "description": "Whether the monitor starts evaluating immediately or switched off. `disabled` is not accepted: the system uses it to record that it stopped the monitor itself. Optional. Defaults to `\"active\"`.",
5613
+ "description": "Whether the monitor starts checking immediately or switched off. `disabled` is not accepted: the system uses it to record that it stopped the monitor itself. Optional. Defaults to `\"active\"`.",
5443
5614
  "allowed_values": [
5444
5615
  "active",
5445
5616
  "paused"
@@ -5447,19 +5618,25 @@ export const CLI_COMMANDS = [
5447
5618
  "deprecated": null
5448
5619
  },
5449
5620
  {
5450
- "name": "chart_value",
5451
- "type": "MetricChartValue",
5621
+ "name": "expires_at",
5622
+ "type": "ISODateString | null",
5452
5623
  "required": false,
5453
- "description": "Which value of the metric is compared against the threshold. Optional. Defaults to `\"sum\"`.",
5624
+ "description": "When the monitor stops checking. Leave null for no expiry. Optional.",
5625
+ "allowed_values": [],
5626
+ "deprecated": null
5627
+ },
5628
+ {
5629
+ "name": "statistic",
5630
+ "type": "MonitorStatistic",
5631
+ "required": true,
5632
+ "description": "What is computed over each window. `count`, `sum` and `count_unique` measure how much happened; the others read a value from the window's observations.",
5454
5633
  "allowed_values": [
5455
5634
  "count",
5456
- "average",
5457
5635
  "sum",
5636
+ "average",
5458
5637
  "min",
5459
5638
  "max",
5460
5639
  "last",
5461
- "cumulative_sum",
5462
- "cumulative_count",
5463
5640
  "p50",
5464
5641
  "p95",
5465
5642
  "p99",
@@ -5468,120 +5645,151 @@ export const CLI_COMMANDS = [
5468
5645
  "deprecated": null
5469
5646
  },
5470
5647
  {
5471
- "name": "scope",
5472
- "type": "MonitorScope",
5473
- "required": false,
5474
- "description": "Whether the monitor fires once for the metric as a whole, or tracks each series separately. Optional. Defaults to `\"total\"`.",
5648
+ "name": "operator",
5649
+ "type": "MonitorOperator",
5650
+ "required": true,
5651
+ "description": "How the statistic is compared with `threshold_value`.",
5475
5652
  "allowed_values": [
5476
- "total",
5477
- "any_series",
5478
- "each_series"
5653
+ "gt",
5654
+ "gte",
5655
+ "lt",
5656
+ "lte",
5657
+ "eq",
5658
+ "neq"
5479
5659
  ],
5480
5660
  "deprecated": null
5481
5661
  },
5482
5662
  {
5483
- "name": "time_window_minutes",
5484
- "type": "integer | null",
5485
- "required": false,
5486
- "description": "Evaluation lookback in whole minutes (1 to 525600). Null means since the metric was created. No-data conditions require a finite window. Optional.",
5663
+ "name": "threshold_value",
5664
+ "type": "number",
5665
+ "required": true,
5666
+ "description": "The value the statistic is compared with. `count` equal to 0 alerts when no data arrives.",
5487
5667
  "allowed_values": [],
5488
5668
  "deprecated": null
5489
5669
  },
5490
5670
  {
5491
- "name": "condition_type",
5492
- "type": "MonitorConditionType",
5671
+ "name": "empty_window_handling",
5672
+ "type": "MonitorEmptyWindowHandling",
5493
5673
  "required": false,
5494
- "description": "threshold compares a value, sustained requires that comparison to hold, existence fires when the selected value is greater than zero, and absence fires when no observations exist in the complete evaluation window, regardless of chart gap handling. Optional. Defaults to `\"threshold\"`.",
5674
+ "description": "What the statistic reads when the window holds no data. `zero` reads 0. `no_value` reads nothing, so that check neither opens nor closes an alert. Optional.",
5495
5675
  "allowed_values": [
5496
- "threshold",
5497
- "sustained",
5498
- "existence",
5499
- "absence"
5676
+ "no_value",
5677
+ "zero"
5500
5678
  ],
5501
5679
  "deprecated": null
5502
5680
  },
5503
5681
  {
5504
- "name": "operator",
5505
- "type": "MonitorOperator",
5682
+ "name": "window_type",
5683
+ "type": "MonitorWindowType",
5506
5684
  "required": false,
5507
- "description": "How the metric value is compared against the threshold. Optional. Defaults to `\"gt\"`.",
5685
+ "description": "`rolling` reads the `window_minutes` before each check. `all_time` reads everything from the start of the project. Optional. Defaults to `\"rolling\"`.",
5508
5686
  "allowed_values": [
5509
- "gt",
5510
- "gte",
5511
- "lt",
5512
- "lte",
5513
- "eq",
5514
- "neq"
5687
+ "rolling",
5688
+ "all_time"
5515
5689
  ],
5516
5690
  "deprecated": null
5517
5691
  },
5518
5692
  {
5519
- "name": "threshold_value",
5520
- "type": "number | null",
5693
+ "name": "window_minutes",
5694
+ "type": "integer | null",
5521
5695
  "required": false,
5522
- "description": "The value the metric is compared against. Optional.",
5696
+ "description": "Length of a rolling window in whole minutes (1 to 525600). Null for `all_time`. Optional.",
5523
5697
  "allowed_values": [],
5524
5698
  "deprecated": null
5525
5699
  },
5526
5700
  {
5527
- "name": "sustained_minutes",
5528
- "type": "number | null",
5701
+ "name": "scope",
5702
+ "type": "MonitorScope",
5529
5703
  "required": false,
5530
- "description": "How long the condition must hold before the monitor fires. Optional.",
5531
- "allowed_values": [],
5704
+ "description": "`total` checks the whole feed as one value. `any_series` keeps one alert open while any series matches. `each_series` checks every series separately. Optional. Defaults to `\"total\"`.",
5705
+ "allowed_values": [
5706
+ "total",
5707
+ "any_series",
5708
+ "each_series"
5709
+ ],
5532
5710
  "deprecated": null
5533
5711
  },
5534
5712
  {
5535
- "name": "schedule_cron",
5536
- "type": "string",
5713
+ "name": "series_filters",
5714
+ "type": "object",
5537
5715
  "required": false,
5538
- "description": "Cron expression, in UTC, setting how often the monitor evaluates. Optional. Defaults to `\"* * * * *\"`. Minimum length: `1`. Maximum length: `128`.",
5716
+ "description": "Narrows which of the metric's series this monitor watches. Property values may use `*` wildcards. Empty watches every series. Optional.",
5539
5717
  "allowed_values": [],
5540
- "deprecated": null
5718
+ "deprecated": null,
5719
+ "fields": [
5720
+ {
5721
+ "name": "include",
5722
+ "type": "object[]",
5723
+ "required": false,
5724
+ "description": "Only series matching one of these property sets are watched. Optional.",
5725
+ "allowed_values": [],
5726
+ "deprecated": null
5727
+ },
5728
+ {
5729
+ "name": "exclude",
5730
+ "type": "object[]",
5731
+ "required": false,
5732
+ "description": "Series matching one of these property sets are ignored. Optional.",
5733
+ "allowed_values": [],
5734
+ "deprecated": null
5735
+ }
5736
+ ]
5541
5737
  },
5542
5738
  {
5543
- "name": "alert_mode",
5544
- "type": "MonitorAlertMode",
5739
+ "name": "trigger_type",
5740
+ "type": "MonitorTriggerType",
5545
5741
  "required": false,
5546
- "description": "Whether an alert stays open until the condition clears, or opens and ends in one moment. Optional. Defaults to `\"spanning\"`.",
5742
+ "description": "When a match opens an alert. `immediate` on the first matching check, `sustained` once matches have held for `sustained_minutes`, `repeated` after `repeat_count` matching checks within `repeat_window_minutes`. Optional. Defaults to `\"immediate\"`.",
5547
5743
  "allowed_values": [
5548
- "spanning",
5549
- "instant"
5744
+ "immediate",
5745
+ "sustained",
5746
+ "repeated"
5550
5747
  ],
5551
5748
  "deprecated": null
5552
5749
  },
5553
5750
  {
5554
- "name": "expires_at",
5555
- "type": "ISODateString | null",
5751
+ "name": "sustained_minutes",
5752
+ "type": "integer | null",
5556
5753
  "required": false,
5557
- "description": "When the monitor stops evaluating. Leave null for no expiry. Optional.",
5754
+ "description": "How long matches must hold before an alert opens, in whole minutes. Only for `sustained`. Optional.",
5558
5755
  "allowed_values": [],
5559
5756
  "deprecated": null
5560
5757
  },
5561
5758
  {
5562
- "name": "series_filters",
5563
- "type": "object | null",
5759
+ "name": "repeat_count",
5760
+ "type": "integer | null",
5564
5761
  "required": false,
5565
- "description": "Narrows which of the metric's series this monitor watches. Optional.",
5762
+ "description": "How many matching checks open an alert. Only for `repeated`. Optional.",
5566
5763
  "allowed_values": [],
5567
5764
  "deprecated": null
5568
5765
  },
5569
5766
  {
5570
- "name": "min_occurrences",
5767
+ "name": "repeat_window_minutes",
5571
5768
  "type": "integer | null",
5572
5769
  "required": false,
5573
- "description": "How many times the condition must be met before the monitor fires. Optional.",
5770
+ "description": "The window, in whole minutes, those matching checks must fall within. Only for `repeated`. Optional.",
5574
5771
  "allowed_values": [],
5575
5772
  "deprecated": null
5576
5773
  },
5577
5774
  {
5578
- "name": "occurrence_window_minutes",
5579
- "type": "integer | null",
5775
+ "name": "schedule_cron",
5776
+ "type": "string",
5580
5777
  "required": false,
5581
- "description": "The window those occurrences have to fall within. Optional.",
5778
+ "description": "Five-field cron expression, in UTC, setting when the monitor checks. Optional. Defaults to `\"* * * * *\"`. Minimum length: `1`. Maximum length: `128`.",
5582
5779
  "allowed_values": [],
5583
5780
  "deprecated": null
5584
5781
  },
5782
+ {
5783
+ "name": "alert_mode",
5784
+ "type": "MonitorAlertMode",
5785
+ "required": false,
5786
+ "description": "`spanning` keeps an alert open until the condition clears. `instant` opens and ends it at once. Optional. Defaults to `\"spanning\"`.",
5787
+ "allowed_values": [
5788
+ "spanning",
5789
+ "instant"
5790
+ ],
5791
+ "deprecated": null
5792
+ },
5585
5793
  {
5586
5794
  "name": "metric_id",
5587
5795
  "type": "string",
@@ -5597,7 +5805,7 @@ export const CLI_COMMANDS = [
5597
5805
  "command": "update",
5598
5806
  "operation_id": "updateMonitor",
5599
5807
  "summary": "Update Monitor",
5600
- "description": "Change a monitor's condition, schedule, or status.",
5808
+ "description": "Change a monitor's rule, schedule, name, description or expiry.",
5601
5809
  "method": "POST",
5602
5810
  "path": "/v1/projects/:project_id/metrics/:metric_id/monitors/:monitor_id",
5603
5811
  "alternate_paths": [],
@@ -5605,17 +5813,18 @@ export const CLI_COMMANDS = [
5605
5813
  "monitors:write"
5606
5814
  ],
5607
5815
  "notes": [
5608
- "Send only the fields you are changing. Anything omitted keeps its current value.",
5609
- "Changing what the monitor MEANS (its condition, scope, series filters or alert mode) ends any period currently firing, because the old alert no longer describes the new rule.",
5816
+ "Send the fields you are changing. A field sent with its current value changes nothing, so sending the whole monitor back is fine.",
5817
+ "Changing the rule (statistic, comparison, empty window handling, window, scope, series filters, trigger or alert mode) ends the monitor's open alerts with `monitor_changed` and starts checking afresh at the next scheduled time.",
5818
+ "Changing only `schedule_cron` keeps open alerts. Checks move to the new schedule, and a `sustained` or `repeated` trigger starts counting again.",
5819
+ "Changing only `name`, `description` or `expires_at` affects nothing else.",
5610
5820
  "`metric_id` cannot be changed. Create a new monitor against the other metric instead.",
5611
5821
  "The metric a monitor watches cannot be changed. Create a second monitor instead.",
5612
- "No-data (`absence`) conditions require `chart_value=count` and a finite `time_window_minutes`.",
5613
- "`sustained_minutes` is required when `condition_type` is `sustained`, and `threshold_value` is required when it is `threshold`.",
5614
- "`min_occurrences` and `occurrence_window_minutes` must both be set or both be null, and occurrence-based triggering cannot be combined with a sustained condition.",
5615
- "`schedule_cron` must be a valid cron expression. It is evaluated in UTC, and the finest granularity is one minute.",
5616
5822
  "`status` is not editable here. Use the pause and resume operations, which is also what keeps a customer from writing the `disabled` the system uses for expiry.",
5617
- "Moving `expires_at` is rejected when that would leave an active monitor with an expiry already in the past. Editing a monitor that has already expired is allowed, including the update that extends its expiry.",
5618
- "Conditions are checked against the monitor as it will be stored, not against the fields you send, so a change that would leave the monitor in an invalid combination is rejected even when the conflicting value is one you did not send."
5823
+ "The fields you send are merged into the stored monitor, and the result must satisfy the create rules for windows, `empty_window_handling`, trigger fields and the schedule, so a change is rejected even when the conflicting value is one you did not send.",
5824
+ "An omitted `empty_window_handling` becomes `zero` when the new `statistic` is `count`, `sum` or `count_unique`, and `no_value` when the stored statistic was one of those and the new one is not. Otherwise it keeps its stored value.",
5825
+ "Fields the new window or trigger does not use are cleared when you omit them or send null: switching to `all_time` clears `window_minutes`, and switching `trigger_type` clears the other triggers' fields. Sending a value for a field the new choice does not use is rejected.",
5826
+ "`schedule_cron` must be a valid five-field cron expression. It is evaluated in UTC, and the finest granularity is one minute.",
5827
+ "Moving `expires_at` is rejected when that would leave an active monitor with an expiry already in the past. Editing a monitor that has already expired is allowed, including the update that extends its expiry."
5619
5828
  ],
5620
5829
  "path_params": [
5621
5830
  {
@@ -5662,19 +5871,25 @@ export const CLI_COMMANDS = [
5662
5871
  "deprecated": null
5663
5872
  },
5664
5873
  {
5665
- "name": "chart_value",
5666
- "type": "MetricChartValue",
5874
+ "name": "expires_at",
5875
+ "type": "ISODateString | null",
5667
5876
  "required": false,
5668
- "description": "Which value of the metric is compared against the threshold. Optional.",
5877
+ "description": "When the monitor stops checking. Leave null for no expiry. Optional.",
5878
+ "allowed_values": [],
5879
+ "deprecated": null
5880
+ },
5881
+ {
5882
+ "name": "statistic",
5883
+ "type": "MonitorStatistic",
5884
+ "required": false,
5885
+ "description": "What is computed over each window. `count`, `sum` and `count_unique` measure how much happened; the others read a value from the window's observations. Optional.",
5669
5886
  "allowed_values": [
5670
5887
  "count",
5671
- "average",
5672
5888
  "sum",
5889
+ "average",
5673
5890
  "min",
5674
5891
  "max",
5675
5892
  "last",
5676
- "cumulative_sum",
5677
- "cumulative_count",
5678
5893
  "p50",
5679
5894
  "p95",
5680
5895
  "p99",
@@ -5683,119 +5898,150 @@ export const CLI_COMMANDS = [
5683
5898
  "deprecated": null
5684
5899
  },
5685
5900
  {
5686
- "name": "scope",
5687
- "type": "MonitorScope",
5901
+ "name": "operator",
5902
+ "type": "MonitorOperator",
5688
5903
  "required": false,
5689
- "description": "Whether the monitor fires once for the metric as a whole, or tracks each series separately. Optional.",
5904
+ "description": "How the statistic is compared with `threshold_value`. Optional.",
5690
5905
  "allowed_values": [
5691
- "total",
5692
- "any_series",
5693
- "each_series"
5906
+ "gt",
5907
+ "gte",
5908
+ "lt",
5909
+ "lte",
5910
+ "eq",
5911
+ "neq"
5694
5912
  ],
5695
5913
  "deprecated": null
5696
5914
  },
5697
5915
  {
5698
- "name": "time_window_minutes",
5699
- "type": "integer | null",
5916
+ "name": "threshold_value",
5917
+ "type": "number",
5700
5918
  "required": false,
5701
- "description": "Evaluation lookback in whole minutes (1 to 525600). Null means since the metric was created. No-data conditions require a finite window. Optional.",
5919
+ "description": "The value the statistic is compared with. `count` equal to 0 alerts when no data arrives. Optional.",
5702
5920
  "allowed_values": [],
5703
5921
  "deprecated": null
5704
5922
  },
5705
5923
  {
5706
- "name": "condition_type",
5707
- "type": "MonitorConditionType",
5924
+ "name": "empty_window_handling",
5925
+ "type": "MonitorEmptyWindowHandling",
5708
5926
  "required": false,
5709
- "description": "threshold compares a value, sustained requires that comparison to hold, existence fires when the selected value is greater than zero, and absence fires when no observations exist in the complete evaluation window, regardless of chart gap handling. Optional.",
5927
+ "description": "What the statistic reads when the window holds no data. `zero` reads 0. `no_value` reads nothing, so that check neither opens nor closes an alert. Optional.",
5710
5928
  "allowed_values": [
5711
- "threshold",
5712
- "sustained",
5713
- "existence",
5714
- "absence"
5929
+ "no_value",
5930
+ "zero"
5715
5931
  ],
5716
5932
  "deprecated": null
5717
5933
  },
5718
5934
  {
5719
- "name": "operator",
5720
- "type": "MonitorOperator",
5935
+ "name": "window_type",
5936
+ "type": "MonitorWindowType",
5721
5937
  "required": false,
5722
- "description": "How the metric value is compared against the threshold. Optional.",
5938
+ "description": "`rolling` reads the `window_minutes` before each check. `all_time` reads everything from the start of the project. Optional.",
5723
5939
  "allowed_values": [
5724
- "gt",
5725
- "gte",
5726
- "lt",
5727
- "lte",
5728
- "eq",
5729
- "neq"
5940
+ "rolling",
5941
+ "all_time"
5730
5942
  ],
5731
5943
  "deprecated": null
5732
5944
  },
5733
5945
  {
5734
- "name": "threshold_value",
5735
- "type": "number | null",
5946
+ "name": "window_minutes",
5947
+ "type": "integer | null",
5736
5948
  "required": false,
5737
- "description": "The value the metric is compared against. Optional.",
5949
+ "description": "Length of a rolling window in whole minutes (1 to 525600). Null for `all_time`. Optional.",
5738
5950
  "allowed_values": [],
5739
5951
  "deprecated": null
5740
5952
  },
5741
5953
  {
5742
- "name": "sustained_minutes",
5743
- "type": "number | null",
5954
+ "name": "scope",
5955
+ "type": "MonitorScope",
5744
5956
  "required": false,
5745
- "description": "How long the condition must hold before the monitor fires. Optional.",
5746
- "allowed_values": [],
5957
+ "description": "`total` checks the whole feed as one value. `any_series` keeps one alert open while any series matches. `each_series` checks every series separately. Optional.",
5958
+ "allowed_values": [
5959
+ "total",
5960
+ "any_series",
5961
+ "each_series"
5962
+ ],
5747
5963
  "deprecated": null
5748
5964
  },
5749
5965
  {
5750
- "name": "schedule_cron",
5751
- "type": "string",
5966
+ "name": "series_filters",
5967
+ "type": "object",
5752
5968
  "required": false,
5753
- "description": "Cron expression, in UTC, setting how often the monitor evaluates. Optional. Minimum length: `1`. Maximum length: `128`.",
5969
+ "description": "Narrows which of the metric's series this monitor watches. Property values may use `*` wildcards. Empty watches every series. Optional.",
5754
5970
  "allowed_values": [],
5755
- "deprecated": null
5971
+ "deprecated": null,
5972
+ "fields": [
5973
+ {
5974
+ "name": "include",
5975
+ "type": "object[]",
5976
+ "required": false,
5977
+ "description": "Only series matching one of these property sets are watched. Optional.",
5978
+ "allowed_values": [],
5979
+ "deprecated": null
5980
+ },
5981
+ {
5982
+ "name": "exclude",
5983
+ "type": "object[]",
5984
+ "required": false,
5985
+ "description": "Series matching one of these property sets are ignored. Optional.",
5986
+ "allowed_values": [],
5987
+ "deprecated": null
5988
+ }
5989
+ ]
5756
5990
  },
5757
5991
  {
5758
- "name": "alert_mode",
5759
- "type": "MonitorAlertMode",
5992
+ "name": "trigger_type",
5993
+ "type": "MonitorTriggerType",
5760
5994
  "required": false,
5761
- "description": "Whether an alert stays open until the condition clears, or opens and ends in one moment. Optional.",
5995
+ "description": "When a match opens an alert. `immediate` on the first matching check, `sustained` once matches have held for `sustained_minutes`, `repeated` after `repeat_count` matching checks within `repeat_window_minutes`. Optional.",
5762
5996
  "allowed_values": [
5763
- "spanning",
5764
- "instant"
5997
+ "immediate",
5998
+ "sustained",
5999
+ "repeated"
5765
6000
  ],
5766
6001
  "deprecated": null
5767
6002
  },
5768
6003
  {
5769
- "name": "expires_at",
5770
- "type": "ISODateString | null",
6004
+ "name": "sustained_minutes",
6005
+ "type": "integer | null",
5771
6006
  "required": false,
5772
- "description": "When the monitor stops evaluating. Leave null for no expiry. Optional.",
6007
+ "description": "How long matches must hold before an alert opens, in whole minutes. Only for `sustained`. Optional.",
5773
6008
  "allowed_values": [],
5774
6009
  "deprecated": null
5775
6010
  },
5776
6011
  {
5777
- "name": "series_filters",
5778
- "type": "object | null",
6012
+ "name": "repeat_count",
6013
+ "type": "integer | null",
5779
6014
  "required": false,
5780
- "description": "Narrows which of the metric's series this monitor watches. Optional.",
6015
+ "description": "How many matching checks open an alert. Only for `repeated`. Optional.",
5781
6016
  "allowed_values": [],
5782
6017
  "deprecated": null
5783
6018
  },
5784
6019
  {
5785
- "name": "min_occurrences",
6020
+ "name": "repeat_window_minutes",
5786
6021
  "type": "integer | null",
5787
6022
  "required": false,
5788
- "description": "How many times the condition must be met before the monitor fires. Optional.",
6023
+ "description": "The window, in whole minutes, those matching checks must fall within. Only for `repeated`. Optional.",
5789
6024
  "allowed_values": [],
5790
6025
  "deprecated": null
5791
6026
  },
5792
6027
  {
5793
- "name": "occurrence_window_minutes",
5794
- "type": "integer | null",
6028
+ "name": "schedule_cron",
6029
+ "type": "string",
5795
6030
  "required": false,
5796
- "description": "The window those occurrences have to fall within. Optional.",
6031
+ "description": "Five-field cron expression, in UTC, setting when the monitor checks. Optional. Minimum length: `1`. Maximum length: `128`.",
5797
6032
  "allowed_values": [],
5798
6033
  "deprecated": null
6034
+ },
6035
+ {
6036
+ "name": "alert_mode",
6037
+ "type": "MonitorAlertMode",
6038
+ "required": false,
6039
+ "description": "`spanning` keeps an alert open until the condition clears. `instant` opens and ends it at once. Optional.",
6040
+ "allowed_values": [
6041
+ "spanning",
6042
+ "instant"
6043
+ ],
6044
+ "deprecated": null
5799
6045
  }
5800
6046
  ]
5801
6047
  },
@@ -5804,7 +6050,7 @@ export const CLI_COMMANDS = [
5804
6050
  "command": "pause",
5805
6051
  "operation_id": "pauseMonitor",
5806
6052
  "summary": "Pause Monitor",
5807
- "description": "Pause a monitor so it stops evaluating.",
6053
+ "description": "Pause a monitor so it stops checking.",
5808
6054
  "method": "POST",
5809
6055
  "path": "/v1/projects/:project_id/metrics/:metric_id/monitors/:monitor_id/pause",
5810
6056
  "alternate_paths": [],
@@ -5812,7 +6058,8 @@ export const CLI_COMMANDS = [
5812
6058
  "monitors:write"
5813
6059
  ],
5814
6060
  "notes": [
5815
- "A paused monitor raises no alerts and closes nothing that is already firing. Resuming evaluates it again on its next scheduled tick."
6061
+ "Pausing ends the monitor's open alerts with `monitor_paused`. A paused monitor is not checked, and resuming starts again at its next scheduled time: the paused period is never checked.",
6062
+ "Pausing a paused monitor changes nothing. A monitor the system disabled when its expiry passed cannot be paused; resume it instead."
5816
6063
  ],
5817
6064
  "path_params": [
5818
6065
  {
@@ -5848,7 +6095,7 @@ export const CLI_COMMANDS = [
5848
6095
  "command": "resume",
5849
6096
  "operation_id": "resumeMonitor",
5850
6097
  "summary": "Resume Monitor",
5851
- "description": "Resume a paused monitor so it evaluates on its schedule again.",
6098
+ "description": "Resume a paused monitor so it checks on its schedule again.",
5852
6099
  "method": "POST",
5853
6100
  "path": "/v1/projects/:project_id/metrics/:metric_id/monitors/:monitor_id/resume",
5854
6101
  "alternate_paths": [],
@@ -5856,6 +6103,7 @@ export const CLI_COMMANDS = [
5856
6103
  "monitors:write"
5857
6104
  ],
5858
6105
  "notes": [
6106
+ "Checking starts again at the next scheduled time; the paused period is never checked.",
5859
6107
  "A monitor the system stopped because its expiry passed can be resumed once the expiry is moved into the future. Resuming one whose expiry is still in the past is rejected."
5860
6108
  ],
5861
6109
  "path_params": [
@@ -5944,7 +6192,7 @@ export const CLI_COMMANDS = [
5944
6192
  "alerts:read"
5945
6193
  ],
5946
6194
  "notes": [
5947
- "An alert is a firing PERIOD, not a single notification. `created_at` is when the condition started holding and `ended_at` is when it stopped, so one incident is one row for its whole duration.",
6195
+ "An alert is a firing PERIOD, not a single notification. `triggered_at` is the check that opened it and `ended_at` is when it ended, with the reason in `end_reason`, so one incident is one row for its whole duration. `created_at` is only when the row was written.",
5948
6196
  "Results cover a time window. Send `start_at` and `end_at`, or a `time_range`; with neither, the metric's own configured chart range is used.",
5949
6197
  "An alert is returned when its period OVERLAPS the window, so a period that opened before the window and is still firing is included.",
5950
6198
  "Use `is_open=true` to see only what is currently firing.",
@@ -5975,9 +6223,9 @@ export const CLI_COMMANDS = [
5975
6223
  "name": "order_by",
5976
6224
  "type": "string",
5977
6225
  "required": false,
5978
- "description": "Field the results are sorted by. Alerts sort by when their period opened. Optional. Defaults to `\"created_at\"`.",
6226
+ "description": "Field the results are sorted by. Alerts sort by when their period opened. Optional. Defaults to `\"triggered_at\"`.",
5979
6227
  "allowed_values": [
5980
- "created_at"
6228
+ "triggered_at"
5981
6229
  ],
5982
6230
  "deprecated": null
5983
6231
  },
@@ -6418,7 +6666,7 @@ export const CLI_COMMANDS = [
6418
6666
  "command": "update",
6419
6667
  "operation_id": "updatePage",
6420
6668
  "summary": "Update Page",
6421
- "description": "Change a page's name, time range, or public access.",
6669
+ "description": "Change a page's name, time range, public access, or its layout of cards.",
6422
6670
  "method": "POST",
6423
6671
  "path": "/v1/projects/:project_id/pages/:page_id",
6424
6672
  "alternate_paths": [],
@@ -6428,8 +6676,11 @@ export const CLI_COMMANDS = [
6428
6676
  "notes": [
6429
6677
  "Send only the fields you are changing. Anything omitted keeps its current value.",
6430
6678
  "Making a page private clears its public URL. Making it public again issues a new slug, so any previously shared link stops working.",
6679
+ "`components` is the whole layout, in page order: each entry is a card's full state, an entry without an `id` adds a card, and a card you leave out is removed. Leave it out to change settings only. Settings and layout are saved together, or not at all.",
6680
+ "Every listed card `id` must already be on this page, and every metric must belong to the page's project and not be scheduled for deletion.",
6431
6681
  "A `custom` time range requires both `custom_range_start_at` and `custom_range_end_at`, at least 30 minutes apart, with the start before the end. The rule is checked against the page as it will be after the update, not against the fields you send.",
6432
- "An `access_code` is trimmed, and an empty one clears the code."
6682
+ "An `access_code` is trimmed, and an empty one clears the code.",
6683
+ "A card can be listed only once in `components`, and a metric can be on only one card of the page."
6433
6684
  ],
6434
6685
  "path_params": [
6435
6686
  {
@@ -6559,6 +6810,51 @@ export const CLI_COMMANDS = [
6559
6810
  "description": "End of the window, when the time range is custom. Optional.",
6560
6811
  "allowed_values": [],
6561
6812
  "deprecated": null
6813
+ },
6814
+ {
6815
+ "name": "components",
6816
+ "type": "object[]",
6817
+ "required": false,
6818
+ "description": "The page's whole layout, in page order. Cards left out are removed. Optional.",
6819
+ "allowed_values": [],
6820
+ "deprecated": null,
6821
+ "fields": [
6822
+ {
6823
+ "name": "id",
6824
+ "type": "string",
6825
+ "required": false,
6826
+ "description": "Card to keep. Leave out to add a new card. Optional.",
6827
+ "allowed_values": [],
6828
+ "deprecated": null
6829
+ },
6830
+ {
6831
+ "name": "name",
6832
+ "type": "string | null",
6833
+ "required": false,
6834
+ "description": "Title of a card that shows several metrics. Leave out or send null to title it with their names. Optional.",
6835
+ "allowed_values": [],
6836
+ "deprecated": null
6837
+ },
6838
+ {
6839
+ "name": "ui_card_size",
6840
+ "type": "string",
6841
+ "required": false,
6842
+ "description": "How much of the page width the card occupies. Defaults to the full width. Optional.",
6843
+ "allowed_values": [
6844
+ "1/1",
6845
+ "1/2"
6846
+ ],
6847
+ "deprecated": null
6848
+ },
6849
+ {
6850
+ "name": "metric_ids",
6851
+ "type": "string[]",
6852
+ "required": true,
6853
+ "description": "Metrics the card shows together, in order.",
6854
+ "allowed_values": [],
6855
+ "deprecated": null
6856
+ }
6857
+ ]
6562
6858
  }
6563
6859
  ]
6564
6860
  },
@@ -6747,7 +7043,7 @@ export const CLI_COMMANDS = [
6747
7043
  "command": "create",
6748
7044
  "operation_id": "createComponent",
6749
7045
  "summary": "Add Component",
6750
- "description": "Add a metric to a page.",
7046
+ "description": "Add a card of one or more metrics to a page.",
6751
7047
  "method": "POST",
6752
7048
  "path": "/v1/projects/:project_id/pages/:page_id/components",
6753
7049
  "alternate_paths": [],
@@ -6755,8 +7051,10 @@ export const CLI_COMMANDS = [
6755
7051
  "pages:write"
6756
7052
  ],
6757
7053
  "notes": [
6758
- "A component is one metric placed on one page. The metric has to belong to the same project.",
6759
- "The metric must belong to the same project as the page.",
7054
+ "A component is a card on one page showing one to six metrics together.",
7055
+ "To change a whole page's layout in one write, send `components` to Update Page instead.",
7056
+ "Every metric must belong to the same project as the page, and none can already be on another card of the page.",
7057
+ "A metric can be listed only once in `metric_ids`.",
6760
7058
  "A page holds a limited number of components. Adding one past the limit is rejected."
6761
7059
  ],
6762
7060
  "path_params": [
@@ -6779,6 +7077,14 @@ export const CLI_COMMANDS = [
6779
7077
  ],
6780
7078
  "query_params": [],
6781
7079
  "body_fields": [
7080
+ {
7081
+ "name": "name",
7082
+ "type": "string | null",
7083
+ "required": false,
7084
+ "description": "Title of a card that shows several metrics. Send null to title it with their names. Optional.",
7085
+ "allowed_values": [],
7086
+ "deprecated": null
7087
+ },
6782
7088
  {
6783
7089
  "name": "ui_sort_index",
6784
7090
  "type": "integer",
@@ -6799,10 +7105,10 @@ export const CLI_COMMANDS = [
6799
7105
  "deprecated": null
6800
7106
  },
6801
7107
  {
6802
- "name": "metric_id",
6803
- "type": "string",
7108
+ "name": "metric_ids",
7109
+ "type": "string[]",
6804
7110
  "required": true,
6805
- "description": "Metric this component displays.",
7111
+ "description": "Metrics the card shows together, in order.",
6806
7112
  "allowed_values": [],
6807
7113
  "deprecated": null
6808
7114
  },
@@ -6821,7 +7127,7 @@ export const CLI_COMMANDS = [
6821
7127
  "command": "update",
6822
7128
  "operation_id": "updateComponent",
6823
7129
  "summary": "Update Component",
6824
- "description": "Change which metric a component shows, its size, or its position.",
7130
+ "description": "Change which metrics a component shows, its name, its size, or its position.",
6825
7131
  "method": "POST",
6826
7132
  "path": "/v1/projects/:project_id/pages/:page_id/components/:component_id",
6827
7133
  "alternate_paths": [],
@@ -6831,7 +7137,8 @@ export const CLI_COMMANDS = [
6831
7137
  "notes": [
6832
7138
  "Send only the fields you are changing. Anything omitted keeps its current value.",
6833
7139
  "Reorder a page by sending a new `ui_sort_index` for each component you are moving.",
6834
- "A new `metric_id` must belong to the same project as the page."
7140
+ "`metric_ids` replaces the card's metrics. Every metric must belong to the same project as the page, and none can already be on another card of the page.",
7141
+ "A metric can be listed only once in `metric_ids`."
6835
7142
  ],
6836
7143
  "path_params": [
6837
7144
  {
@@ -6861,6 +7168,14 @@ export const CLI_COMMANDS = [
6861
7168
  ],
6862
7169
  "query_params": [],
6863
7170
  "body_fields": [
7171
+ {
7172
+ "name": "name",
7173
+ "type": "string | null",
7174
+ "required": false,
7175
+ "description": "Title of a card that shows several metrics. Send null to title it with their names. Optional.",
7176
+ "allowed_values": [],
7177
+ "deprecated": null
7178
+ },
6864
7179
  {
6865
7180
  "name": "ui_sort_index",
6866
7181
  "type": "integer",
@@ -6881,10 +7196,10 @@ export const CLI_COMMANDS = [
6881
7196
  "deprecated": null
6882
7197
  },
6883
7198
  {
6884
- "name": "metric_id",
6885
- "type": "string",
7199
+ "name": "metric_ids",
7200
+ "type": "string[]",
6886
7201
  "required": false,
6887
- "description": "Metric this component displays. Optional.",
7202
+ "description": "Metrics the card shows together, in order. Optional.",
6888
7203
  "allowed_values": [],
6889
7204
  "deprecated": null
6890
7205
  }
@@ -6903,7 +7218,7 @@ export const CLI_COMMANDS = [
6903
7218
  "pages:write"
6904
7219
  ],
6905
7220
  "notes": [
6906
- "The metric itself is not affected, only its placement on this page."
7221
+ "The metrics themselves are not affected, only the card on this page."
6907
7222
  ],
6908
7223
  "path_params": [
6909
7224
  {
@@ -9618,6 +9933,14 @@ export const CLI_COMMANDS = [
9618
9933
  "allowed_values": [],
9619
9934
  "deprecated": null
9620
9935
  },
9936
+ {
9937
+ "name": "block_on_failure",
9938
+ "type": "boolean",
9939
+ "required": false,
9940
+ "description": "Wait for acknowledgement before sending later deliveries. Defaults to false. Check block_on_failure in the response for availability; null means the setting is unavailable. Optional.",
9941
+ "allowed_values": [],
9942
+ "deprecated": null
9943
+ },
9621
9944
  {
9622
9945
  "name": "exclude_fields",
9623
9946
  "type": "string[]",
@@ -9705,6 +10028,14 @@ export const CLI_COMMANDS = [
9705
10028
  ],
9706
10029
  "deprecated": null
9707
10030
  },
10031
+ {
10032
+ "name": "block_on_failure",
10033
+ "type": "boolean",
10034
+ "required": false,
10035
+ "description": "Wait for acknowledgement before sending later deliveries. Defaults to false. Check block_on_failure in the response for availability; null means the setting is unavailable. Optional.",
10036
+ "allowed_values": [],
10037
+ "deprecated": null
10038
+ },
9708
10039
  {
9709
10040
  "name": "exclude_fields",
9710
10041
  "type": "string[]",