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

Error when using paging to read timeseries #13

Closed
ocervell opened this issue Apr 20, 2020 · 1 comment · Fixed by #15
Closed

Error when using paging to read timeseries #13

ocervell opened this issue Apr 20, 2020 · 1 comment · Fixed by #15
Assignees
Labels
api: monitoring Issues related to the googleapis/python-monitoring API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@ocervell
Copy link

ocervell commented Apr 20, 2020

I'm getting the following error when using list(timeseries_response) to iterate over the pages in the response. The error happens only on big timeseries response containing lots of data.

The code I'm using is:

response = client.list_time_series(parent, filter, measurement_window, monitoring_v3.enums.ListTimeSeriesRequest.TimeSeriesView.FULL, aggregation)
good_ts = list(good_ts)

Traceback:

  File "/usr/local/lib/python3.7/site-packages/slo_generator/backends/stackdriver.py", line 68, in good_bad_ratio
    good_ts = list(good_ts)
  File "/usr/local/lib/python3.7/site-packages/google/api_core/page_iterator.py", line 212, in _items_iter
    for page in self._page_iter(increment=False):
  File "/usr/local/lib/python3.7/site-packages/google/api_core/page_iterator.py", line 243, in _page_iter
    page = self._next_page()
  File "/usr/local/lib/python3.7/site-packages/google/api_core/page_iterator.py", line 534, in _next_page
    response = self._method(self._request)
  File "/usr/local/lib/python3.7/site-packages/google/api_core/gapic_v1/method.py", line 143, in __call__
    return wrapped_func(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/google/api_core/retry.py", line 286, in retry_wrapped_func
    on_error=on_error,
  File "/usr/local/lib/python3.7/site-packages/google/api_core/retry.py", line 206, in retry_target
    last_exc,
  File "<string>", line 3, in raise_from
google.api_core.exceptions.RetryError: Deadline of 600.0s exceeded while calling functools.partial(<function _wrap_unary_errors.<locals>.error_remapped_callable at 0x106da29e0>, filter: "project=\"<ANONYMIZED>\" AND resource.type=\"generic_task\" AND metric.name=\"logging.googleapis.com/user/job_execution_completed\""
interval {
  start_time {
    seconds: 1586785806
    nanos: 266461849
  }
  end_time {
    seconds: 1587390606
    nanos: 266461849
  }
}
aggregation {
  alignment_period {
    seconds: 604800
  }
  per_series_aligner: ALIGN_SUM
  cross_series_reducer: REDUCE_SUM
}
name: "projects/<ANONYMIZED>"
, metadata=[('x-goog-request-params', 'name=projects/<ANONYMIZED>'), ('x-goog-api-client', 'gl-python/3.7.5 grpc/1.27.2 gax/1.16.0 gapic/0.34.0')]), last exception: 504 Deadline Exceeded
M100214:measure-slo-achievement 20011381$ 
@product-auto-label product-auto-label bot added the api: monitoring Issues related to the googleapis/python-monitoring API. label Apr 20, 2020
@ocervell ocervell changed the title Error when using paging Error when using paging to read timeseries Apr 20, 2020
@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Apr 21, 2020
@busunkim96
Copy link
Contributor

I think there is a deadline increase pending that should help with this in #15.

google.api_core.exceptions.RetryError: Deadline of 600.0s exceeded 

@busunkim96 busunkim96 added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. and removed triage me I really want to be triaged. labels Apr 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api: monitoring Issues related to the googleapis/python-monitoring API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants