Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
title: MethodSource
type: object
description: The underlying source (credit card, bank account, etc) used by a payment method.
discriminator:
propertyName: type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ required:
properties:
time:
description: When the metric was submitted to the platform.
$ref: ../DateTime.yml
$ref: ../../DateTime.yml
labels:
type: object
description: Additional key-values that can be used for querying in an aggregation pipeline. Often useful for filtering.
Expand All @@ -26,7 +26,7 @@ properties:
type: array
items:
anyOf:
- $ref: ../DateTime.yml
- $ref: ../../DateTime.yml
- type: integer
metadata:
description: Information about this metric, such as the type of metric, the data it represents, and critical common information such as hub ID and associated cluster.
Expand Down Expand Up @@ -111,22 +111,22 @@ properties:
description: The originator of this metric.
type: string
hub_id:
$ref: ../ID.yml
$ref: ../../ID.yml
component:
description: The specific resource ID and type associated with this metric.
type:
type:
- object
- "null"
required:
- id
- type
properties:
id:
$ref: ../ID.yml
$ref: ../../ID.yml
type:
type: string
cluster:
description: "The cluster associated with this metric"
type:
type:
- string
- "null"
131 changes: 131 additions & 0 deletions components/schemas/monitoring/monitors/Monitor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
title: Monitor
description: >
A user-defined monitor that watches conditions on the platform and raises alarms
when configured rules trigger. Monitors have a scope that determines what they
observe (globally or against specific clusters) and a configuration that
defines their evaluation logic.
type: object
required:
- id
- hub_id
- identifier
- creator
- status
- name
- description
- scope
- config
- state
- events
properties:
id:
type: string
description: A unique identifier for this monitor.
hub_id:
type: string
description: The ID of the hub this monitor belongs to.
identifier:
$ref: "../../Identifier.yml"
creator:
$ref: "../../common/UserScope.yml"
description: The user or entity that created this monitor.
status:
type: string
enum:
- ok
- no-data
- alarm
description: >
The current evaluation status of the monitor.
- `ok` - the monitor is evaluating and its rules are not triggered.
- `no-data` - the monitor has not received enough data to evaluate.
- `alarm` - the monitor's rules have triggered and the monitor is in an alarm state.
name:
type: string
description: A human-readable name for this monitor.
description:
type: string
description: A longer description of what this monitor observes and why.
scope:
type: object
description: What this monitor observes. Either global or scoped to specific clusters.
required:
- global
- clusters
properties:
global:
type: boolean
description: When true, the monitor observes all clusters within the hub.
clusters:
type: array
description: Cluster identifiers this monitor is scoped to. Ignored when global is true.
items:
$ref: "../../Identifier.yml"
config:
$ref: "./MonitorConfig.yml"
description: The evaluation configuration for this monitor.
state:
title: MonitorStateInfo
type: object
description: The current runtime state of the monitor.
required:
- current
- changed
properties:
current:
type: string
enum:
- paused
- live
- deleting
- deleted
description: >
The current lifecycle state of the monitor.
- `paused` - the monitor exists but is not evaluating.
- `live` - the monitor is evaluating on its configured window.
- `deleting` - the monitor is being torn down.
- `deleted` - the monitor has been removed.
changed:
description: The timestamp of the most recent state transition.
$ref: "../../DateTime.yml"
error:
type: object
description: Details of the last error, if the monitor is in an error condition.
required:
- message
- time
properties:
message:
type: string
description: A description of the error.
time:
description: The timestamp at which the error was recorded.
$ref: "../../DateTime.yml"
events:
title: MonitorEvents
type: object
description: A collection of timestamps for events in the Monitor's lifetime.
required:
- created
- updated
- deleted
properties:
created:
description: The timestamp of when the monitor was created.
$ref: "../../DateTime.yml"
updated:
description: The timestamp of when the monitor was updated.
$ref: "../../DateTime.yml"
deleted:
description: The timestamp of when the monitor was deleted.
$ref: "../../DateTime.yml"
last_alarm:
description: The timestamp of the most recent alarm event.
$ref: "../../DateTime.yml"
last_check:
description: The timestamp of the most recent evaluation.
$ref: "../../DateTime.yml"
meta:
type: object
description: Additional metadata attached to the monitor response.
additionalProperties: true
15 changes: 15 additions & 0 deletions components/schemas/monitoring/monitors/MonitorAction.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
title: MonitorAction
description: >
An action taken when a monitor's rule set matches. The type discriminates
what runs; details carries the type-specific configuration.
type: object
required:
- type
- details
properties:
type:
type: string
description: The kind of action to take. Determines the shape of the details object.
details:
description: Type-specific configuration for the action.
additionalProperties: true
25 changes: 25 additions & 0 deletions components/schemas/monitoring/monitors/MonitorConfig.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
title: MonitorConfig
description: >
Configuration that defines how a monitor evaluates. The window and cool down
govern timing, the rule set defines the conditions that trigger an alarm,
and the actions list what happens when one does.
type: object
required:
- window
- cool_down
- rule_set
- actions
properties:
window:
description: The evaluation window over which rules are checked.
$ref: "../../Duration.yml"
cool_down:
description: The minimum time between successive alarms. Suppresses re-triggering while an alarm state persists.
$ref: "../../Duration.yml"
rule_set:
$ref: "./rules/MonitorRuleSet.yml"
actions:
type: array
description: Actions taken when the rule set evaluates to an alarm state.
items:
$ref: "./MonitorAction.yml"
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
title: ActionGroup
description: >
A named, reusable collection of actions. Monitors can reference an action group
so that a single set of alarm responses can be shared across many monitors and
updated in one place.
type: object
required:
- id
- hub_id
- identifier
- creator
- name
- description
- actions
- state
- events
properties:
id:
type: string
description: A unique identifier for this action group.
hub_id:
type: string
description: The ID of the hub this action group belongs to.
identifier:
$ref: "../../../Identifier.yml"
creator:
$ref: "../../../common/UserScope.yml"
description: The user or entity that created this action group.
name:
type: string
description: A human-readable name for this action group.
description:
type: string
description: A longer description of what this action group does and when it is used.
actions:
type: array
description: The actions run when this group is triggered.
items:
$ref: "../MonitorAction.yml"
state:
title: ActionGroupStateInfo
type: object
description: The current runtime state of the action group.
required:
- current
- changed
properties:
current:
type: string
enum:
- live
- deleting
- deleted
description: The current state of the action group.
changed:
description: The timestamp of the most recent state transition.
$ref: "../../../DateTime.yml"
error:
type: object
description: Details of the last error, if the action group is in an error condition.
required:
- message
- time
properties:
message:
type: string
description: A description of the error.
time:
description: The timestamp at which the error was recorded.
$ref: "../../../DateTime.yml"
events:
title: ActionGroupEvents
type: object
description: A collection of timestamps for events in the action group's lifetime.
required:
- created
- updated
- deleted
properties:
created:
description: The timestamp of when the action group was created.
$ref: "../../../DateTime.yml"
updated:
description: The timestamp of when the action group was updated.
$ref: "../../../DateTime.yml"
deleted:
description: The timestamp of when the action group was deleted.
$ref: "../../../DateTime.yml"
meta:
type: object
description: Additional metadata attached to the action group response.
additionalProperties: true
40 changes: 40 additions & 0 deletions components/schemas/monitoring/monitors/rules/MonitorEventRule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
title: MonitorEventRule
description: >
An event-based rule. At least one of target, priority, or type must be set;
the rule matches when a platform event satisfies every set field. Occurrences
controls how many matching events within the monitor's window are required
for the rule to trigger.
type: object
required:
- type
- details
properties:
type:
type: string
enum:
- event
description: Identifies this as an event rule.
details:
type: object
required:
- occurrences
properties:
target:
oneOf:
- $ref: ./MonitorRuleTarget.yml
- type: "null"
description: The event target to match on. Null disables this filter.
priority:
oneOf:
- type: string
- type: "null"
description: The event priority to match on. Null disables this filter.
type:
oneOf:
- type: string
- type: "null"
description: The event type to match on. Null disables this filter.
occurrences:
type: integer
minimum: 1
description: The minimum number of matching events within the monitor's window required to trigger.
Loading
Loading