Skip to content

Expose database-monitoring monitor type #1354

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
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
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.4",
"regenerated": "2023-06-08 18:39:08.164533",
"spec_repo_commit": "0df91379"
"regenerated": "2023-06-08 19:45:34.367347",
"spec_repo_commit": "f3dd285f"
},
"v2": {
"apigentools_version": "1.6.4",
"regenerated": "2023-06-08 18:39:08.181065",
"spec_repo_commit": "0df91379"
"regenerated": "2023-06-08 19:45:34.380401",
"spec_repo_commit": "f3dd285f"
}
}
}
31 changes: 30 additions & 1 deletion .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7168,6 +7168,7 @@ components:
- ci-pipelines alert
- ci-tests alert
- error-tracking alert
- database-monitoring alert
example: query alert
type: string
x-enum-varnames:
Expand All @@ -7187,6 +7188,7 @@ components:
- CI_PIPELINES_ALERT
- CI_TESTS_ALERT
- ERROR_TRACKING_ALERT
- DATABASE_MONITORING_ALERT
MonitorUpdateRequest:
description: Object describing a monitor update request.
properties:
Expand Down Expand Up @@ -24698,6 +24700,8 @@ paths:

- error-tracking: `error-tracking alert`

- database-monitoring: `database-monitoring alert`


**Note**: Synthetic monitors are created through the Synthetics API. See the
[Synthetics API] (https://docs.datadoghq.com/api/latest/synthetics/) documentation
Expand Down Expand Up @@ -25023,7 +25027,32 @@ paths:

- `operator` `<`, `<=`, `>`, `>=`, `==`, or `!=`.

- `#` an integer or decimal number used to set the threshold.'
- `#` an integer or decimal number used to set the threshold.


**Database Monitoring Alert Query**


Example: `database-monitoring(query).rollup(rollup_method[, measure]).last(time_window)
operator #`


- `query` The search query - following the [Log search syntax](https://docs.datadoghq.com/logs/search_syntax/).

- `rollup_method` The stats roll-up 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 (between 1 and 2880), #h (between 1 and 48).

- `operator` `<`, `<=`, `>`, `>=`, `==`, or `!=`.

- `#` an integer or decimal number used to set the threshold.


**NOTE** Database Monitoring monitors are in alpha on US1.'
operationId: CreateMonitor
requestBody:
content:
Expand Down
14 changes: 14 additions & 0 deletions src/datadog_api_client/v1/api/monitors_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,7 @@ def create_monitor(
* event-v2: ``event-v2 alert``
* audit: ``audit alert``
* error-tracking: ``error-tracking alert``
* database-monitoring: ``database-monitoring alert``

**Note** : Synthetic monitors are created through the Synthetics API. See the [Synthetics API] (https://docs.datadoghq.com/api/latest/synthetics/) documentation for more information.

Expand Down Expand Up @@ -568,6 +569,19 @@ def create_monitor(
* ``operator`` ``<`` , ``<=`` , ``>`` , ``>=`` , ``==`` , or ``!=``.
* ``#`` an integer or decimal number used to set the threshold.

**Database Monitoring Alert Query**

Example: ``database-monitoring(query).rollup(rollup_method[, measure]).last(time_window) operator #``

* ``query`` The search query - following the `Log search syntax <https://docs.datadoghq.com/logs/search_syntax/>`_.
* ``rollup_method`` The stats roll-up 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 (between 1 and 2880), #h (between 1 and 48).
* ``operator`` ``<`` , ``<=`` , ``>`` , ``>=`` , ``==`` , or ``!=``.
* ``#`` an integer or decimal number used to set the threshold.

**NOTE** Database Monitoring monitors are in alpha on US1.

:param body: Create a monitor request body.
:type body: Monitor
:rtype: Monitor
Expand Down
5 changes: 4 additions & 1 deletion src/datadog_api_client/v1/model/monitor_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class MonitorType(ModelSimple):
"""
The type of the monitor. For more information about `type`, see the [monitor options](https://docs.datadoghq.com/monitors/guide/monitor_api_options/) docs.

:param value: Must be one of ["composite", "event alert", "log alert", "metric alert", "process alert", "query alert", "rum alert", "service check", "synthetics alert", "trace-analytics alert", "slo alert", "event-v2 alert", "audit alert", "ci-pipelines alert", "ci-tests alert", "error-tracking alert"].
:param value: Must be one of ["composite", "event alert", "log alert", "metric alert", "process alert", "query alert", "rum alert", "service check", "synthetics alert", "trace-analytics alert", "slo alert", "event-v2 alert", "audit alert", "ci-pipelines alert", "ci-tests alert", "error-tracking alert", "database-monitoring alert"].
:type value: str
"""

Expand All @@ -37,6 +37,7 @@ class MonitorType(ModelSimple):
"ci-pipelines alert",
"ci-tests alert",
"error-tracking alert",
"database-monitoring alert",
}
COMPOSITE: ClassVar["MonitorType"]
EVENT_ALERT: ClassVar["MonitorType"]
Expand All @@ -54,6 +55,7 @@ class MonitorType(ModelSimple):
CI_PIPELINES_ALERT: ClassVar["MonitorType"]
CI_TESTS_ALERT: ClassVar["MonitorType"]
ERROR_TRACKING_ALERT: ClassVar["MonitorType"]
DATABASE_MONITORING_ALERT: ClassVar["MonitorType"]

@cached_property
def openapi_types(_):
Expand All @@ -78,3 +80,4 @@ def openapi_types(_):
MonitorType.CI_PIPELINES_ALERT = MonitorType("ci-pipelines alert")
MonitorType.CI_TESTS_ALERT = MonitorType("ci-tests alert")
MonitorType.ERROR_TRACKING_ALERT = MonitorType("error-tracking alert")
MonitorType.DATABASE_MONITORING_ALERT = MonitorType("database-monitoring alert")