Skip to content
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

Monitoring - Look for specific messages in retries #2451

Closed
wants to merge 5 commits into from
Closed
Changes from 1 commit
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
7 changes: 6 additions & 1 deletion system_tests/monitoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,14 @@ def _query_timeseries_with_retries():
def _has_timeseries(result):
return len(list(result)) > 0

def _unknown_metric(result):
return ('The provided filter doesn\'t refer to any known '
'metric.'in result.message)

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.


retry_result = RetryResult(_has_timeseries,
max_tries=MAX_RETRIES)(client.query)
return RetryErrors(BadRequest, max_tries=MAX_RETRIES)(retry_result)
return RetryErrors(BadRequest, _unknown_metric,

This comment was marked as spam.

This comment was marked as spam.

max_tries=MAX_RETRIES)(retry_result)

query = _query_timeseries_with_retries()(METRIC_TYPE, minutes=5)
timeseries_list = list(query)
Expand Down