GithubHelp home page GithubHelp logo

Comments (3)

busunkim96 avatar busunkim96 commented on June 10, 2024

Hi @plankthom,

As you've noticed, not all the request fields can be passed to the method. The list of parameters can be thought of as something like an overload. The specific set of parameters is determined by an annotation in the source protos called google.api.method_signature. See https://google.aip.dev/client-libraries/4232#method-signatures for details.

This is why name, filter, interval, and view are method parameters but aggregation is not.
https://github.com/googleapis/googleapis/blob/eabe7c0fde64b1451df6ea171b2009238b0df07c/google/monitoring/v3/metric_service.proto#L120-L125

  rpc ListTimeSeries(ListTimeSeriesRequest) returns (ListTimeSeriesResponse) {
    option (google.api.http) = {
      get: "/v3/{name=projects/*}/timeSeries"
    };
    option (google.api.method_signature) = "name,filter,interval,view";
  }

def list_time_series(
self,
request: metric_service.ListTimeSeriesRequest = None,
*,
name: str = None,
filter: str = None,
interval: common.TimeInterval = None,
view: metric_service.ListTimeSeriesRequest.TimeSeriesView = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListTimeSeriesPager:

from python-monitoring.

plankthom avatar plankthom commented on June 10, 2024

@busunkim96

As you've noticed, not all the request fields can be passed to the method

Indeed i've noticed. The actual bug that I am reporting is that the SDK itself doesn't respect this limitation in

params["aggregation"] = types.Aggregation(

which breaks the feature documented in https://googleapis.dev/python/monitoring/latest/query.html as align method.

from python-monitoring.

busunkim96 avatar busunkim96 commented on June 10, 2024

Ah sorry about that, I wasn't reading carefully enough. 🤦‍♀️

It looks like iter should construct a request object with the params and then pass the request object to list_time_series.

if self._end_time is None:
raise ValueError("Query time interval not specified.")
params = self._build_query_params(headers_only, page_size)
for ts in self._client.list_time_series(**params):
yield ts

Thank you for the report!

from python-monitoring.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.