Skip to content
This repository has been archived by the owner on Dec 31, 2023. It is now read-only.

Commit

Permalink
feat: Added support for log-based alerts (#204)
Browse files Browse the repository at this point in the history
See https://cloud.google.com/logging/docs/alerting/log-based-alerts for more information about logs-based alerts

- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 393200011

Source-Link: googleapis/googleapis@354d076

Source-Link: googleapis/googleapis-gen@5791e7b

feat: Added support for user-defined labels on cloud monitoring's Service object
feat: Added support for user-defined labels on cloud monitoring's ServiceLevelObjective object
fix: mark required fields in QueryTimeSeriesRequest as required by the backend
  • Loading branch information
gcf-owl-bot[bot] committed Aug 27, 2021
1 parent 2def0f3 commit b56a78c
Show file tree
Hide file tree
Showing 36 changed files with 293 additions and 239 deletions.
2 changes: 0 additions & 2 deletions google/cloud/monitoring/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
from google.cloud.monitoring_v3.types.common import TimeInterval
from google.cloud.monitoring_v3.types.common import TypedValue
from google.cloud.monitoring_v3.types.common import ComparisonType
from google.cloud.monitoring_v3.types.common import ServiceTier
from google.cloud.monitoring_v3.types.dropped_labels import DroppedLabels
from google.cloud.monitoring_v3.types.group import Group
from google.cloud.monitoring_v3.types.group_service import CreateGroupRequest
Expand Down Expand Up @@ -236,7 +235,6 @@
"TimeInterval",
"TypedValue",
"ComparisonType",
"ServiceTier",
"DroppedLabels",
"Group",
"CreateGroupRequest",
Expand Down
2 changes: 0 additions & 2 deletions google/cloud/monitoring_v3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
from .types.common import TimeInterval
from .types.common import TypedValue
from .types.common import ComparisonType
from .types.common import ServiceTier
from .types.dropped_labels import DroppedLabels
from .types.group import Group
from .types.group_service import CreateGroupRequest
Expand Down Expand Up @@ -216,7 +215,6 @@
"ServiceLevelIndicator",
"ServiceLevelObjective",
"ServiceMonitoringServiceClient",
"ServiceTier",
"SpanContext",
"TextLocator",
"TimeInterval",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,9 @@ async def list_alert_policies(
The request object. The protocol for the
`ListAlertPolicies` request.
name (:class:`str`):
Required. The project whose alert policies are to be
listed. The format is:
Required. The
`project <https://cloud.google.com/monitoring/api/v3#project_name>`__
whose alert policies are to be listed. The format is:
::
Expand Down Expand Up @@ -257,7 +258,6 @@ async def list_alert_policies(
maximum=30.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
),
deadline=30.0,
Expand Down Expand Up @@ -351,7 +351,6 @@ async def get_alert_policy(
maximum=30.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
),
deadline=30.0,
Expand Down Expand Up @@ -389,8 +388,9 @@ async def create_alert_policy(
The request object. The protocol for the
`CreateAlertPolicy` request.
name (:class:`str`):
Required. The project in which to create the alerting
policy. The format is:
Required. The
`project <https://cloud.google.com/monitoring/api/v3#project_name>`__
in which to create the alerting policy. The format is:
::
Expand Down Expand Up @@ -532,7 +532,6 @@ async def delete_alert_policy(
maximum=30.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
),
deadline=30.0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,9 @@ def list_alert_policies(
The request object. The protocol for the
`ListAlertPolicies` request.
name (str):
Required. The project whose alert policies are to be
listed. The format is:
Required. The
`project <https://cloud.google.com/monitoring/api/v3#project_name>`__
whose alert policies are to be listed. The format is:
::
Expand Down Expand Up @@ -568,8 +569,9 @@ def create_alert_policy(
The request object. The protocol for the
`CreateAlertPolicy` request.
name (str):
Required. The project in which to create the alerting
policy. The format is:
Required. The
`project <https://cloud.google.com/monitoring/api/v3#project_name>`__
in which to create the alerting policy. The format is:
::
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ def _prep_wrapped_messages(self, client_info):
maximum=30.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
),
deadline=30.0,
Expand All @@ -182,7 +181,6 @@ def _prep_wrapped_messages(self, client_info):
maximum=30.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
),
deadline=30.0,
Expand All @@ -200,7 +198,6 @@ def _prep_wrapped_messages(self, client_info):
maximum=30.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
),
deadline=30.0,
Expand Down
19 changes: 8 additions & 11 deletions google/cloud/monitoring_v3/services/group_service/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,9 @@ async def list_groups(
request (:class:`google.cloud.monitoring_v3.types.ListGroupsRequest`):
The request object. The `ListGroup` request.
name (:class:`str`):
Required. The project whose groups are to be listed. The
format is:
Required. The
`project <https://cloud.google.com/monitoring/api/v3#project_name>`__
whose groups are to be listed. The format is:
::
Expand Down Expand Up @@ -237,7 +238,6 @@ async def list_groups(
maximum=30.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
),
deadline=30.0,
Expand Down Expand Up @@ -357,7 +357,6 @@ async def get_group(
maximum=30.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
),
deadline=30.0,
Expand Down Expand Up @@ -394,8 +393,9 @@ async def create_group(
request (:class:`google.cloud.monitoring_v3.types.CreateGroupRequest`):
The request object. The `CreateGroup` request.
name (:class:`str`):
Required. The project in which to create the group. The
format is:
Required. The
`project <https://cloud.google.com/monitoring/api/v3#project_name>`__
in which to create the group. The format is:
::
Expand Down Expand Up @@ -585,12 +585,11 @@ async def update_group(
maximum=30.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
),
deadline=30.0,
deadline=180.0,
),
default_timeout=30.0,
default_timeout=180.0,
client_info=DEFAULT_CLIENT_INFO,
)

Expand Down Expand Up @@ -666,7 +665,6 @@ async def delete_group(
maximum=30.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
),
deadline=30.0,
Expand Down Expand Up @@ -752,7 +750,6 @@ async def list_group_members(
maximum=30.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
),
deadline=30.0,
Expand Down
10 changes: 6 additions & 4 deletions google/cloud/monitoring_v3/services/group_service/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,9 @@ def list_groups(
request (google.cloud.monitoring_v3.types.ListGroupsRequest):
The request object. The `ListGroup` request.
name (str):
Required. The project whose groups are to be listed. The
format is:
Required. The
`project <https://cloud.google.com/monitoring/api/v3#project_name>`__
whose groups are to be listed. The format is:
::
Expand Down Expand Up @@ -560,8 +561,9 @@ def create_group(
request (google.cloud.monitoring_v3.types.CreateGroupRequest):
The request object. The `CreateGroup` request.
name (str):
Required. The project in which to create the group. The
format is:
Required. The
`project <https://cloud.google.com/monitoring/api/v3#project_name>`__
in which to create the group. The format is:
::
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ def _prep_wrapped_messages(self, client_info):
maximum=30.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
),
deadline=30.0,
Expand All @@ -183,7 +182,6 @@ def _prep_wrapped_messages(self, client_info):
maximum=30.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
),
deadline=30.0,
Expand All @@ -201,12 +199,11 @@ def _prep_wrapped_messages(self, client_info):
maximum=30.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
),
deadline=30.0,
deadline=180.0,
),
default_timeout=30.0,
default_timeout=180.0,
client_info=client_info,
),
self.delete_group: gapic_v1.method.wrap_method(
Expand All @@ -216,7 +213,6 @@ def _prep_wrapped_messages(self, client_info):
maximum=30.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
),
deadline=30.0,
Expand All @@ -231,7 +227,6 @@ def _prep_wrapped_messages(self, client_info):
maximum=30.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
),
deadline=30.0,
Expand Down
41 changes: 19 additions & 22 deletions google/cloud/monitoring_v3/services/metric_service/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,9 @@ async def list_monitored_resource_descriptors(
The request object. The
`ListMonitoredResourceDescriptors` request.
name (:class:`str`):
Required. The project on which to execute the request.
The format is:
Required. The
`project <https://cloud.google.com/monitoring/api/v3#project_name>`__
on which to execute the request. The format is:
::
Expand Down Expand Up @@ -244,7 +245,6 @@ async def list_monitored_resource_descriptors(
maximum=30.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
),
deadline=30.0,
Expand Down Expand Up @@ -348,7 +348,6 @@ async def get_monitored_resource_descriptor(
maximum=30.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
),
deadline=30.0,
Expand Down Expand Up @@ -385,8 +384,9 @@ async def list_metric_descriptors(
request (:class:`google.cloud.monitoring_v3.types.ListMetricDescriptorsRequest`):
The request object. The `ListMetricDescriptors` request.
name (:class:`str`):
Required. The project on which to execute the request.
The format is:
Required. The
`project <https://cloud.google.com/monitoring/api/v3#project_name>`__
on which to execute the request. The format is:
::
Expand Down Expand Up @@ -435,7 +435,6 @@ async def list_metric_descriptors(
maximum=30.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
),
deadline=30.0,
Expand Down Expand Up @@ -532,7 +531,6 @@ async def get_metric_descriptor(
maximum=30.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
),
deadline=30.0,
Expand Down Expand Up @@ -572,12 +570,10 @@ async def create_metric_descriptor(
The request object. The `CreateMetricDescriptor`
request.
name (:class:`str`):
Required. The project on which to execute the request.
The format is:
::
projects/[PROJECT_ID_OR_NUMBER]
Required. The
`project <https://cloud.google.com/monitoring/api/v3#project_name>`__
on which to execute the request. The format is: 4
projects/[PROJECT_ID_OR_NUMBER]
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
Expand Down Expand Up @@ -707,7 +703,6 @@ async def delete_metric_descriptor(
maximum=30.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
),
deadline=30.0,
Expand Down Expand Up @@ -746,8 +741,10 @@ async def list_time_series(
request (:class:`google.cloud.monitoring_v3.types.ListTimeSeriesRequest`):
The request object. The `ListTimeSeries` request.
name (:class:`str`):
Required. The project, organization or folder on which
to execute the request. The format is:
Required. The
`project <https://cloud.google.com/monitoring/api/v3#project_name>`__,
organization or folder on which to execute the request.
The format is:
::
Expand Down Expand Up @@ -837,12 +834,11 @@ async def list_time_series(
maximum=30.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
),
deadline=30.0,
deadline=90.0,
),
default_timeout=30.0,
default_timeout=90.0,
client_info=DEFAULT_CLIENT_INFO,
)

Expand Down Expand Up @@ -884,8 +880,9 @@ async def create_time_series(
request (:class:`google.cloud.monitoring_v3.types.CreateTimeSeriesRequest`):
The request object. The `CreateTimeSeries` request.
name (:class:`str`):
Required. The project on which to execute the request.
The format is:
Required. The
`project <https://cloud.google.com/monitoring/api/v3#project_name>`__
on which to execute the request. The format is:
::
Expand Down
Loading

0 comments on commit b56a78c

Please sign in to comment.