diff --git a/.apigentools-info b/.apigentools-info index 41f28333398..e5cf1a71b9b 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.0.0b3", - "regenerated": "2020-05-01 16:38:18.985457", - "spec_repo_commit": "afd3d4d" + "regenerated": "2020-05-04 11:12:33.051540", + "spec_repo_commit": "14ea455" }, "v2": { "apigentools_version": "1.0.0b3", - "regenerated": "2020-05-01 16:38:24.307894", - "spec_repo_commit": "afd3d4d" + "regenerated": "2020-05-04 11:12:38.552093", + "spec_repo_commit": "14ea455" } } } \ No newline at end of file diff --git a/api_docs/v1/MonitorType.md b/api_docs/v1/MonitorType.md index 9d8f9de480b..7969cceea06 100644 --- a/api_docs/v1/MonitorType.md +++ b/api_docs/v1/MonitorType.md @@ -17,6 +17,8 @@ * `QUERY_ALERT` (value: `"query alert"`) +* `RUM_ALERT` (value: `"rum alert"`) + * `SERVICE_CHECK` (value: `"service check"`) * `SYNTHETICS_ALERT` (value: `"synthetics alert"`) diff --git a/api_docs/v1/MonitorsApi.md b/api_docs/v1/MonitorsApi.md index 0c122fe4b46..16b532bcf81 100644 --- a/api_docs/v1/MonitorsApi.md +++ b/api_docs/v1/MonitorsApi.md @@ -104,6 +104,109 @@ Create a monitor Create a monitor using the specified options. +#### Monitor Types + +The type of monitor chosen from: +- anomaly: `query alert` +- apm: `query alert` +- composite: `composite` +- custom: `service check` +- event: `event alert` +- forecast: `query alert` +- host: `service check` +- integration: `query alert` or `service check` +- live process: `process alert` +- logs: `logs alert` +- metric: `metric alert` +- network: `service check` +- outlier: `query alert` +- process: `service query` +- rum: `alert` +- watchdog: `event alert` + +#### Query Types + +**Metric Alert Query** + +Example: `time_aggr(time_window):space_aggr:metric{tags} [by {key}] operator #` + +- `time_aggr`: avg, sum, max, min, change, or pct_change +- `time_window`: `last_#m` (with `#` being 5, 10, 15, or 30) or `last_#h`(with `#` being 1, 2, or 4), or `last_1d` +- `space_aggr`: avg, sum, min, or max +- `tags`: one or more tags (comma-separated), or * +- `key`: a 'key' in key:value tag syntax; defines a separate alert for each tag in the group (multi-alert) +- `operator`: <, <=, >, >=, ==, or != +- `#`: an integer or decimal number used to set the threshold + +If you are using the `_change_` or `_pct_change_` time aggregator, instead use `change_aggr(time_aggr(time_window), +timeshift):space_aggr:metric{tags} [by {key}] operator #` with: + +- `change_aggr` change, pct_change +- `time_aggr` avg, sum, max, min [Learn more](https://docs.datadoghq.com/monitors/monitor_types/#define-the-conditions) +- `time_window` last\_#m (1, 5, 10, 15, or 30), last\_#h (1, 2, or 4), or last_#d (1 or 2) +- `timeshift` #m_ago (5, 10, 15, or 30), #h_ago (1, 2, or 4), or 1d_ago + +Use this to create an outlier monitor using the following query: +`avg(last_30m):outliers(avg:system.cpu.user{role:es-events-data} by {host}, 'dbscan', 7) > 0` + +**Service Check Query** + +Example: `"check".over(tags).last(count).count_by_status()` + +- **`check`** name of the check, e.g. datadog.agent.up +- **`tags`** one or more quoted tags (comma-separated), or "*". e.g.: `.over("env:prod", "role:db")` +- **`count`** must be at >= your max threshold (defined in the `options`). +e.g. if you want to notify on 1 critical, 3 ok and 2 warn statuses count should be 3. It is limited to 100. + +**Event Alert Query** + +Example: `events('sources:nagios status:error,warning priority:normal tags: "string query"').rollup("count").last("1h")"` + +- **`event`**, the event query string: +- **`string_query`** free text query to match against event title and text. +- **`sources`** event sources (comma-separated). +- **`status`** event statuses (comma-separated). Valid options: error, warn, and info. +- **`priority`** event priorities (comma-separated). Valid options: low, normal, all. +- **`host`** event reporting host (comma-separated). +- **`tags`** event tags (comma-separated). +- **`excluded_tags`** exluded event tags (comma-separated). +- **`rollup`** the stats rollup method. `count` is the only supported method now. +- **`last`** the timeframe to roll up the counts. Examples: 60s, 4h. Supported timeframes: s, m, h and d. + +**Process Alert Query** + +Example: `processes(search).over(tags).rollup('count').last(timeframe) operator #` + +- **`search`** free text search string for querying processes. +Matching processes match results on the [Live Processes](https://docs.datadoghq.com/infrastructure/process/?tab=linuxwindows) page. +- **`tags`** one or more tags (comma-separated) +- **`timeframe`** the timeframe to roll up the counts. Examples: 60s, 4h. Supported timeframes: s, m, h and d +- **`operator`** <, <=, >, >=, ==, or != +- **`#`** an integer or decimal number used to set the threshold + +**Logs Alert Query** + +Example: `logs(query).index(index_name).rollup(rollup_method[, measure]).last(time_window) operator #` + +- **`query`** The search query - following the [Log search syntax](https://docs.datadoghq.com/logs/search_syntax/). +- **`index_name`** For multi-index organizations, the log index in which the request is performed. +- **`rollup_method`** The stats rollup method - supports `count`, `avg` and `cardinality`. +- **`measure`** For `avg` and cardinality `rollup_method` - specify the measure or the facet name you want to use. +- **`time_window`** #m (5, 10, 15, or 30), #h (1, 2, or 4, 24) +- **`operator`** `<`, `<=`, `>`, `>=`, `==`, or `!=`. +- **`#`** an integer or decimal number used to set the threshold. + +**Composite Query** + +Example: `12345 && 67890`, where `12345` and `67890` are the IDs of non-composite monitors + +* **`name`** [*required*, *default* = **dynamic, based on query**]: The name of the alert. +* **`message`** [*required*, *default* = **dynamic, based on query**]: A message to include with notifications for this monitor. +Email notifications can be sent to specific users by using the same '@username' notation as events. +* **`tags`** [*optional*, *default* = **empty list**]: A list of tags to associate with your monitor. +When getting all monitor details via the API, use the `monitor_tags` argument to filter results by these tags. +It is only available via the API and isn't visible or editable in the Datadog UI. + ### Example ```java diff --git a/src/main/java/com/datadog/api/v1/client/api/MonitorsApi.java b/src/main/java/com/datadog/api/v1/client/api/MonitorsApi.java index 86423fb9731..ce151bef94a 100644 --- a/src/main/java/com/datadog/api/v1/client/api/MonitorsApi.java +++ b/src/main/java/com/datadog/api/v1/client/api/MonitorsApi.java @@ -246,7 +246,7 @@ public ApiResponse executeWithHttpInfo() throws ApiException { /** * Create a monitor - * Create a monitor using the specified options. + * Create a monitor using the specified options. #### Monitor Types The type of monitor chosen from: - anomaly: `query alert` - apm: `query alert` - composite: `composite` - custom: `service check` - event: `event alert` - forecast: `query alert` - host: `service check` - integration: `query alert` or `service check` - live process: `process alert` - logs: `logs alert` - metric: `metric alert` - network: `service check` - outlier: `query alert` - process: `service query` - rum: `alert` - watchdog: `event alert` #### Query Types **Metric Alert Query** Example: `time_aggr(time_window):space_aggr:metric{tags} [by {key}] operator #` - `time_aggr`: avg, sum, max, min, change, or pct_change - `time_window`: `last_#m` (with `#` being 5, 10, 15, or 30) or `last_#h`(with `#` being 1, 2, or 4), or `last_1d` - `space_aggr`: avg, sum, min, or max - `tags`: one or more tags (comma-separated), or * - `key`: a 'key' in key:value tag syntax; defines a separate alert for each tag in the group (multi-alert) - `operator`: <, <=, >, >=, ==, or != - `#`: an integer or decimal number used to set the threshold If you are using the `_change_` or `_pct_change_` time aggregator, instead use `change_aggr(time_aggr(time_window), timeshift):space_aggr:metric{tags} [by {key}] operator #` with: - `change_aggr` change, pct_change - `time_aggr` avg, sum, max, min [Learn more](https://docs.datadoghq.com/monitors/monitor_types/#define-the-conditions) - `time_window` last\\_#m (1, 5, 10, 15, or 30), last\\_#h (1, 2, or 4), or last_#d (1 or 2) - `timeshift` #m_ago (5, 10, 15, or 30), #h_ago (1, 2, or 4), or 1d_ago Use this to create an outlier monitor using the following query: `avg(last_30m):outliers(avg:system.cpu.user{role:es-events-data} by {host}, 'dbscan', 7) > 0` **Service Check Query** Example: `\"check\".over(tags).last(count).count_by_status()` - **`check`** name of the check, e.g. datadog.agent.up - **`tags`** one or more quoted tags (comma-separated), or \"*\". e.g.: `.over(\"env:prod\", \"role:db\")` - **`count`** must be at >= your max threshold (defined in the `options`). e.g. if you want to notify on 1 critical, 3 ok and 2 warn statuses count should be 3. It is limited to 100. **Event Alert Query** Example: `events('sources:nagios status:error,warning priority:normal tags: \"string query\"').rollup(\"count\").last(\"1h\")\"` - **`event`**, the event query string: - **`string_query`** free text query to match against event title and text. - **`sources`** event sources (comma-separated). - **`status`** event statuses (comma-separated). Valid options: error, warn, and info. - **`priority`** event priorities (comma-separated). Valid options: low, normal, all. - **`host`** event reporting host (comma-separated). - **`tags`** event tags (comma-separated). - **`excluded_tags`** exluded event tags (comma-separated). - **`rollup`** the stats rollup method. `count` is the only supported method now. - **`last`** the timeframe to roll up the counts. Examples: 60s, 4h. Supported timeframes: s, m, h and d. **Process Alert Query** Example: `processes(search).over(tags).rollup('count').last(timeframe) operator #` - **`search`** free text search string for querying processes. Matching processes match results on the [Live Processes](https://docs.datadoghq.com/infrastructure/process/?tab=linuxwindows) page. - **`tags`** one or more tags (comma-separated) - **`timeframe`** the timeframe to roll up the counts. Examples: 60s, 4h. Supported timeframes: s, m, h and d - **`operator`** <, <=, >, >=, ==, or != - **`#`** an integer or decimal number used to set the threshold **Logs Alert Query** Example: `logs(query).index(index_name).rollup(rollup_method[, measure]).last(time_window) operator #` - **`query`** The search query - following the [Log search syntax](https://docs.datadoghq.com/logs/search_syntax/). - **`index_name`** For multi-index organizations, the log index in which the request is performed. - **`rollup_method`** The stats rollup method - supports `count`, `avg` and `cardinality`. - **`measure`** For `avg` and cardinality `rollup_method` - specify the measure or the facet name you want to use. - **`time_window`** #m (5, 10, 15, or 30), #h (1, 2, or 4, 24) - **`operator`** `<`, `<=`, `>`, `>=`, `==`, or `!=`. - **`#`** an integer or decimal number used to set the threshold. **Composite Query** Example: `12345 && 67890`, where `12345` and `67890` are the IDs of non-composite monitors * **`name`** [*required*, *default* = **dynamic, based on query**]: The name of the alert. * **`message`** [*required*, *default* = **dynamic, based on query**]: A message to include with notifications for this monitor. Email notifications can be sent to specific users by using the same '@username' notation as events. * **`tags`** [*optional*, *default* = **empty list**]: A list of tags to associate with your monitor. When getting all monitor details via the API, use the `monitor_tags` argument to filter results by these tags. It is only available via the API and isn't visible or editable in the Datadog UI. * @return createMonitorRequest * @throws ApiException if fails to make API call diff --git a/src/main/java/com/datadog/api/v1/client/model/MonitorType.java b/src/main/java/com/datadog/api/v1/client/model/MonitorType.java index c39da8ddad9..3dc59db84bc 100644 --- a/src/main/java/com/datadog/api/v1/client/model/MonitorType.java +++ b/src/main/java/com/datadog/api/v1/client/model/MonitorType.java @@ -36,6 +36,8 @@ public enum MonitorType { QUERY_ALERT("query alert"), + RUM_ALERT("rum alert"), + SERVICE_CHECK("service check"), SYNTHETICS_ALERT("synthetics alert"), diff --git a/src/main/java/com/datadog/api/v1/openapi.yaml b/src/main/java/com/datadog/api/v1/openapi.yaml index a31587765bd..6a9572ebcbe 100644 --- a/src/main/java/com/datadog/api/v1/openapi.yaml +++ b/src/main/java/com/datadog/api/v1/openapi.yaml @@ -3628,6 +3628,7 @@ components: - metric alert - process alert - query alert + - rum alert - service check - synthetics alert - trace-analytics alert @@ -3639,6 +3640,7 @@ components: - METRIC_ALERT - PROCESS_ALERT - QUERY_ALERT + - RUM_ALERT - SERVICE_CHECK - SYNTHETICS_ALERT - TRACE_ANALYTICS_ALERT @@ -10453,7 +10455,216 @@ paths: tags: - Monitors post: - description: Create a monitor using the specified options. + description: 'Create a monitor using the specified options. + + + #### Monitor Types + + + The type of monitor chosen from: + + - anomaly: `query alert` + + - apm: `query alert` + + - composite: `composite` + + - custom: `service check` + + - event: `event alert` + + - forecast: `query alert` + + - host: `service check` + + - integration: `query alert` or `service check` + + - live process: `process alert` + + - logs: `logs alert` + + - metric: `metric alert` + + - network: `service check` + + - outlier: `query alert` + + - process: `service query` + + - rum: `alert` + + - watchdog: `event alert` + + + #### Query Types + + + **Metric Alert Query** + + + Example: `time_aggr(time_window):space_aggr:metric{tags} [by {key}] operator + #` + + + - `time_aggr`: avg, sum, max, min, change, or pct_change + + - `time_window`: `last_#m` (with `#` being 5, 10, 15, or 30) or `last_#h`(with + `#` being 1, 2, or 4), or `last_1d` + + - `space_aggr`: avg, sum, min, or max + + - `tags`: one or more tags (comma-separated), or * + + - `key`: a ''key'' in key:value tag syntax; defines a separate alert for each + tag in the group (multi-alert) + + - `operator`: <, <=, >, >=, ==, or != + + - `#`: an integer or decimal number used to set the threshold + + + If you are using the `_change_` or `_pct_change_` time aggregator, instead + use `change_aggr(time_aggr(time_window), + + timeshift):space_aggr:metric{tags} [by {key}] operator #` with: + + + - `change_aggr` change, pct_change + + - `time_aggr` avg, sum, max, min [Learn more](https://docs.datadoghq.com/monitors/monitor_types/#define-the-conditions) + + - `time_window` last\_#m (1, 5, 10, 15, or 30), last\_#h (1, 2, or 4), or + last_#d (1 or 2) + + - `timeshift` #m_ago (5, 10, 15, or 30), #h_ago (1, 2, or 4), or 1d_ago + + + Use this to create an outlier monitor using the following query: + + `avg(last_30m):outliers(avg:system.cpu.user{role:es-events-data} by {host}, + ''dbscan'', 7) > 0` + + + **Service Check Query** + + + Example: `"check".over(tags).last(count).count_by_status()` + + + - **`check`** name of the check, e.g. datadog.agent.up + + - **`tags`** one or more quoted tags (comma-separated), or "*". e.g.: `.over("env:prod", + "role:db")` + + - **`count`** must be at >= your max threshold (defined in the `options`). + + e.g. if you want to notify on 1 critical, 3 ok and 2 warn statuses count should + be 3. It is limited to 100. + + + **Event Alert Query** + + + Example: `events(''sources:nagios status:error,warning priority:normal tags: + "string query"'').rollup("count").last("1h")"` + + + - **`event`**, the event query string: + + - **`string_query`** free text query to match against event title and text. + + - **`sources`** event sources (comma-separated). + + - **`status`** event statuses (comma-separated). Valid options: error, warn, + and info. + + - **`priority`** event priorities (comma-separated). Valid options: low, normal, + all. + + - **`host`** event reporting host (comma-separated). + + - **`tags`** event tags (comma-separated). + + - **`excluded_tags`** exluded event tags (comma-separated). + + - **`rollup`** the stats rollup method. `count` is the only supported method + now. + + - **`last`** the timeframe to roll up the counts. Examples: 60s, 4h. Supported + timeframes: s, m, h and d. + + + **Process Alert Query** + + + Example: `processes(search).over(tags).rollup(''count'').last(timeframe) operator + #` + + + - **`search`** free text search string for querying processes. + + Matching processes match results on the [Live Processes](https://docs.datadoghq.com/infrastructure/process/?tab=linuxwindows) + page. + + - **`tags`** one or more tags (comma-separated) + + - **`timeframe`** the timeframe to roll up the counts. Examples: 60s, 4h. + Supported timeframes: s, m, h and d + + - **`operator`** <, <=, >, >=, ==, or != + + - **`#`** an integer or decimal number used to set the threshold + + + **Logs Alert Query** + + + Example: `logs(query).index(index_name).rollup(rollup_method[, measure]).last(time_window) + operator #` + + + - **`query`** The search query - following the [Log search syntax](https://docs.datadoghq.com/logs/search_syntax/). + + - **`index_name`** For multi-index organizations, the log index in which the + request is performed. + + - **`rollup_method`** The stats rollup method - supports `count`, `avg` and + `cardinality`. + + - **`measure`** For `avg` and cardinality `rollup_method` - specify the measure + or the facet name you want to use. + + - **`time_window`** #m (5, 10, 15, or 30), #h (1, 2, or 4, 24) + + - **`operator`** `<`, `<=`, `>`, `>=`, `==`, or `!=`. + + - **`#`** an integer or decimal number used to set the threshold. + + + **Composite Query** + + + Example: `12345 && 67890`, where `12345` and `67890` are the IDs of non-composite + monitors + + + * **`name`** [*required*, *default* = **dynamic, based on query**]: The name + of the alert. + + * **`message`** [*required*, *default* = **dynamic, based on query**]: A message + to include with notifications for this monitor. + + Email notifications can be sent to specific users by using the same ''@username'' + notation as events. + + * **`tags`** [*optional*, *default* = **empty list**]: A list of tags to associate + with your monitor. + + When getting all monitor details via the API, use the `monitor_tags` argument + to filter results by these tags. + + It is only available via the API and isn''t visible or editable in the Datadog + UI.' operationId: CreateMonitor requestBody: content: